diff mbox series

[v1,2/2] gpiolib: acpi: Set label for IRQ only lines

Message ID 20240417103829.2324960-3-andriy.shevchenko@linux.intel.com
State New
Headers show
Series gpiolib: acpi: Improve IRQ labeling | expand

Commit Message

Andy Shevchenko April 17, 2024, 10:37 a.m. UTC
When line locked as IRQ it has no label assigned. Assign
the meaningful value to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib-acpi.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Mika Westerberg April 18, 2024, 4:49 a.m. UTC | #1
On Wed, Apr 17, 2024 at 01:37:28PM +0300, Andy Shevchenko wrote:
> When line locked as IRQ it has no label assigned. Assign
> the meaningful value to it.

Same here.

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpiolib-acpi.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> index 0b0c8729fc6e..553a5f94c00a 100644
> --- a/drivers/gpio/gpiolib-acpi.c
> +++ b/drivers/gpio/gpiolib-acpi.c
> @@ -1066,6 +1066,10 @@ int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id,
>  			acpi_gpio_update_gpiod_lookup_flags(&lflags, &info);
>  
>  			snprintf(label, sizeof(label), "%pfwP GpioInt(%d)", fwnode, index);
> +			ret = gpiod_set_consumer_name(desc, con_id ?: label);
> +			if (ret)
> +				return ret;
> +
>  			ret = gpiod_configure_flags(desc, label, lflags, dflags);
>  			if (ret < 0)
>  				return ret;
> -- 
> 2.43.0.rc1.1336.g36b5255a03ac
Andy Shevchenko April 18, 2024, 9:24 a.m. UTC | #2
On Thu, Apr 18, 2024 at 07:49:50AM +0300, Mika Westerberg wrote:
> On Wed, Apr 17, 2024 at 01:37:28PM +0300, Andy Shevchenko wrote:
> > When line locked as IRQ it has no label assigned. Assign
> > the meaningful value to it.
> 
> Same here.

Same answer as in the first reply.
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 0b0c8729fc6e..553a5f94c00a 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -1066,6 +1066,10 @@  int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id,
 			acpi_gpio_update_gpiod_lookup_flags(&lflags, &info);
 
 			snprintf(label, sizeof(label), "%pfwP GpioInt(%d)", fwnode, index);
+			ret = gpiod_set_consumer_name(desc, con_id ?: label);
+			if (ret)
+				return ret;
+
 			ret = gpiod_configure_flags(desc, label, lflags, dflags);
 			if (ret < 0)
 				return ret;