Re: [PATCH 03/10] input: keyboard: adp5588-keys: bail out on returned error

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

 



On Fri, Jul 8, 2022 at 11:36 AM Nuno Sá <nuno.sa@xxxxxxxxxx> wrote:
>
> Don't continue in code paths after some error is found. It makes no
> sense to do any other device configuration if a previous one failed.

...

>                 for (i = 0; i <= ADP5588_BANK(ADP5588_MAXGPIO); i++) {
>                         int pull_mask = gpio_data->pullup_dis_mask;
>
> -                       ret |= adp5588_write(client, GPIO_PULL1 + i,
> +                       ret = adp5588_write(client, GPIO_PULL1 + i,
>                                 (pull_mask >> (8 * i)) & 0xFF);
> +                       if (ret)
> +                               return ret;
>                 }

Looks like a good candidate for bitmap_get_value8(pull_mask).

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux