]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
platform/x86: android-tablets: Use GPIO_LOOKUP() macro
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 8 Apr 2024 15:37:49 +0000 (18:37 +0300)
committerHans de Goede <hdegoede@redhat.com>
Mon, 15 Apr 2024 13:44:51 +0000 (15:44 +0200)
Use GPIO_LOOKUP() macro which provides a compound literal
and can be used with dynamic data.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240408153749.119394-1-andriy.shevchenko@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/x86-android-tablets/core.c

index 6559bb4ea7305c972062f8ecbca0d4523513a62c..9bb10eadb6994392200e138d490857bb64f4b4f6 100644 (file)
@@ -52,10 +52,8 @@ int x86_android_tablet_get_gpiod(const char *chip, int pin, const char *con_id,
                return -ENOMEM;
 
        lookup->dev_id = KBUILD_MODNAME;
-       lookup->table[0].key = chip;
-       lookup->table[0].chip_hwnum = pin;
-       lookup->table[0].con_id = con_id;
-       lookup->table[0].flags = active_low ? GPIO_ACTIVE_LOW : GPIO_ACTIVE_HIGH;
+       lookup->table[0] =
+               GPIO_LOOKUP(chip, pin, con_id, active_low ? GPIO_ACTIVE_LOW : GPIO_ACTIVE_HIGH);
 
        gpiod_add_lookup_table(lookup);
        gpiod = devm_gpiod_get(&x86_android_tablet_device->dev, con_id, dflags);