Skip to contentSkip to conversation

gpio: max732x: Add missing dev reference to gpiochip

PATCH In review Marek Vasut 2 participants 5 messages Jun 30, 2015 – Aug 20, 2015 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: max732x: Add missing dev reference to gpiochip

In case the gpiochip doesn't have the .dev field set, as is the case in here, it is not possible to reference this device in DT as a GPIO controller. A good example of this problem is that gpio-leds can not be used when connected to this chip, the gpio-leds driver bails out with -EPROBE_DEFER.

Fix this problem by setting the .dev field of the gpio_chip to the parent i2c device.

Cc Alexandre Courbot <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Mans Rullgard <[email protected]>
Cc Olaf Mandel <[email protected]>
Cc Semen Protsenko <[email protected]>
---
 drivers/gpio/gpio-max732x.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-max732x.c +1 -0
index 0fa4543..aba8337 100644
@@ -596,6 +596,7 @@ static int max732x_setup_gpio(struct max732x_chip *chip,
 	gc->base = gpio_start;
 	gc->ngpio = port;
 	gc->label = chip->client->name;
+	gc->dev = &chip->client->dev;
 	gc->owner = THIS_MODULE;
 
 	return port;
Signature · 1 line
2.1.4
#1 lore raw
Quoted 9 lines · Marek Vasut

In case the gpiochip doesn't have the .dev field set, as is the case in here, it is not possible to reference this device in DT as a GPIO controller. A good example of this problem is that gpio-leds can not be used when connected to this chip, the gpio-leds driver bails out with -EPROBE_DEFER.

Fix this problem by setting the .dev field of the gpio_chip to the parent i2c device.

Quoted 6 lines
Cc Alexandre Courbot <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Mans Rullgard <[email protected]>
Cc Olaf Mandel <[email protected]>
Cc Semen Protsenko <[email protected]>

Patch applied for fixes.

Yours,
Linus Walleij

#2 lore raw
Quoted 10 lines · Linus Walleij
Quoted 9 lines · Marek Vasut

In case the gpiochip doesn't have the .dev field set, as is the case in here, it is not possible to reference this device in DT as a GPIO controller. A good example of this problem is that gpio-leds can not be used when connected to this chip, the gpio-leds driver bails out with -EPROBE_DEFER.

Fix this problem by setting the .dev field of the gpio_chip to the parent i2c device.

Quoted 8 lines
Quoted 6 lines
Cc Alexandre Courbot <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Mans Rullgard <[email protected]>
Cc Olaf Mandel <[email protected]>
Cc Semen Protsenko <[email protected]>

Patch applied for fixes.

Hi,

I don't see this one in -next , did it get lost or something please ?

Best regards,
Marek Vasut

#3 lore raw
Quoted 18 lines · Marek Vasut
Quoted 17 lines · Linus Walleij
Quoted 15 lines · Marek Vasut

In case the gpiochip doesn't have the .dev field set, as is the case in here, it is not possible to reference this device in DT as a GPIO controller. A good example of this problem is that gpio-leds can not be used when connected to this chip, the gpio-leds driver bails out with -EPROBE_DEFER.

Fix this problem by setting the .dev field of the gpio_chip to the parent i2c device.

Cc Alexandre Courbot <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Mans Rullgard <[email protected]>
Cc Olaf Mandel <[email protected]>
Cc Semen Protsenko <[email protected]>
Quoted 5 lines
Quoted 1 line

Patch applied for fixes.

Hi,

I don't see this one in -next , did it get lost or something please ?

I have no clue what you're looking at, its
commit 34ab54edbef902f31842b428dce9530f3283847c
In Torvald's tree and will be in v4.2.

Yours,
Linus Walleij

#4 lore raw
Quoted 21 lines · Linus Walleij
Quoted 20 lines · Marek Vasut
Quoted 18 lines · Linus Walleij
Quoted 9 lines · Marek Vasut

In case the gpiochip doesn't have the .dev field set, as is the case in here, it is not possible to reference this device in DT as a GPIO controller. A good example of this problem is that gpio-leds can not be used when connected to this chip, the gpio-leds driver bails out with -EPROBE_DEFER.

Fix this problem by setting the .dev field of the gpio_chip to the parent i2c device.

Quoted 6 lines
Cc Alexandre Courbot <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Mans Rullgard <[email protected]>
Cc Olaf Mandel <[email protected]>
Cc Semen Protsenko <[email protected]>

Patch applied for fixes.

Quoted 7 lines
Quoted 3 lines

Hi,

I don't see this one in -next , did it get lost or something please ?

I have no clue what you're looking at, its
commit 34ab54edbef902f31842b428dce9530f3283847c
In Torvald's tree and will be in v4.2.

Odd, I see it there now too though. Thanks and sorry for the noise.

Best regards,
Marek Vasut