Re: [PATCH v2 1/3] gpiolib: convert 'devprop_gpiochip_set_names' to support multiple gpiochip banks per device

From: Andy Shevchenko
Date: Tue Jul 27 2021 - 11:05:41 EST


On Tue, Jul 27, 2021 at 5:48 PM Sergio Paracuellos
<sergio.paracuellos@xxxxxxxxx> wrote:
>
> The default gpiolib-of implementation does not work with the multiple
> gpiochip banks per device structure used for example by the gpio-mt7621
> and gpio-brcmstb drivers. To fix these kind of situations driver code
> is forced to fill the names to avoid the gpiolib code to set names
> repeated along the banks. Instead of continue with that antipattern
> fix the gpiolib core function to get expected behaviour for every
> single situation adding a field 'offset' in the gpiochip structure.
> Doing in this way, we can assume this offset will be zero for normal
> driver code where only one gpiochip bank per device is used but
> can be set explicitly in those drivers that really need more than
> one gpiochip.

...

> + dev_warn(&gdev->dev, "gpio-line-names too short (length %d) "
> + "cannot map names for the gpiochip at offset %u\n",

Reflow this that string literal will be on one line (it's fine to be
over even 100).

> + count, chip->offset);

--
With Best Regards,
Andy Shevchenko