platform/x86: int3472: Use GPIO_LOOKUP() macro
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 22 Aug 2024 13:05:40 +0000 (16:05 +0300)
committerHans de Goede <hdegoede@redhat.com>
Wed, 4 Sep 2024 13:04:01 +0000 (15:04 +0200)
Use GPIO_LOOKUP() macro which provides a compound literal
and can be used with dynamic data.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240822130722.1261891-4-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/intel/int3472/discrete.c

index 07b302e0934073dafa4e12bf66fb195bc7abe536..89a97d2cd62585b2454dff45a089a89e92526c16 100644 (file)
@@ -69,11 +69,7 @@ static int skl_int3472_fill_gpiod_lookup(struct gpiod_lookup *table_entry,
        if (!adev)
                return -ENODEV;
 
-       table_entry->key = acpi_dev_name(adev);
-       table_entry->chip_hwnum = agpio->pin_table[0];
-       table_entry->con_id = func;
-       table_entry->idx = 0;
-       table_entry->flags = polarity;
+       *table_entry = GPIO_LOOKUP(acpi_dev_name(adev), agpio->pin_table[0], func, polarity);
 
        return 0;
 }