diff mbox

gpio: max732x: Add missing dev reference to gpiochip

Message ID 1435687458-4671-1-git-send-email-marex@denx.de
State New
Headers show

Commit Message

Marek Vasut June 30, 2015, 6:04 p.m. UTC
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(+)

Comments

Linus Walleij July 16, 2015, 11:43 a.m. UTC | #1
On Tue, Jun 30, 2015 at 8:04 PM, Marek Vasut <marex@denx.de> wrote:

> 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>

Patch applied for fixes.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Marek Vasut Aug. 14, 2015, 9:10 p.m. UTC | #2
On Thursday, July 16, 2015 at 01:43:13 PM, Linus Walleij wrote:
> On Tue, Jun 30, 2015 at 8:04 PM, Marek Vasut <marex@denx.de> wrote:
> > 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>
> 
> Patch applied for fixes.

Hi,

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

Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Aug. 20, 2015, 8:23 a.m. UTC | #3
On Fri, Aug 14, 2015 at 11:10 PM, Marek Vasut <marex@denx.de> wrote:
> On Thursday, July 16, 2015 at 01:43:13 PM, Linus Walleij wrote:
>> On Tue, Jun 30, 2015 at 8:04 PM, Marek Vasut <marex@denx.de> wrote:
>> > 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>
>>
>> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Marek Vasut Aug. 20, 2015, 9:03 a.m. UTC | #4
On Thursday, August 20, 2015 at 10:23:36 AM, Linus Walleij wrote:
> On Fri, Aug 14, 2015 at 11:10 PM, Marek Vasut <marex@denx.de> wrote:
> > On Thursday, July 16, 2015 at 01:43:13 PM, Linus Walleij wrote:
> >> On Tue, Jun 30, 2015 at 8:04 PM, Marek Vasut <marex@denx.de> wrote:
> >> > 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>
> >> 
> >> 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.

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

Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;