Skip to contentSkip to conversation

gpio-pca953x: fix gpio_base and add verbosity

PATCH Superseded Hartmut Knaack 2 participants 3 messages Oct 10, 2011 – Oct 13, 2011 GPIO

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 gpio-pca953x: fix gpio_base and add verbosity

gpio_base was set to 0 if no system platform data or open firmware platform data was provided. This led to conflicts, if any other gpiochip with a gpiobase of 0 was instantiated already. Setting it to -1 will automatically use the first one available.

-------------------------------------------------------------

drivers/gpio/gpio-pca953x.c +0 -0
index c43b8ff..ae479fd 100644
@@ -577,6 +577,7 @@ pca953x_get_alt_pdata(struct i2c_client *client, int

*gpio_base, int *invert)
void
pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, int
*invert)
{
+ *gpio_base = -1;
}
#endif

#1 lore raw
Quoted 7 lines · Hartmut Knaack

gpio_base was set to 0 if no system platform data or open firmware platform data was provided. This led to conflicts, if any other gpiochip with a gpiobase of 0 was instantiated already. Setting it to -1 will automatically use the first one available.

-------------------------------------------------------------

Corrupt patch (linewrap and whitespace damage). Please check your mailer.

Quoted 15 lines
drivers/gpio/gpio-pca953x.c +1 -0
index c43b8ff..ae479fd 100644
@@ -577,6 +577,7 @@ pca953x_get_alt_pdata(struct i2c_client *client, int
 *gpio_base, int *invert)
 void
 pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, int
 *invert)
 {
+  *gpio_base = -1;
 }

#endif

#2 lore raw
Quoted 10 lines · Grant Likely
Quoted 7 lines · Hartmut Knaack

gpio_base was set to 0 if no system platform data or open firmware platform data was provided. This led to conflicts, if any other gpiochip with a gpiobase of 0 was instantiated already. Setting it to -1 will automatically use the first one available.

-------------------------------------------------------------

Corrupt patch (linewrap and whitespace damage).  Please check your mailer.

I applied it manually though.

g.

Quoted 17 lines
Quoted 16 lines
drivers/gpio/gpio-pca953x.c +0 -0
index c43b8ff..ae479fd 100644
@@ -577,6 +577,7 @@ pca953x_get_alt_pdata(struct i2c_client *client, int
 *gpio_base, int *invert)

 void
 pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, int *invert)
 {
+  *gpio_base = -1;
 }
 #endif

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.