Skip to contentSkip to conversation

gpio: pca953x: Fix gpio_base may not default to -1

PATCH In review Aaron Sierra 2 participants 2 messages Feb 8, 2014 – Feb 13, 2014 1 message not in the archive GPIO

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 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.

---
 drivers/gpio/gpio-pca953x.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/gpio-pca953x.c +2 -1
index 948a074..d550d8e 100644
@@ -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) {
Signature · 1 line
1.7.9.5
#2 lore raw
Quoted 4 lines · Aaron Sierra

If no device tree node existed for a device when CONFIG_OF_GPIO was defined, then gpio_base would not default to -1.

Patch applied.

Yours,
Linus Walleij