All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg
@ 2015-01-27 22:50 ` Uwe Kleine-König
  0 siblings, 0 replies; 12+ messages in thread
From: Uwe Kleine-König @ 2015-01-27 22:50 UTC (permalink / raw)
  To: Dong Aisheng
  Cc: linux-arm-kernel, kernel, Shawn Guo, Linus Walleij, linux-gpio

The right check for conf_reg to be invalid it testing against -1 not 0
as is done in the rest of the driver.

This fixes an oops that can be triggered by:

	cat /sys/kernel/debug/pinctrl/43fac000.iomuxc/*

Fixes: ae75ff814538 ("pinctrl: pinctrl-imx: add imx pinctrl core driver")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pinctrl/freescale/pinctrl-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 52f2b9404fe0..448f10986c28 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -437,7 +437,7 @@ static void imx_pinconf_dbg_show(struct pinctrl_dev *pctldev,
 	const struct imx_pin_reg *pin_reg = &info->pin_regs[pin_id];
 	unsigned long config;
 
-	if (!pin_reg || !pin_reg->conf_reg) {
+	if (!pin_reg || pin_reg->conf_reg == -1) {
 		seq_printf(s, "N/A");
 		return;
 	}
-- 
2.1.4

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

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

* [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg
@ 2015-01-27 22:50 ` Uwe Kleine-König
  0 siblings, 0 replies; 12+ messages in thread
From: Uwe Kleine-König @ 2015-01-27 22:50 UTC (permalink / raw)
  To: linux-arm-kernel

The right check for conf_reg to be invalid it testing against -1 not 0
as is done in the rest of the driver.

