From: Marek Vasut <marex@denx.de>
To: linux-gpio@vger.kernel.org
Cc: Marek Vasut <marex@denx.de>, Alexandre Courbot <gnurou@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Mans Rullgard <mans@mansr.com>,
Olaf Mandel <o.mandel@menlosystems.com>,
Semen Protsenko <semen.protsenko@globallogic.com>
Subject: [PATCH] gpio: max732x: Add missing dev reference to gpiochip
Date: Tue, 30 Jun 2015 20:04:18 +0200 [thread overview]
Message-ID: <1435687458-4671-1-git-send-email-marex@denx.de> (raw)
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
next reply other threads:[~2015-06-30 18:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-30 18:04 Marek Vasut [this message]
2015-07-16 11:43 ` [PATCH] gpio: max732x: Add missing dev reference to gpiochip Linus Walleij
2015-08-14 21:10 ` Marek Vasut
2015-08-20 8:23 ` Linus Walleij
2015-08-20 9:03 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1435687458-4671-1-git-send-email-marex@denx.de \
--to=marex@denx.de \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mans@mansr.com \
--cc=o.mandel@menlosystems.com \
--cc=semen.protsenko@globallogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).