summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-pca953x.c
diff options
context:
space:
mode:
authorAaron Sierra <asierra@xes-inc.com>2014-02-07 19:23:04 -0600
committerLinus Walleij <linus.walleij@linaro.org>2014-02-13 14:04:30 +0100
commit2b1f597f7f40f8f289489eaa1a973254afc2a632 (patch)
treefdb313cee3e43e7464186c5ff2be7707122895ed /drivers/gpio/gpio-pca953x.c
parente73760a60582b667cfe6d2ba70b74d5297419c42 (diff)
gpio: pca953x: Fix gpio_base may not default to -1
If no device tree node existed for a device when CONFIG_OF_GPIO was defined, then gpio_base would not default to -1. Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-pca953x.c')
-rw-r--r--drivers/gpio/gpio-pca953x.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 948a0741c221..d550d8e58705 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -627,11 +627,12 @@ pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, u32 *invert)
const __be32 *val;
int size;
+ *gpio_base = -1;
+
node = client->dev.of_node;
if (node == NULL)
return;
- *gpio_base = -1;
val = of_get_property(node, "linux,gpio-base", &size);
WARN(val, "%s: device-tree property 'linux,gpio-base' is deprecated!", __func__);
if (val) {