[PATCH v1 3/4] platform/x86: int3472: Use GPIO_LOOKUP() macro

Andy Shevchenko posted 4 patches 1 year, 5 months ago
There is a newer version of this series
[PATCH v1 3/4] platform/x86: int3472: Use GPIO_LOOKUP() macro
Posted by Andy Shevchenko 1 year, 5 months ago
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>
---
 drivers/platform/x86/intel/int3472/discrete.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c
index cd0743300d7f..96a9673a0165 100644
--- a/drivers/platform/x86/intel/int3472/discrete.c
+++ b/drivers/platform/x86/intel/int3472/discrete.c
@@ -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;
 }
-- 
2.43.0.rc1.1336.g36b5255a03ac
Re: [PATCH v1 3/4] platform/x86: int3472: Use GPIO_LOOKUP() macro
Posted by Ilpo Järvinen 1 year, 5 months ago
On Wed, 21 Aug 2024, Andy Shevchenko wrote:

> 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>
> ---
>  drivers/platform/x86/intel/int3472/discrete.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c
> index cd0743300d7f..96a9673a0165 100644
> --- a/drivers/platform/x86/intel/int3472/discrete.c
> +++ b/drivers/platform/x86/intel/int3472/discrete.c
> @@ -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;
>  }
> 

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

-- 
 i.