Skip to content

Commit 716b532

Browse files
committed
gpiolib: acpi: Add fwnode name to the GPIO interrupt label
It's ambiguous to have a device-related index in the GPIO interrupt label as most of the devices will have it the same or very similar. Extend label with fwnode name for better granularity. It significantly reduces the scope of searching among devices. Ex. (for the PCA9355 and MAX3111e chips connected to the system): === Before === PCA953x: GpioInt() 0 MAX3111e: GpioInt() 0 === After === PCA953x: NIO1 GpioInt(0) MAX3111e: URT0 GpioInt(0) Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 57b60ec commit 716b532

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpio/gpiolib-acpi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,7 @@ struct gpio_desc *acpi_find_gpio(struct fwnode_handle *fwnode,
10351035
int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id, int index,
10361036
bool *wake_capable)
10371037
{
1038+
struct fwnode_handle *fwnode = acpi_fwnode_handle(adev);
10381039
int idx, i;
10391040
unsigned int irq_flags;
10401041
int ret;
@@ -1044,7 +1045,7 @@ int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id,
10441045
struct gpio_desc *desc;
10451046

10461047
/* Ignore -EPROBE_DEFER, it only matters if idx matches */
1047-
desc = __acpi_find_gpio(acpi_fwnode_handle(adev), con_id, i, true, &info);
1048+
desc = __acpi_find_gpio(fwnode, con_id, i, true, &info);
10481049
if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER)
10491050
return PTR_ERR(desc);
10501051

@@ -1064,7 +1065,7 @@ int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id,
10641065
acpi_gpio_update_gpiod_flags(&dflags, &info);
10651066
acpi_gpio_update_gpiod_lookup_flags(&lflags, &info);
10661067

1067-
snprintf(label, sizeof(label), "GpioInt() %d", index);
1068+
snprintf(label, sizeof(label), "%pfwP GpioInt(%d)", fwnode, index);
10681069
ret = gpiod_configure_flags(desc, label, lflags, dflags);
10691070
if (ret < 0)
10701071
return ret;

0 commit comments

Comments
 (0)