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]

 




> -----Original Message-----
> From: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> Sent: Friday, July 8, 2022 4:25 PM
> To: Sa, Nuno <Nuno.Sa@xxxxxxxxxx>
> Cc: devicetree <devicetree@xxxxxxxxxxxxxxx>; open list:GPIO
> SUBSYSTEM <linux-gpio@xxxxxxxxxxxxxxx>; linux-input <linux-
> input@xxxxxxxxxxxxxxx>; Dmitry Torokhov
> <dmitry.torokhov@xxxxxxxxx>; Bartosz Golaszewski
> <brgl@xxxxxxxx>; Hennerich, Michael
> <Michael.Hennerich@xxxxxxxxxx>; Rob Herring
> <robh+dt@xxxxxxxxxx>; Krzysztof Kozlowski
> <krzysztof.kozlowski+dt@xxxxxxxxxx>; Linus Walleij
> <linus.walleij@xxxxxxxxxx>
> Subject: Re: [PATCH 03/10] input: keyboard: adp5588-keys: bail out on
> returned error
> 
> [External]
> 
> 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).
> 

I'm not touching the original way the driver was handling this
kind of stuff. I do have in my mind to just convert this driver to use
regmap and with it (by using the *bits functions) we can get rid of
most of the "plain" bitmaps in the driver.

- Nuno Sá




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux