gpio / ACPI: return -ENOENT when no mapping exists
PATCH 1/1 gpio / ACPI: return -ENOENT when no mapping exists
Doing this allows drivers to distinguish between a real error case (if there was an error when we tried to resolve the GPIO) and when the optional GPIO line was not available.
--- drivers/gpio/gpiolib-acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpiolib-acpi.c +1 -1
@@ -307,7 +307,7 @@ struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index,if (lookup.desc && info) *info = lookup.info; -return lookup.desc ? lookup.desc :ERR_PTR (-ENODEV ); +return lookup.desc ? lookup.desc :ERR_PTR (-ENOENT ); }void acpi_gpiochip_add (struct gpio_chip *chip)
Signature · 1 line
1.8.5.1
Quoted 5 lines · Mika Westerberg
Doing this allows drivers to distinguish between a real error case (if there was an error when we tried to resolve the GPIO) and when the optional GPIO line was not available.
Signed-off-by Mika Westerberg <[email protected]>
Thanks!
Quoted 5 lines · Mika Westerberg
Doing this allows drivers to distinguish between a real error case (if there was an error when we tried to resolve the GPIO) and when the optional GPIO line was not available.
Signed-off-by Mika Westerberg <[email protected]>
Quoted 18 lines
--- drivers/gpio/gpiolib-acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpio/gpiolib-acpi.c +1
-1@@ -307,7 +307,7 @@ struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index,if (lookup.desc && info) *info = lookup.info; -return lookup.desc ? lookup.desc :ERR_PTR (-ENODEV ); +return lookup.desc ? lookup.desc :ERR_PTR (-ENOENT ); }void acpi_gpiochip_add (struct gpio_chip *chip)
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
Quoted 5 lines · Mika Westerberg
Doing this allows drivers to distinguish between a real error case (if there was an error when we tried to resolve the GPIO) and when the optional GPIO line was not available.
Signed-off-by Mika Westerberg <[email protected]>
Patch applied with Alex's and Rafael's ACKs.
Yours,
Linus Walleij