Re: [PATCH v2 5/6] gpio: pca953x: Make platform teardown callback return void

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 15, 2022 at 11:02 AM Uwe Kleine-König
<u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
>
> All platforms that provide a teardown callback return 0. New users are
> supposed to not make use of platform support, so there is no
> functionality lost.
>
> This patch is a preparation for making i2c remove callbacks return void.

In case you need to send another version, consider below...

...

>         if (pdata && pdata->teardown) {
> -               ret = pdata->teardown(client, chip->gpio_chip.base,
> -                                     chip->gpio_chip.ngpio, pdata->context);
> -               if (ret < 0)
> -                       dev_err(&client->dev, "teardown failed, %d\n", ret);
> -       } else {
> -               ret = 0;
> +               pdata->teardown(client, chip->gpio_chip.base,
> +                               chip->gpio_chip.ngpio, pdata->context);
>         }

First of all, after this change the {} should not be needed.
Second, with a temporary variable

  struct gpio_chip *gc = &chip->gpio_chip;

this becomes a one liner like

  pdata->teardown(client, gc->base, gc->ngpio, pdata->context);

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux