qemu-devel
[Top][All Lists]
Advanced

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

[PATCH v6 1/8] ARM: integrator: impd1: Use GPIO_LOOKUP() helper macro


From: Geert Uytterhoeven
Subject: [PATCH v6 1/8] ARM: integrator: impd1: Use GPIO_LOOKUP() helper macro
Date: Tue, 24 Mar 2020 14:56:46 +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 <address@hidden>
Cc: address@hidden
---
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/address@hidden/

v6:
  - New.
---
 arch/arm/mach-integrator/impd1.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

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);
                }
 
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]