This fixes an oops that can be triggered by:

	cat /sys/kernel/debug/pinctrl/43fac000.iomuxc/*

Fixes: ae75ff814538 ("pinctrl: pinctrl-imx: add imx pinctrl core driver")
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 drivers/pinctrl/freescale/pinctrl-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 52f2b9404fe0..448f10986c28 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -437,7 +437,7 @@ static void imx_pinconf_dbg_show(struct pinctrl_dev *pctldev,
 	const struct imx_pin_reg *pin_reg = &info->pin_regs[pin_id];
 	unsigned long config;
 
-	if (!pin_reg || !pin_reg->conf_reg) {
+	if (!pin_reg || pin_reg->conf_reg == -1) {
 		seq_printf(s, "N/A");
 		return;
 	}
-- 
2.1.4

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

* Re: [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg
  2015-01-27 22:50 ` Uwe Kleine-König
@ 2015-01-27 23:15   ` Uwe Kleine-König
  -1 siblings, 0 replies; 12+ messages in thread
From: Uwe Kleine-König @ 2015-01-27 23:15 UTC (permalink / raw)
  To: Dong Aisheng
  Cc: linux-gpio, Linus Walleij, Shawn Guo, kernel, linux-arm-kernel

Hello,

please disregard the patch here, the email address of Dong Aisheng I
used isn't valid any more. I resend with the correct address.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
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

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

* [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg
@ 2015-01-27 23:15   ` Uwe Kleine-König
  0 siblings, 0 replies; 12+ messages in thread
From: Uwe Kleine-König @ 2015-01-27 23:15 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

please disregard the patch here, the email address of Dong Aisheng I
used isn't valid any more. I resend with the correct address.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg
  2015-01-27 22:50 ` Uwe Kleine-König
@ 2015-02-03 13:01   ` Linus Walleij
  -1 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2015-02-03 13:01 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Dong Aisheng, linux-arm-kernel, Sascha Hauer, Shawn Guo, linux-gpio

On Tue, Jan 27, 2015 at 11:50 PM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:

> The right check for conf_reg to be invalid it testing against -1 not 0
> as is done in the rest of the driver.
>
> This fixes an oops that can be triggered by:
>
>         cat /sys/kernel/debug/pinctrl/43fac000.iomuxc/*
>
> Fixes: ae75ff814538 ("pinctrl: pinctrl-imx: add imx pinctrl core driver")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Patch applied.

But...

> -       if (!pin_reg || !pin_reg->conf_reg) {
> +       if (!pin_reg || pin_reg->conf_reg == -1) {

I can see that the other code checks for -1 in this variable.
But where is conf_reg ever set to -1?

freescale]$ git grep "\-1"
pinctrl-imx.c:          if (pin_reg->mux_reg == -1) {
pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
pinctrl-imx.c:  if (!pin_reg || pin_reg->conf_reg == -1) {

Only checked for, never assigned.

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

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

* [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg
@ 2015-02-03 13:01   ` Linus Walleij
  0 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2015-02-03 13:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 27, 2015 at 11:50 PM, Uwe Kleine-K?nig
<u.kleine-koenig@pengutronix.de> wrote:

> The right check for conf_reg to be invalid it testing against -1 not 0
> as is done in the rest of the driver.
>
> This fixes an oops that can be triggered by:
>
>         cat /sys/kernel/debug/pinctrl/43fac000.iomuxc/*
>
> Fixes: ae75ff814538 ("pinctrl: pinctrl-imx: add imx pinctrl core driver")
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

Patch applied.

But...

> -       if (!pin_reg || !pin_reg->conf_reg) {
> +       if (!pin_reg || pin_reg->conf_reg == -1) {

I can see that the other code checks for -1 in this variable.
But where is conf_reg ever set to -1?

freescale]$ git grep "\-1"
pinctrl-imx.c:          if (pin_reg->mux_reg == -1) {
pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
pinctrl-imx.c:  if (!pin_reg || pin_reg->conf_reg == -1) {

Only checked for, never assigned.

Yours,
Linus Walleij

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

* Re: [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg
  2015-02-03 13:01   ` Linus Walleij
@ 2015-02-03 19:01     ` Uwe Kleine-König
  -1 siblings, 0 replies; 12+ messages in thread
From: Uwe Kleine-König @ 2015-02-03 19:01 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Dong Aisheng, linux-arm-kernel, Sascha Hauer, Shawn Guo, linux-gpio

On Tue, Feb 03, 2015 at 02:01:09PM +0100, Linus Walleij wrote:
> On Tue, Jan 27, 2015 at 11:50 PM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> 
> > The right check for conf_reg to be invalid it testing against -1 not 0
> > as is done in the rest of the driver.
> >
> > This fixes an oops that can be triggered by:
> >
> >         cat /sys/kernel/debug/pinctrl/43fac000.iomuxc/*
> >
> > Fixes: ae75ff814538 ("pinctrl: pinctrl-imx: add imx pinctrl core driver")
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Patch applied.
> 
> But...
> 
> > -       if (!pin_reg || !pin_reg->conf_reg) {
> > +       if (!pin_reg || pin_reg->conf_reg == -1) {
> 
> I can see that the other code checks for -1 in this variable.
> But where is conf_reg ever set to -1?
> 
> freescale]$ git grep "\-1"
> pinctrl-imx.c:          if (pin_reg->mux_reg == -1) {
> pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
> pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
> pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
> pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
> pinctrl-imx.c:  if (!pin_reg || pin_reg->conf_reg == -1) {
Uah, ugly. This member gets -1 by means of:

	memset(info->pin_regs, 0xff, sizeof(*info->pin_regs) * info->npins);

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
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

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

* [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg
@ 2015-02-03 19:01     ` Uwe Kleine-König
  0 siblings, 0 replies; 12+ messages in thread
From: Uwe Kleine-König @ 2015-02-03 19:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 03, 2015 at 02:01:09PM +0100, Linus Walleij wrote:
> On Tue, Jan 27, 2015 at 11:50 PM, Uwe Kleine-K?nig
> <u.kleine-koenig@pengutronix.de> wrote:
> 
> > The right check for conf_reg to be invalid it testing against -1 not 0
> > as is done in the rest of the driver.
> >
> > This fixes an oops that can be triggered by:
> >
> >         cat /sys/kernel/debug/pinctrl/43fac000.iomuxc/*
> >
> > Fixes: ae75ff814538 ("pinctrl: pinctrl-imx: add imx pinctrl core driver")
> > Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> 
> Patch applied.
> 
> But...
> 
> > -       if (!pin_reg || !pin_reg->conf_reg) {
> > +       if (!pin_reg || pin_reg->conf_reg == -1) {
> 
> I can see that the other code checks for -1 in this variable.
> But where is conf_reg ever set to -1?
> 
> freescale]$ git grep "\-1"
> pinctrl-imx.c:          if (pin_reg->mux_reg == -1) {
> pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
> pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
> pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
> pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
> pinctrl-imx.c:  if (!pin_reg || pin_reg->conf_reg == -1) {
Uah, ugly. This member gets -1 by means of:

	memset(info->pin_regs, 0xff, sizeof(*info->pin_regs) * info->npins);

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg
  2015-02-03 19:01     ` Uwe Kleine-König
@ 2015-02-05 13:53       ` Linus Walleij
  -1 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2015-02-05 13:53 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Dong Aisheng, linux-arm-kernel, Sascha Hauer, Shawn Guo, linux-gpio

On Tue, Feb 3, 2015 at 8:01 PM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> On Tue, Feb 03, 2015 at 02:01:09PM +0100, Linus Walleij wrote:
>> On Tue, Jan 27, 2015 at 11:50 PM, Uwe Kleine-König
>> <u.kleine-koenig@pengutronix.de> wrote:
>>
>> > The right check for conf_reg to be invalid it testing against -1 not 0
>> > as is done in the rest of the driver.
>> >
>> > This fixes an oops that can be triggered by:
>> >
>> >         cat /sys/kernel/debug/pinctrl/43fac000.iomuxc/*
>> >
>> > Fixes: ae75ff814538 ("pinctrl: pinctrl-imx: add imx pinctrl core driver")
>> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>>
>> Patch applied.
>>
>> But...
>>
>> > -       if (!pin_reg || !pin_reg->conf_reg) {
>> > +       if (!pin_reg || pin_reg->conf_reg == -1) {
>>
>> I can see that the other code checks for -1 in this variable.
>> But where is conf_reg ever set to -1?
>>
>> freescale]$ git grep "\-1"
>> pinctrl-imx.c:          if (pin_reg->mux_reg == -1) {
>> pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
>> pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
>> pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
>> pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
>> pinctrl-imx.c:  if (!pin_reg || pin_reg->conf_reg == -1) {
> Uah, ugly. This member gets -1 by means of:
>
>         memset(info->pin_regs, 0xff, sizeof(*info->pin_regs) * info->npins);

OMG. Uwe can you make a patch changing that initialization
code to something sane? We can't have it like this.

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

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

* [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg
@ 2015-02-05 13:53       ` Linus Walleij
  0 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2015-02-05 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 3, 2015 at 8:01 PM, Uwe Kleine-K?nig
<u.kleine-koenig@pengutronix.de> wrote:
> On Tue, Feb 03, 2015 at 02:01:09PM +0100, Linus Walleij wrote:
>> On Tue, Jan 27, 2015 at 11:50 PM, Uwe Kleine-K?nig
>> <u.kleine-koenig@pengutronix.de> wrote:
>>
>> > The right check for conf_reg to be invalid it testing against -1 not 0
>> > as is done in the rest of the driver.
>> >
>> > This fixes an oops that can be triggered by:
>> >
>> >         cat /sys/kernel/debug/pinctrl/43fac000.iomuxc/*
>> >
>> > Fixes: ae75ff814538 ("pinctrl: pinctrl-imx: add imx pinctrl core driver")
>> > Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
>>
>> Patch applied.
>>
>> But...
>>
>> > -       if (!pin_reg || !pin_reg->conf_reg) {
>> > +       if (!pin_reg || pin_reg->conf_reg == -1) {
>>
>> I can see that the other code checks for -1 in this variable.
>> But where is conf_reg ever set to -1?
>>
>> freescale]$ git grep "\-1"
>> pinctrl-imx.c:          if (pin_reg->mux_reg == -1) {
>> pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
>> pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
>> pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
>> pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
>> pinctrl-imx.c:  if (!pin_reg || pin_reg->conf_reg == -1) {
> Uah, ugly. This member gets -1 by means of:
>
>         memset(info->pin_regs, 0xff, sizeof(*info->pin_regs) * info->npins);

OMG. Uwe can you make a patch changing that initialization
code to something sane? We can't have it like this.

Yours,
Linus Walleij

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

* Re: [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg
  2015-02-05 13:53       ` Linus Walleij
@ 2015-02-06 14:23         ` Stefan Agner
  -1 siblings, 0 replies; 12+ messages in thread
From: Stefan Agner @ 2015-02-06 14:23 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Uwe Kleine-König, linux-gpio, Dong Aisheng, Sascha Hauer,
	linux-arm-kernel, Shawn Guo

On 2015-02-05 14:53, Linus Walleij wrote:
> On Tue, Feb 3, 2015 at 8:01 PM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
>> On Tue, Feb 03, 2015 at 02:01:09PM +0100, Linus Walleij wrote:
>>> On Tue, Jan 27, 2015 at 11:50 PM, Uwe Kleine-König
>>> <u.kleine-koenig@pengutronix.de> wrote:
>>>
>>> > The right check for conf_reg to be invalid it testing against -1 not 0
>>> > as is done in the rest of the driver.
>>> >
>>> > This fixes an oops that can be triggered by:
>>> >
>>> >         cat /sys/kernel/debug/pinctrl/43fac000.iomuxc/*
>>> >
>>> > Fixes: ae75ff814538 ("pinctrl: pinctrl-imx: add imx pinctrl core driver")

This was actually introduce by me in 3dac1918a491 ("pinctrl: imx: detect
uninitialized pins").

>>> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>>>
>>> Patch applied.
>>>
>>> But...
>>>
>>> > -       if (!pin_reg || !pin_reg->conf_reg) {
>>> > +       if (!pin_reg || pin_reg->conf_reg == -1) {
>>>
>>> I can see that the other code checks for -1 in this variable.
>>> But where is conf_reg ever set to -1?
>>>
>>> freescale]$ git grep "\-1"
>>> pinctrl-imx.c:          if (pin_reg->mux_reg == -1) {
>>> pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
>>> pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
>>> pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
>>> pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
>>> pinctrl-imx.c:  if (!pin_reg || pin_reg->conf_reg == -1) {
>> Uah, ugly. This member gets -1 by means of:
>>
>>         memset(info->pin_regs, 0xff, sizeof(*info->pin_regs) * info->npins);
> 
> OMG. Uwe can you make a patch changing that initialization
> code to something sane? We can't have it like this.

Oh sorry, this was actually me, in the commit mentioned above. That's
ugly, I agree. I'm wondering how I came to that idea....

Will send a patch for that.

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

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

* [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg
@ 2015-02-06 14:23         ` Stefan Agner
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Agner @ 2015-02-06 14:23 UTC (permalink / raw)
  To: linux-arm-kernel

On 2015-02-05 14:53, Linus Walleij wrote:
> On Tue, Feb 3, 2015 at 8:01 PM, Uwe Kleine-K?nig
> <u.kleine-koenig@pengutronix.de> wrote:
>> On Tue, Feb 03, 2015 at 02:01:09PM +0100, Linus Walleij wrote:
>>> On Tue, Jan 27, 2015 at 11:50 PM, Uwe Kleine-K?nig
>>> <u.kleine-koenig@pengutronix.de> wrote:
>>>
>>> > The right check for conf_reg to be invalid it testing against -1 not 0
>>> > as is done in the rest of the driver.
>>> >
>>> > This fixes an oops that can be triggered by:
>>> >
>>> >         cat /sys/kernel/debug/pinctrl/43fac000.iomuxc/*
>>> >
>>> > Fixes: ae75ff814538 ("pinctrl: pinctrl-imx: add imx pinctrl core driver")

This was actually introduce by me in 3dac1918a491 ("pinctrl: imx: detect
uninitialized pins").

>>> > Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
>>>
>>> Patch applied.
>>>
>>> But...
>>>
>>> > -       if (!pin_reg || !pin_reg->conf_reg) {
>>> > +       if (!pin_reg || pin_reg->conf_reg == -1) {
>>>
>>> I can see that the other code checks for -1 in this variable.
>>> But where is conf_reg ever set to -1?
>>>
>>> freescale]$ git grep "\-1"
>>> pinctrl-imx.c:          if (pin_reg->mux_reg == -1) {
>>> pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
>>> pinctrl-imx.c:  if (pin_reg->mux_reg == -1)
>>> pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
>>> pinctrl-imx.c:  if (pin_reg->conf_reg == -1) {
>>> pinctrl-imx.c:  if (!pin_reg || pin_reg->conf_reg == -1) {
>> Uah, ugly. This member gets -1 by means of:
>>
>>         memset(info->pin_regs, 0xff, sizeof(*info->pin_regs) * info->npins);
> 
> OMG. Uwe can you make a patch changing that initialization
> code to something sane? We can't have it like this.

Oh sorry, this was actually me, in the commit mentioned above. That's
ugly, I agree. I'm wondering how I came to that idea....

Will send a patch for that.

--
Stefan

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

end of thread, other threads:[~2015-02-06 14:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27 22:50 [PATCH] pinctrl: pinctrl-imx: don't use invalid value of conf_reg Uwe Kleine-König
2015-01-27 22:50 ` Uwe Kleine-König
2015-01-27 23:15 ` Uwe Kleine-König
2015-01-27 23:15   ` Uwe Kleine-König
2015-02-03 13:01 ` Linus Walleij
2015-02-03 13:01   ` Linus Walleij
2015-02-03 19:01   ` Uwe Kleine-König
2015-02-03 19:01     ` Uwe Kleine-König
2015-02-05 13:53     ` Linus Walleij
2015-02-05 13:53       ` Linus Walleij
2015-02-06 14:23       ` Stefan Agner
2015-02-06 14:23         ` Stefan Agner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.