浏览代码

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>
Aaron Sierra 11 年之前
父节点
当前提交
2b1f597f7f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/gpio/gpio-pca953x.c

+ 2 - 1
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;
 	const __be32 *val;
 	int size;
 	int size;
 
 
+	*gpio_base = -1;
+
 	node = client->dev.of_node;
 	node = client->dev.of_node;
 	if (node == NULL)
 	if (node == NULL)
 		return;
 		return;
 
 
-	*gpio_base = -1;
 	val = of_get_property(node, "linux,gpio-base", &size);
 	val = of_get_property(node, "linux,gpio-base", &size);
 	WARN(val, "%s: device-tree property 'linux,gpio-base' is deprecated!", __func__);
 	WARN(val, "%s: device-tree property 'linux,gpio-base' is deprecated!", __func__);
 	if (val) {
 	if (val) {