linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: max732x: Add missing dev reference to gpiochip
@ 2015-06-30 18:04 Marek Vasut
  2015-07-16 11:43 ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2015-06-30 18:04 UTC (permalink / raw)
  To: linux-gpio
  Cc: Marek Vasut, Alexandre Courbot, Linus Walleij, Mans Rullgard,
	Olaf Mandel, Semen Protsenko

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.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Mans Rullgard <mans@mansr.com>
Cc: Olaf Mandel <o.mandel@menlosystems.com>
Cc: Semen Protsenko <semen.protsenko@globallogic.com>
---
 drivers/gpio/gpio-max732x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-max732x.c b/drivers/gpio/gpio-max732x.c
index 0fa4543..aba8337 100644
--- a/drivers/gpio/gpio-max732x.c
+++ b/drivers/gpio/gpio-max732x.c
@@ -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;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-20  9:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-30 18:04 [PATCH] gpio: max732x: Add missing dev reference to gpiochip Marek Vasut
2015-07-16 11:43 ` Linus Walleij
2015-08-14 21:10   ` Marek Vasut
2015-08-20  8:23     ` Linus Walleij
2015-08-20  9:03       ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).