gpio / ACPI: return -ENOENT when no mapping exists
authorMika Westerberg <[email protected]>
Tue, 10 Dec 2013 10:00:27 +0000 (12:00 +0200)
committerLinus Walleij <[email protected]>
Thu, 12 Dec 2013 20:56:36 +0000 (21:56 +0100)
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]>
Acked-by: Alexandre Courbot <[email protected]>
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
drivers/gpio/gpiolib-acpi.c

index ae0ffdce8bd57d4857b46cdc963f708923839982..137d20c70afea39eed4a7c378da72f924e57c61f 100644 (file)
@@ -307,6 +307,6 @@ 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);
 }
 EXPORT_SYMBOL_GPL(acpi_get_gpiod_by_index);