]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ARM: integrator: impd1: Use GPIO_LOOKUP() helper macro
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 24 Mar 2020 13:56:46 +0000 (14:56 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 26 Mar 2020 21:05:12 +0000 (22:05 +0100)
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
Link: https://lore.kernel.org/r/20200324135653.6676-1-geert+renesas@glider.be
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/mach-integrator/impd1.c

index 1ecbea5331d6ed8ba2ff0afca289de26b1b2626a..6f875ded841924d8407e36a8006d6dbf51222bf4 100644 (file)
@@ -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);
                }