diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2024-04-08 18:37:49 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2024-04-15 15:44:51 +0200 |
commit | c1ca23111a6a4c323234a1a1632cda1890a540a4 (patch) | |
tree | 60930550ffb52aa5cc748f272d6c970529b0e666 /drivers/platform/x86/x86-android-tablets | |
parent | 3eee73ad42c3899d97e073bf2c41e7670a3c575c (diff) | |
download | lwn-c1ca23111a6a4c323234a1a1632cda1890a540a4.tar.gz lwn-c1ca23111a6a4c323234a1a1632cda1890a540a4.zip |
platform/x86: android-tablets: Use GPIO_LOOKUP() macro
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>
Diffstat (limited to 'drivers/platform/x86/x86-android-tablets')
-rw-r--r-- | drivers/platform/x86/x86-android-tablets/core.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/platform/x86/x86-android-tablets/core.c b/drivers/platform/x86/x86-android-tablets/core.c index 6559bb4ea730..9bb10eadb699 100644 --- a/drivers/platform/x86/x86-android-tablets/core.c +++ b/drivers/platform/x86/x86-android-tablets/core.c @@ -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); |