summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib-acpi.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-11-10 15:40:29 +0200
committerLinus Walleij <linus.walleij@linaro.org>2017-11-30 10:53:50 +0100
commit08be1a795de3bf9dab31affed5e495ff91a1744d (patch)
tree935d1e919f6f48df055b53e96b240802d980eaa2 /drivers/gpio/gpiolib-acpi.c
parentf67a6c11f99a0b7015dea7378b5e82e371425710 (diff)
gpiolib: acpi: Don't contaminate return parameter in case of error
If error occurs, leave lookup parameter untouched. There is no functional change, since all current callers just bail out in case of error without using the assigned pieces. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib-acpi.c')
-rw-r--r--drivers/gpio/gpiolib-acpi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 2a85d27eb028..f640445099ab 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -585,7 +585,6 @@ static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode,
* The property was found and resolved, so need to lookup the GPIO based
* on returned args.
*/
- lookup->adev = args.adev;
if (args.nargs != 3)
return -EPROTO;
@@ -593,6 +592,7 @@ static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode,
lookup->pin_index = args.args[1];
lookup->active_low = !!args.args[2];
+ lookup->adev = args.adev;
return 0;
}