Message ID | 20200324135653.6676-1-geert+renesas@glider.be (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | gpio: Add GPIO Aggregator | expand |
On Tue, Mar 24, 2020 at 2:57 PM Geert Uytterhoeven <geert+renesas@glider.be> wrote: > impd1_probe() fills in the GPIO lookup table by manually populating an > array of gpiod_lookup structures. Use the existing GPIO_LOOKUP() helper > macro instead, to relax a dependency on the gpiod_lookup structure's > member names. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > Cc: linux-arm-kernel@lists.infradead.org > --- > While this patch is a dependency for "[PATCH v6 4/8] gpiolib: Add > support for GPIO lookup by line name", it can be applied independently. > But an Acked-by would be nice, too. I simply applied this patch for v5.7 in the GPIO tree since I am the maintainer of this platform, and I might want to change stuff around Integrator next cycle so it's good to have this covered. Yours, Linus Walleij
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 1ecbea5331d6ed8b..6f875ded841924d8 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c @@ -410,13 +410,10 @@ static int __ref impd1_probe(struct lm_device *dev) * 5 = Key lower right */ /* We need the two MMCI GPIO entries */ - lookup->table[0].chip_label = chipname; - lookup->table[0].chip_hwnum = 3; - lookup->table[0].con_id = "wp"; - lookup->table[1].chip_label = chipname; - lookup->table[1].chip_hwnum = 4; - lookup->table[1].con_id = "cd"; - lookup->table[1].flags = GPIO_ACTIVE_LOW; + lookup->table[0] = (struct gpiod_lookup) + GPIO_LOOKUP(chipname, 3, "wp", 0); + lookup->table[1] = (struct gpiod_lookup) + GPIO_LOOKUP(chipname, 4, "cd", GPIO_ACTIVE_LOW); gpiod_add_lookup_table(lookup); }
impd1_probe() fills in the GPIO lookup table by manually populating an array of gpiod_lookup structures. Use the existing GPIO_LOOKUP() helper macro instead, to relax a dependency on the gpiod_lookup structure's member names. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Cc: linux-arm-kernel@lists.infradead.org --- While this patch is a dependency for "[PATCH v6 4/8] gpiolib: Add support for GPIO lookup by line name", it can be applied independently. But an Acked-by would be nice, too. Cover letter and full series at https://lore.kernel.org/r/20200324135328.5796-1-geert+renesas@glider.be/ v6: - New. --- arch/arm/mach-integrator/impd1.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)