linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: mc13xxx: Do not use platform data with devicetree
@ 2014-05-01  6:48 Alexander Shiyan
  2014-05-09 11:30 ` Lee Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Shiyan @ 2014-05-01  6:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: alsa-devel, Samuel Ortiz, Lee Jones, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Alexander Shiyan

This patch removes platform data usage for codec and touchscreen
when driver is used with devicetree.
This fixes possible "null pointer dereference" error if DTS uses
"fsl,mc13xxx-uses-codec" or "fsl,mc13xxx-uses-touch" options.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/mfd/mc13xxx-core.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index 06e64b6..2ed22d7 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -673,17 +673,9 @@ int mc13xxx_common_init(struct device *dev)
 	if (mc13xxx->flags & MC13XXX_USE_ADC)
 		mc13xxx_add_subdevice(mc13xxx, "%s-adc");
 
-	if (mc13xxx->flags & MC13XXX_USE_CODEC)
-		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-codec",
-					pdata->codec, sizeof(*pdata->codec));
-
 	if (mc13xxx->flags & MC13XXX_USE_RTC)
 		mc13xxx_add_subdevice(mc13xxx, "%s-rtc");
 
-	if (mc13xxx->flags & MC13XXX_USE_TOUCHSCREEN)
-		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-ts",
-				&pdata->touch, sizeof(pdata->touch));
-
 	if (pdata) {
 		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator",
 			&pdata->regulators, sizeof(pdata->regulators));
@@ -691,10 +683,20 @@ int mc13xxx_common_init(struct device *dev)
 				pdata->leds, sizeof(*pdata->leds));
 		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-pwrbutton",
 				pdata->buttons, sizeof(*pdata->buttons));
+		if (mc13xxx->flags & MC13XXX_USE_CODEC)
+			mc13xxx_add_subdevice_pdata(mc13xxx, "%s-codec",
+				pdata->codec, sizeof(*pdata->codec));
+		if (mc13xxx->flags & MC13XXX_USE_TOUCHSCREEN)
+			mc13xxx_add_subdevice_pdata(mc13xxx, "%s-ts",
+				&pdata->touch, sizeof(pdata->touch));
 	} else {
 		mc13xxx_add_subdevice(mc13xxx, "%s-regulator");
 		mc13xxx_add_subdevice(mc13xxx, "%s-led");
 		mc13xxx_add_subdevice(mc13xxx, "%s-pwrbutton");
+		if (mc13xxx->flags & MC13XXX_USE_CODEC)
+			mc13xxx_add_subdevice(mc13xxx, "%s-codec");
+		if (mc13xxx->flags & MC13XXX_USE_TOUCHSCREEN)
+			mc13xxx_add_subdevice(mc13xxx, "%s-ts");
 	}
 
 	return 0;
-- 
1.8.3.2


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

* Re: [PATCH 1/2] mfd: mc13xxx: Do not use platform data with devicetree
  2014-05-01  6:48 [PATCH 1/2] mfd: mc13xxx: Do not use platform data with devicetree Alexander Shiyan
@ 2014-05-09 11:30 ` Lee Jones
  2014-05-09 13:56   ` Alexander Shiyan
  0 siblings, 1 reply; 7+ messages in thread
From: Lee Jones @ 2014-05-09 11:30 UTC (permalink / raw)
  To: Alexander Shiyan
  Cc: linux-kernel, alsa-devel, Samuel Ortiz, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai

> This patch removes platform data usage for codec and touchscreen
> when driver is used with devicetree.
> This fixes possible "null pointer dereference" error if DTS uses
> "fsl,mc13xxx-uses-codec" or "fsl,mc13xxx-uses-touch" options.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  drivers/mfd/mc13xxx-core.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)

Applied, thanks.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 1/2] mfd: mc13xxx: Do not use platform data with devicetree
  2014-05-09 11:30 ` Lee Jones
@ 2014-05-09 13:56   ` Alexander Shiyan
  2014-05-09 14:18     ` Lee Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Shiyan @ 2014-05-09 13:56 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, alsa-devel, Samuel Ortiz, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 956 bytes --]

Fri, 9 May 2014 12:30:30 +0100 от Lee Jones <lee.jones@linaro.org>:
> > This patch removes platform data usage for codec and touchscreen
> > when driver is used with devicetree.
> > This fixes possible "null pointer dereference" error if DTS uses
> > "fsl,mc13xxx-uses-codec" or "fsl,mc13xxx-uses-touch" options.
> > 
> > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> > ---
> >  drivers/mfd/mc13xxx-core.c | 18 ++++++++++--------
> >  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> Applied, thanks.

This patch has been written as a way to separate MFD and ASoC changes of
the patch: (ASoC: mc13783: Add devicetree support)
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=780aaeff96819ca58e0cad830bfbe6eee9aef82c

So, it should produce conflict.

---

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH 1/2] mfd: mc13xxx: Do not use platform data with devicetree
  2014-05-09 13:56   ` Alexander Shiyan
@ 2014-05-09 14:18     ` Lee Jones
  2014-05-09 14:30       ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Lee Jones @ 2014-05-09 14:18 UTC (permalink / raw)
  To: Alexander Shiyan
  Cc: linux-kernel, alsa-devel, Samuel Ortiz, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai

On Fri, 09 May 2014, Alexander Shiyan wrote:

> Fri, 9 May 2014 12:30:30 +0100 от Lee Jones <lee.jones@linaro.org>:
> > > This patch removes platform data usage for codec and touchscreen
> > > when driver is used with devicetree.
> > > This fixes possible "null pointer dereference" error if DTS uses
> > > "fsl,mc13xxx-uses-codec" or "fsl,mc13xxx-uses-touch" options.
> > > 
> > > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> > > ---
> > >  drivers/mfd/mc13xxx-core.c | 18 ++++++++++--------
> > >  1 file changed, 10 insertions(+), 8 deletions(-)
> > 
> > Applied, thanks.
> 
> This patch has been written as a way to separate MFD and ASoC changes of
> the patch: (ASoC: mc13783: Add devicetree support)
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=780aaeff96819ca58e0cad830bfbe6eee9aef82c
> 
> So, it should produce conflict.

Exactly.

Mark,

You need to revert (or remove) the original one and apply:

  "ASoC: mc13783: Add devicetree support"

... instead.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 1/2] mfd: mc13xxx: Do not use platform data with devicetree
  2014-05-09 14:18     ` Lee Jones
@ 2014-05-09 14:30       ` Mark Brown
  2014-05-09 14:36         ` Lee Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2014-05-09 14:30 UTC (permalink / raw)
  To: Lee Jones
  Cc: Alexander Shiyan, linux-kernel, alsa-devel, Samuel Ortiz,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

On Fri, May 09, 2014 at 03:18:40PM +0100, Lee Jones wrote:

> You need to revert (or remove) the original one and apply:

>   "ASoC: mc13783: Add devicetree support"

> ... instead.

Why not just pull the tag instead?  I haven't looked at the patch but
don't they need to go in together anyway.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/2] mfd: mc13xxx: Do not use platform data with devicetree
  2014-05-09 14:30       ` Mark Brown
@ 2014-05-09 14:36         ` Lee Jones
  2014-05-09 14:48           ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Lee Jones @ 2014-05-09 14:36 UTC (permalink / raw)
  To: Mark Brown
  Cc: Alexander Shiyan, linux-kernel, alsa-devel, Samuel Ortiz,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai

> > You need to revert (or remove) the original one and apply:
> 
> >   "ASoC: mc13783: Add devicetree support"
> 
> > ... instead.
> 
> Why not just pull the tag instead?  I haven't looked at the patch but
> don't they need to go in together anyway.

Only functionally.  They are orthogonally buildable apparently.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 1/2] mfd: mc13xxx: Do not use platform data with devicetree
  2014-05-09 14:36         ` Lee Jones
@ 2014-05-09 14:48           ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2014-05-09 14:48 UTC (permalink / raw)
  To: Lee Jones
  Cc: Alexander Shiyan, linux-kernel, alsa-devel, Samuel Ortiz,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

On Fri, May 09, 2014 at 03:36:29PM +0100, Lee Jones wrote:

> > Why not just pull the tag instead?  I haven't looked at the patch but
> > don't they need to go in together anyway.

> Only functionally.  They are orthogonally buildable apparently.

Working code seems important to bisection too...

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2014-05-09 14:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-01  6:48 [PATCH 1/2] mfd: mc13xxx: Do not use platform data with devicetree Alexander Shiyan
2014-05-09 11:30 ` Lee Jones
2014-05-09 13:56   ` Alexander Shiyan
2014-05-09 14:18     ` Lee Jones
2014-05-09 14:30       ` Mark Brown
2014-05-09 14:36         ` Lee Jones
2014-05-09 14:48           ` Mark Brown

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