public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] mfd-core: clean up platform_data/driver_data from mfd_cell
@ 2011-02-15 22:25 Andres Salomon
  2011-02-15 22:25 ` [PATCH 1/9] mfd-core: rename platform_data field of mfd_cell to mfd_data Andres Salomon
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Andres Salomon @ 2011-02-15 22:25 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Mark Brown, linux-kernel

These patches build on top of the prior MFD set (that adds mfd_get_cell
and friends to the core API).

This set gets rid of driver_data, which a number of people have issues with
(and some drivers were using in a buggy fashion), as well as renaming
platform_data to mfd_data.

 b/drivers/gpio/rdc321x-gpio.c       |    2 -
 b/drivers/mfd/ab3100-core.c         |    2 -
 b/drivers/mfd/ab3550-core.c         |    2 -
 b/drivers/mfd/asic3.c               |    2 -
 b/drivers/mfd/davinci_voicecodec.c  |    4 +-
 b/drivers/mfd/htc-pasic3.c          |    3 --
 b/drivers/mfd/janz-cmodio.c         |    2 -
 b/drivers/mfd/mc13xxx-core.c        |    2 -
 b/drivers/mfd/mfd-core.c            |    1 
 b/drivers/mfd/rdc321x-southbridge.c |    4 +-
 b/drivers/mfd/sh_mobile_sdhi.c      |    2 -
 b/drivers/mfd/t7l66xb.c             |    2 -
 b/drivers/mfd/tc6387xb.c            |    2 -
 b/drivers/mfd/tc6393xb.c            |    2 -
 b/drivers/mfd/timberdale.c          |   54 ++++++++++++++++++------------------
 b/drivers/mfd/twl4030-codec.c       |    4 +-
 b/drivers/mfd/wl1273-core.c         |    4 +-
 b/drivers/mfd/wm8400-core.c         |    2 -
 b/drivers/mmc/host/tmio_mmc.c       |   26 ++++++-----------
 b/drivers/mtd/nand/tmio_nand.c      |    3 --
 b/drivers/video/tmiofb.c            |   15 ++++------
 b/drivers/w1/masters/ds1wm.c        |    4 +-
 b/drivers/watchdog/rdc321x_wdt.c    |    2 -
 b/include/linux/mfd/core.h          |    8 ++---
 b/sound/soc/codecs/cq93vc.c         |    3 +-
 b/sound/soc/codecs/wm8400.c         |    2 -
 b/sound/soc/davinci/davinci-vcif.c  |    2 -
 drivers/mfd/asic3.c                 |    2 -
 drivers/mfd/t7l66xb.c               |    2 -
 drivers/mfd/tc6393xb.c              |    4 +-
 include/linux/mfd/core.h            |    3 --
 31 files changed, 79 insertions(+), 93 deletions(-)


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

* [PATCH 1/9] mfd-core: rename platform_data field of mfd_cell to mfd_data
  2011-02-15 22:25 [PATCH 0/9] mfd-core: clean up platform_data/driver_data from mfd_cell Andres Salomon
@ 2011-02-15 22:25 ` Andres Salomon
  2011-02-16  8:39   ` Linus Walleij
  2011-02-15 22:25 ` [PATCH 2/9] davinci_voicecodec: use mfd_data instead of driver_data Andres Salomon
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 13+ messages in thread
From: Andres Salomon @ 2011-02-15 22:25 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Mark Brown, linux-kernel, Linus Walleij, Srinidhi Kasagar,
	linux-arm-kernel

Rename the platform_data variable to imply a distinction between
common platform_data driver usage (typically accessed via
pdev->dev.platform_data) and the way MFD passes data down to
clients (using a wrapper named mfd_get_data).

All clients have already been changed to use the wrapper function,
so this can be a quick single-commit change that only touches things
in drivers/mfd.

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/mfd/ab3100-core.c   |    2 +-
 drivers/mfd/ab3550-core.c   |    2 +-
 drivers/mfd/janz-cmodio.c   |    2 +-
 drivers/mfd/mc13xxx-core.c  |    2 +-
 drivers/mfd/timberdale.c    |   54 +++++++++++++++++++++---------------------
 drivers/mfd/twl4030-codec.c |    4 +-
 drivers/mfd/wl1273-core.c   |    4 +-
 include/linux/mfd/core.h    |    8 +++---
 8 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
index b44c3d9..865251e 100644
--- a/drivers/mfd/ab3100-core.c
+++ b/drivers/mfd/ab3100-core.c
@@ -950,7 +950,7 @@ static int __devinit ab3100_probe(struct i2c_client *client,
 
 	/* Set up and register the platform devices. */
 	for (i = 0; i < ARRAY_SIZE(ab3100_devs); i++)
-		ab3100_devs[i].platform_data = ab3100_plf_data;
+		ab3100_devs[i].mfd_data = ab3100_plf_data;
 
 	err = mfd_add_devices(&client->dev, 0, ab3100_devs,
 		ARRAY_SIZE(ab3100_devs), NULL, 0);
diff --git a/drivers/mfd/ab3550-core.c b/drivers/mfd/ab3550-core.c
index d849087..f4c12a4 100644
--- a/drivers/mfd/ab3550-core.c
+++ b/drivers/mfd/ab3550-core.c
@@ -1321,7 +1321,7 @@ static int __init ab3550_probe(struct i2c_client *client,
 
 	/* Set up and register the platform devices. */
 	for (i = 0; i < AB3550_NUM_DEVICES; i++)
-		ab3550_devs[i].platform_data = ab3550_plf_data->dev_data[i];
+		ab3550_devs[i].mfd_data = ab3550_plf_data->dev_data[i];
 
 	err = mfd_add_devices(&client->dev, 0, ab3550_devs,
 		ARRAY_SIZE(ab3550_devs), NULL,
diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c
index 58de1e2..fc41911 100644
--- a/drivers/mfd/janz-cmodio.c
+++ b/drivers/mfd/janz-cmodio.c
@@ -86,7 +86,7 @@ static int __devinit cmodio_setup_subdevice(struct cmodio_device *priv,
 
 	/* Add platform data */
 	pdata->modno = modno;
-	cell->platform_data = pdata;
+	cell->mfd_data = pdata;
 
 	/* MODULbus registers -- PCI BAR3 is big-endian MODULbus access */
 	res->flags = IORESOURCE_MEM;
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index 00c5490..b19b50a 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -689,7 +689,7 @@ static int mc13xxx_add_subdevice_pdata(struct mc13xxx *mc13xxx,
 	const char *name = mc13xxx_get_chipname(mc13xxx);
 
 	struct mfd_cell cell = {
-		.platform_data = pdata,
+		.mfd_data = pdata,
 	};
 
 	/* there is no asnprintf in the kernel :-( */
diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index 6353921..94c6c8a 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -384,7 +384,7 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = {
 		.name = "timb-dma",
 		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
 		.resources = timberdale_dma_resources,
-		.platform_data = &timb_dma_platform_data,
+		.mfd_data = &timb_dma_platform_data,
 	},
 	{
 		.name = "timb-uart",
@@ -395,37 +395,37 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = {
 		.name = "xiic-i2c",
 		.num_resources = ARRAY_SIZE(timberdale_xiic_resources),
 		.resources = timberdale_xiic_resources,
-		.platform_data = &timberdale_xiic_platform_data,
+		.mfd_data = &timberdale_xiic_platform_data,
 	},
 	{
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.platform_data = &timberdale_gpio_platform_data,
+		.mfd_data = &timberdale_gpio_platform_data,
 	},
 	{
 		.name = "timb-video",
 		.num_resources = ARRAY_SIZE(timberdale_video_resources),
 		.resources = timberdale_video_resources,
-		.platform_data = &timberdale_video_platform_data,
+		.mfd_data = &timberdale_video_platform_data,
 	},
 	{
 		.name = "timb-radio",
 		.num_resources = ARRAY_SIZE(timberdale_radio_resources),
 		.resources = timberdale_radio_resources,
-		.platform_data = &timberdale_radio_platform_data,
+		.mfd_data = &timberdale_radio_platform_data,
 	},
 	{
 		.name = "xilinx_spi",
 		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
 		.resources = timberdale_spi_resources,
-		.platform_data = &timberdale_xspi_platform_data,
+		.mfd_data = &timberdale_xspi_platform_data,
 	},
 	{
 		.name = "ks8842",
 		.num_resources = ARRAY_SIZE(timberdale_eth_resources),
 		.resources = timberdale_eth_resources,
-		.platform_data = &timberdale_ks8842_platform_data,
+		.mfd_data = &timberdale_ks8842_platform_data,
 	},
 };
 
@@ -434,7 +434,7 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
 		.name = "timb-dma",
 		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
 		.resources = timberdale_dma_resources,
-		.platform_data = &timb_dma_platform_data,
+		.mfd_data = &timb_dma_platform_data,
 	},
 	{
 		.name = "timb-uart",
@@ -450,13 +450,13 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
 		.name = "xiic-i2c",
 		.num_resources = ARRAY_SIZE(timberdale_xiic_resources),
 		.resources = timberdale_xiic_resources,
-		.platform_data = &timberdale_xiic_platform_data,
+		.mfd_data = &timberdale_xiic_platform_data,
 	},
 	{
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.platform_data = &timberdale_gpio_platform_data,
+		.mfd_data = &timberdale_gpio_platform_data,
 	},
 	{
 		.name = "timb-mlogicore",
@@ -467,25 +467,25 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
 		.name = "timb-video",
 		.num_resources = ARRAY_SIZE(timberdale_video_resources),
 		.resources = timberdale_video_resources,
-		.platform_data = &timberdale_video_platform_data,
+		.mfd_data = &timberdale_video_platform_data,
 	},
 	{
 		.name = "timb-radio",
 		.num_resources = ARRAY_SIZE(timberdale_radio_resources),
 		.resources = timberdale_radio_resources,
-		.platform_data = &timberdale_radio_platform_data,
+		.mfd_data = &timberdale_radio_platform_data,
 	},
 	{
 		.name = "xilinx_spi",
 		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
 		.resources = timberdale_spi_resources,
-		.platform_data = &timberdale_xspi_platform_data,
+		.mfd_data = &timberdale_xspi_platform_data,
 	},
 	{
 		.name = "ks8842",
 		.num_resources = ARRAY_SIZE(timberdale_eth_resources),
 		.resources = timberdale_eth_resources,
-		.platform_data = &timberdale_ks8842_platform_data,
+		.mfd_data = &timberdale_ks8842_platform_data,
 	},
 };
 
@@ -494,7 +494,7 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = {
 		.name = "timb-dma",
 		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
 		.resources = timberdale_dma_resources,
-		.platform_data = &timb_dma_platform_data,
+		.mfd_data = &timb_dma_platform_data,
 	},
 	{
 		.name = "timb-uart",
@@ -505,31 +505,31 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = {
 		.name = "xiic-i2c",
 		.num_resources = ARRAY_SIZE(timberdale_xiic_resources),
 		.resources = timberdale_xiic_resources,
-		.platform_data = &timberdale_xiic_platform_data,
+		.mfd_data = &timberdale_xiic_platform_data,
 	},
 	{
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.platform_data = &timberdale_gpio_platform_data,
+		.mfd_data = &timberdale_gpio_platform_data,
 	},
 	{
 		.name = "timb-video",
 		.num_resources = ARRAY_SIZE(timberdale_video_resources),
 		.resources = timberdale_video_resources,
-		.platform_data = &timberdale_video_platform_data,
+		.mfd_data = &timberdale_video_platform_data,
 	},
 	{
 		.name = "timb-radio",
 		.num_resources = ARRAY_SIZE(timberdale_radio_resources),
 		.resources = timberdale_radio_resources,
-		.platform_data = &timberdale_radio_platform_data,
+		.mfd_data = &timberdale_radio_platform_data,
 	},
 	{
 		.name = "xilinx_spi",
 		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
 		.resources = timberdale_spi_resources,
-		.platform_data = &timberdale_xspi_platform_data,
+		.mfd_data = &timberdale_xspi_platform_data,
 	},
 };
 
@@ -538,7 +538,7 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = {
 		.name = "timb-dma",
 		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
 		.resources = timberdale_dma_resources,
-		.platform_data = &timb_dma_platform_data,
+		.mfd_data = &timb_dma_platform_data,
 	},
 	{
 		.name = "timb-uart",
@@ -549,37 +549,37 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = {
 		.name = "ocores-i2c",
 		.num_resources = ARRAY_SIZE(timberdale_ocores_resources),
 		.resources = timberdale_ocores_resources,
-		.platform_data = &timberdale_ocores_platform_data,
+		.mfd_data = &timberdale_ocores_platform_data,
 	},
 	{
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.platform_data = &timberdale_gpio_platform_data,
+		.mfd_data = &timberdale_gpio_platform_data,
 	},
 	{
 		.name = "timb-video",
 		.num_resources = ARRAY_SIZE(timberdale_video_resources),
 		.resources = timberdale_video_resources,
-		.platform_data = &timberdale_video_platform_data,
+		.mfd_data = &timberdale_video_platform_data,
 	},
 	{
 		.name = "timb-radio",
 		.num_resources = ARRAY_SIZE(timberdale_radio_resources),
 		.resources = timberdale_radio_resources,
-		.platform_data = &timberdale_radio_platform_data,
+		.mfd_data = &timberdale_radio_platform_data,
 	},
 	{
 		.name = "xilinx_spi",
 		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
 		.resources = timberdale_spi_resources,
-		.platform_data = &timberdale_xspi_platform_data,
+		.mfd_data = &timberdale_xspi_platform_data,
 	},
 	{
 		.name = "ks8842",
 		.num_resources = ARRAY_SIZE(timberdale_eth_resources),
 		.resources = timberdale_eth_resources,
-		.platform_data = &timberdale_ks8842_platform_data,
+		.mfd_data = &timberdale_ks8842_platform_data,
 	},
 };
 
diff --git a/drivers/mfd/twl4030-codec.c b/drivers/mfd/twl4030-codec.c
index 0f57426..c02fded 100644
--- a/drivers/mfd/twl4030-codec.c
+++ b/drivers/mfd/twl4030-codec.c
@@ -208,13 +208,13 @@ static int __devinit twl4030_codec_probe(struct platform_device *pdev)
 	if (pdata->audio) {
 		cell = &codec->cells[childs];
 		cell->name = "twl4030-codec";
-		cell->platform_data = pdata->audio;
+		cell->mfd_data = pdata->audio;
 		childs++;
 	}
 	if (pdata->vibra) {
 		cell = &codec->cells[childs];
 		cell->name = "twl4030-vibra";
-		cell->platform_data = pdata->vibra;
+		cell->mfd_data = pdata->vibra;
 		childs++;
 	}
 
diff --git a/drivers/mfd/wl1273-core.c b/drivers/mfd/wl1273-core.c
index 703085e..f49e04e 100644
--- a/drivers/mfd/wl1273-core.c
+++ b/drivers/mfd/wl1273-core.c
@@ -79,7 +79,7 @@ static int __devinit wl1273_core_probe(struct i2c_client *client,
 
 	cell = &core->cells[children];
 	cell->name = "wl1273_fm_radio";
-	cell->platform_data = &core;
+	cell->mfd_data = &core;
 	children++;
 
 	if (pdata->children & WL1273_CODEC_CHILD) {
@@ -87,7 +87,7 @@ static int __devinit wl1273_core_probe(struct i2c_client *client,
 
 		dev_dbg(&client->dev, "%s: Have codec.\n", __func__);
 		cell->name = "wl1273-codec";
-		cell->platform_data = &core;
+		cell->mfd_data = &core;
 		children++;
 	}
 
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index 923ec25..f317fe4 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -33,8 +33,8 @@ struct mfd_cell {
 	/* driver-specific data for MFD-aware "cell" drivers */
 	void			*driver_data;
 
-	/* platform_data can be used to pass data to "generic" drivers */
-	void			*platform_data;
+	/* mfd_data can be used to pass data to client drivers */
+	void			*mfd_data;
 
 	/*
 	 * These resources can be specified relative to the parent device.
@@ -64,11 +64,11 @@ static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev)
 
 /*
  * Given a platform device that's been created by mfd_add_devices(), fetch
- * the .platform_data entry from the mfd_cell that created it.
+ * the .mfd_data entry from the mfd_cell that created it.
  */
 static inline void *mfd_get_data(struct platform_device *pdev)
 {
-	return mfd_get_cell(pdev)->platform_data;
+	return mfd_get_cell(pdev)->mfd_data;
 }
 
 extern int mfd_add_devices(struct device *parent, int id,
-- 
1.7.2.3


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

* [PATCH 2/9] davinci_voicecodec: use mfd_data instead of driver_data
  2011-02-15 22:25 [PATCH 0/9] mfd-core: clean up platform_data/driver_data from mfd_cell Andres Salomon
  2011-02-15 22:25 ` [PATCH 1/9] mfd-core: rename platform_data field of mfd_cell to mfd_data Andres Salomon
@ 2011-02-15 22:25 ` Andres Salomon
  2011-02-16 21:59   ` [alsa-devel] " Mark Brown
  2011-02-15 22:25 ` [PATCH 3/9] wm8400-codec: " Andres Salomon
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 13+ messages in thread
From: Andres Salomon @ 2011-02-15 22:25 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Mark Brown, linux-kernel, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, alsa-devel

Use mfd_data for passing information from mfd drivers to soc
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/mfd/davinci_voicecodec.c |    4 ++--
 sound/soc/codecs/cq93vc.c        |    3 ++-
 sound/soc/davinci/davinci-vcif.c |    2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c
index 33c923d..f946c0b 100644
--- a/drivers/mfd/davinci_voicecodec.c
+++ b/drivers/mfd/davinci_voicecodec.c
@@ -119,12 +119,12 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
 	/* Voice codec interface client */
 	cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL];
 	cell->name = "davinci_vcif";
-	cell->driver_data = davinci_vc;
+	cell->mfd_data = davinci_vc;
 
 	/* Voice codec CQ93VC client */
 	cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL];
 	cell->name = "cq93vc";
-	cell->driver_data = davinci_vc;
+	cell->mfd_data = davinci_vc;
 
 	ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells,
 			      DAVINCI_VC_CELLS, NULL, 0);
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c
index 46dbfd0..b8066ef 100644
--- a/sound/soc/codecs/cq93vc.c
+++ b/sound/soc/codecs/cq93vc.c
@@ -153,7 +153,8 @@ static int cq93vc_resume(struct snd_soc_codec *codec)
 
 static int cq93vc_probe(struct snd_soc_codec *codec)
 {
-	struct davinci_vc *davinci_vc = codec->dev->platform_data;
+	struct davinci_vc *davinci_vc =
+			mfd_get_data(to_platform_device(codec->dev));
 
 	davinci_vc->cq93vc.codec = codec;
 	codec->control_data = davinci_vc;
diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c
index 9d2afcc..13e05a3 100644
--- a/sound/soc/davinci/davinci-vcif.c
+++ b/sound/soc/davinci/davinci-vcif.c
@@ -205,7 +205,7 @@ static struct snd_soc_dai_driver davinci_vcif_dai = {
 
 static int davinci_vcif_probe(struct platform_device *pdev)
 {
-	struct davinci_vc *davinci_vc = platform_get_drvdata(pdev);
+	struct davinci_vc *davinci_vc = mfd_get_data(pdev);
 	struct davinci_vcif_dev *davinci_vcif_dev;
 	int ret;
 
-- 
1.7.2.3


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

* [PATCH 3/9] wm8400-codec: use mfd_data instead of driver_data
  2011-02-15 22:25 [PATCH 0/9] mfd-core: clean up platform_data/driver_data from mfd_cell Andres Salomon
  2011-02-15 22:25 ` [PATCH 1/9] mfd-core: rename platform_data field of mfd_cell to mfd_data Andres Salomon
  2011-02-15 22:25 ` [PATCH 2/9] davinci_voicecodec: use mfd_data instead of driver_data Andres Salomon
@ 2011-02-15 22:25 ` Andres Salomon
  2011-02-16 21:29   ` Mark Brown
  2011-02-15 22:25 ` [PATCH 4/9] ds1wm: " Andres Salomon
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 13+ messages in thread
From: Andres Salomon @ 2011-02-15 22:25 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Mark Brown, linux-kernel, Ian Lartey, Dimitris Papastamos,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, alsa-devel

Use mfd_data for passing information from mfd drivers to soc
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/mfd/wm8400-core.c |    2 +-
 sound/soc/codecs/wm8400.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 1bfef48..3a6e78c 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -245,7 +245,7 @@ static int wm8400_register_codec(struct wm8400 *wm8400)
 {
 	struct mfd_cell cell = {
 		.name = "wm8400-codec",
-		.driver_data = wm8400,
+		.mfd_data = wm8400,
 	};
 
 	return mfd_add_devices(wm8400->dev, -1, &cell, 1, NULL, 0);
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
index 3c3bc07..ee105c2 100644
--- a/sound/soc/codecs/wm8400.c
+++ b/sound/soc/codecs/wm8400.c
@@ -1377,7 +1377,7 @@ static void wm8400_probe_deferred(struct work_struct *work)
 
 static int wm8400_codec_probe(struct snd_soc_codec *codec)
 {
-	struct wm8400 *wm8400 = dev_get_platdata(codec->dev);
+	struct wm8400 *wm8400 = mfd_get_data(to_platform_device(codec->dev));
 	struct wm8400_priv *priv;
 	int ret;
 	u16 reg;
-- 
1.7.2.3


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

* [PATCH 4/9] ds1wm: use mfd_data instead of driver_data
  2011-02-15 22:25 [PATCH 0/9] mfd-core: clean up platform_data/driver_data from mfd_cell Andres Salomon
                   ` (2 preceding siblings ...)
  2011-02-15 22:25 ` [PATCH 3/9] wm8400-codec: " Andres Salomon
@ 2011-02-15 22:25 ` Andres Salomon
  2011-02-15 22:25 ` [PATCH 5/9] tmio-mmc: " Andres Salomon
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Andres Salomon @ 2011-02-15 22:25 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Mark Brown, linux-kernel, Evgeniy Polyakov

Use mfd_data for passing information from mfd drivers to mfd
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().  This changes ds1wm only; mfd drivers with
other cells are not modified, with the exception of led_cell.

The led_cell.driver_data line is dropped from htc-pasic3.c in this
patch as well.  It's not used in mainline (there's no leds-pasic3
platform driver), so it should be safe to take care of that here.

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/mfd/asic3.c        |    2 +-
 drivers/mfd/htc-pasic3.c   |    3 +--
 drivers/w1/masters/ds1wm.c |    4 ++--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 71d2901..549d14d 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -682,7 +682,7 @@ static struct mfd_cell asic3_cell_ds1wm = {
 	.name          = "ds1wm",
 	.enable        = ds1wm_enable,
 	.disable       = ds1wm_disable,
-	.driver_data   = &ds1wm_pdata,
+	.mfd_data      = &ds1wm_pdata,
 	.num_resources = ARRAY_SIZE(ds1wm_resources),
 	.resources     = ds1wm_resources,
 };
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c
index 079d396..fb9770b 100644
--- a/drivers/mfd/htc-pasic3.c
+++ b/drivers/mfd/htc-pasic3.c
@@ -117,7 +117,7 @@ static struct mfd_cell ds1wm_cell __initdata = {
 	.name          = "ds1wm",
 	.enable        = ds1wm_enable,
 	.disable       = ds1wm_disable,
-	.driver_data   = &ds1wm_pdata,
+	.mfd_data      = &ds1wm_pdata,
 	.num_resources = 2,
 	.resources     = ds1wm_resources,
 };
@@ -172,7 +172,6 @@ static int __init pasic3_probe(struct platform_device *pdev)
 	}
 
 	if (pdata && pdata->led_pdata) {
-		led_cell.driver_data = pdata->led_pdata;
 		ret = mfd_add_devices(&pdev->dev, pdev->id, &led_cell, 1, r, 0);
 		if (ret < 0)
 			dev_warn(dev, "failed to register LED device\n");
diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
index 94f55d8..22fc726 100644
--- a/drivers/w1/masters/ds1wm.c
+++ b/drivers/w1/masters/ds1wm.c
@@ -216,7 +216,7 @@ static int ds1wm_find_divisor(int gclk)
 static void ds1wm_up(struct ds1wm_data *ds1wm_data)
 {
 	int divisor;
-	struct ds1wm_driver_data *plat = ds1wm_data->cell->driver_data;
+	struct ds1wm_driver_data *plat = mfd_get_data(ds1wm_data->pdev);
 
 	if (ds1wm_data->cell->enable)
 		ds1wm_data->cell->enable(ds1wm_data->pdev);
@@ -356,7 +356,7 @@ static int ds1wm_probe(struct platform_device *pdev)
 		ret = -ENOMEM;
 		goto err0;
 	}
-	plat = cell->driver_data;
+	plat = mfd_get_data(pdev);
 
 	/* calculate bus shift from mem resource */
 	ds1wm_data->bus_shift = resource_size(res) >> 3;
-- 
1.7.2.3


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

* [PATCH 5/9] tmio-mmc: use mfd_data instead of driver_data
  2011-02-15 22:25 [PATCH 0/9] mfd-core: clean up platform_data/driver_data from mfd_cell Andres Salomon
                   ` (3 preceding siblings ...)
  2011-02-15 22:25 ` [PATCH 4/9] ds1wm: " Andres Salomon
@ 2011-02-15 22:25 ` Andres Salomon
  2011-02-15 22:25 ` [PATCH 6/9] tmio-nand: " Andres Salomon
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Andres Salomon @ 2011-02-15 22:25 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Mark Brown, linux-kernel, Ian Molton, Chris Ball, linux-mmc

Use mfd_data for passing information from mfd drivers to mfd
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().  This changes tmio-mmc only; mfd drivers with
other cells are not modified.

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/mfd/asic3.c          |    2 +-
 drivers/mfd/sh_mobile_sdhi.c |    2 +-
 drivers/mfd/t7l66xb.c        |    2 +-
 drivers/mfd/tc6387xb.c       |    2 +-
 drivers/mfd/tc6393xb.c       |    2 +-
 drivers/mmc/host/tmio_mmc.c  |   26 +++++++++-----------------
 6 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 549d14d..d0d247d 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -783,7 +783,7 @@ static struct mfd_cell asic3_cell_mmc = {
 	.name          = "tmio-mmc",
 	.enable        = asic3_mmc_enable,
 	.disable       = asic3_mmc_disable,
-	.driver_data   = &asic3_mmc_data,
+	.mfd_data      = &asic3_mmc_data,
 	.num_resources = ARRAY_SIZE(asic3_mmc_resources),
 	.resources     = asic3_mmc_resources,
 };
diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c
index b511e74..53a6302 100644
--- a/drivers/mfd/sh_mobile_sdhi.c
+++ b/drivers/mfd/sh_mobile_sdhi.c
@@ -146,7 +146,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
 	}
 
 	memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc));
-	priv->cell_mmc.driver_data = mmc_data;
+	priv->cell_mmc.mfd_data = mmc_data;
 
 	platform_set_drvdata(pdev, priv);
 
diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index b9c1e4c..3c9e389 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -170,7 +170,7 @@ static struct mfd_cell t7l66xb_cells[] = {
 		.name = "tmio-mmc",
 		.enable = t7l66xb_mmc_enable,
 		.disable = t7l66xb_mmc_disable,
-		.driver_data = &t7166xb_mmc_data,
+		.mfd_data = &t7166xb_mmc_data,
 		.num_resources = ARRAY_SIZE(t7l66xb_mmc_resources),
 		.resources = t7l66xb_mmc_resources,
 	},
diff --git a/drivers/mfd/tc6387xb.c b/drivers/mfd/tc6387xb.c
index 6bf1775..b006f7c 100644
--- a/drivers/mfd/tc6387xb.c
+++ b/drivers/mfd/tc6387xb.c
@@ -131,7 +131,7 @@ static struct mfd_cell tc6387xb_cells[] = {
 		.name = "tmio-mmc",
 		.enable = tc6387xb_mmc_enable,
 		.disable = tc6387xb_mmc_disable,
-		.driver_data = &tc6387xb_mmc_data,
+		.mfd_data = &tc6387xb_mmc_data,
 		.num_resources = ARRAY_SIZE(tc6387xb_mmc_resources),
 		.resources = tc6387xb_mmc_resources,
 	},
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index a71ff5c..7f7b9fa 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -393,7 +393,7 @@ static struct mfd_cell __devinitdata tc6393xb_cells[] = {
 		.name = "tmio-mmc",
 		.enable = tc6393xb_mmc_enable,
 		.resume = tc6393xb_mmc_resume,
-		.driver_data = &tc6393xb_mmc_data,
+		.mfd_data = &tc6393xb_mmc_data,
 		.num_resources = ARRAY_SIZE(tc6393xb_mmc_resources),
 		.resources = tc6393xb_mmc_resources,
 	},
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 816fb74..f7d3fa9 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -300,8 +300,7 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 
 static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
 {
-	struct mfd_cell *cell = mfd_get_cell(host->pdev);
-	struct tmio_mmc_data *pdata = cell->driver_data;
+	struct tmio_mmc_data *pdata = mfd_get_data(host->pdev);
 
 	/*
 	 * Testing on sh-mobile showed that SDIO IRQs are unmasked when
@@ -324,8 +323,7 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
 
 static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
 {
-	struct mfd_cell *cell = mfd_get_cell(host->pdev);
-	struct tmio_mmc_data *pdata = cell->driver_data;
+	struct tmio_mmc_data *pdata = mfd_get_data(host->pdev);
 
 	sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 |
 		sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
@@ -666,8 +664,7 @@ out:
 static irqreturn_t tmio_mmc_irq(int irq, void *devid)
 {
 	struct tmio_mmc_host *host = devid;
-	struct mfd_cell	*cell = mfd_get_cell(host->pdev);
-	struct tmio_mmc_data *pdata = cell->driver_data;
+	struct tmio_mmc_data *pdata = mfd_get_data(host->pdev);
 	unsigned int ireg, irq_mask, status;
 	unsigned int sdio_ireg, sdio_irq_mask, sdio_status;
 
@@ -796,8 +793,7 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host)
 	struct scatterlist *sg = host->sg_ptr, *sg_tmp;
 	struct dma_async_tx_descriptor *desc = NULL;
 	struct dma_chan *chan = host->chan_rx;
-	struct mfd_cell	*cell = mfd_get_cell(host->pdev);
-	struct tmio_mmc_data *pdata = cell->driver_data;
+	struct tmio_mmc_data *pdata = mfd_get_data(host->pdev);
 	dma_cookie_t cookie;
 	int ret, i;
 	bool aligned = true, multiple = true;
@@ -873,8 +869,7 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host)
 	struct scatterlist *sg = host->sg_ptr, *sg_tmp;
 	struct dma_async_tx_descriptor *desc = NULL;
 	struct dma_chan *chan = host->chan_tx;
-	struct mfd_cell	*cell = mfd_get_cell(host->pdev);
-	struct tmio_mmc_data *pdata = cell->driver_data;
+	struct tmio_mmc_data *pdata = mfd_get_data(host->pdev);
 	dma_cookie_t cookie;
 	int ret, i;
 	bool aligned = true, multiple = true;
@@ -1071,8 +1066,7 @@ static void tmio_mmc_release_dma(struct tmio_mmc_host *host)
 static int tmio_mmc_start_data(struct tmio_mmc_host *host,
 	struct mmc_data *data)
 {
-	struct mfd_cell *cell = mfd_get_cell(host->pdev);
-	struct tmio_mmc_data *pdata = cell->driver_data;
+	struct tmio_mmc_data *pdata = mfd_get_data(host->pdev);
 
 	pr_debug("setup data transfer: blocksize %08x  nr_blocks %d\n",
 		 data->blksz, data->blocks);
@@ -1177,8 +1171,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 static int tmio_mmc_get_ro(struct mmc_host *mmc)
 {
 	struct tmio_mmc_host *host = mmc_priv(mmc);
-	struct mfd_cell	*cell = mfd_get_cell(host->pdev);
-	struct tmio_mmc_data *pdata = cell->driver_data;
+	struct tmio_mmc_data *pdata = mfd_get_data(host->pdev);
 
 	return ((pdata->flags & TMIO_MMC_WRPROTECT_DISABLE) ||
 		(sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT)) ? 0 : 1;
@@ -1187,8 +1180,7 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
 static int tmio_mmc_get_cd(struct mmc_host *mmc)
 {
 	struct tmio_mmc_host *host = mmc_priv(mmc);
-	struct mfd_cell	*cell = mfd_get_cell(host->pdev);
-	struct tmio_mmc_data *pdata = cell->driver_data;
+	struct tmio_mmc_data *pdata = mfd_get_data(host->pdev);
 
 	if (!pdata->get_cd)
 		return -ENOSYS;
@@ -1260,7 +1252,7 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
 	if (!res_ctl)
 		goto out;
 
-	pdata = cell->driver_data;
+	pdata = mfd_get_data(dev);
 	if (!pdata || !pdata->hclk)
 		goto out;
 
-- 
1.7.2.3


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

* [PATCH 6/9] tmio-nand: use mfd_data instead of driver_data
  2011-02-15 22:25 [PATCH 0/9] mfd-core: clean up platform_data/driver_data from mfd_cell Andres Salomon
                   ` (4 preceding siblings ...)
  2011-02-15 22:25 ` [PATCH 5/9] tmio-mmc: " Andres Salomon
@ 2011-02-15 22:25 ` Andres Salomon
  2011-02-15 22:25 ` [PATCH 7/9] tmio-fb: " Andres Salomon
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Andres Salomon @ 2011-02-15 22:25 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Mark Brown, linux-kernel, David Woodhouse, linux-mtd

Use mfd_data for passing information from mfd drivers to mfd
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().  This changes tmio-nand only; mfd drivers with
other cells are not modified.

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/mfd/t7l66xb.c        |    2 +-
 drivers/mfd/tc6393xb.c       |    2 +-
 drivers/mtd/nand/tmio_nand.c |    3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index 3c9e389..af57fc7 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -383,7 +383,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 
 	t7l66xb_attach_irq(dev);
 
-	t7l66xb_cells[T7L66XB_CELL_NAND].driver_data = pdata->nand_data;
+	t7l66xb_cells[T7L66XB_CELL_NAND].mfd_data = pdata->nand_data;
 
 	ret = mfd_add_devices(&dev->dev, dev->id,
 			      t7l66xb_cells, ARRAY_SIZE(t7l66xb_cells),
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index 7f7b9fa..ecb045b 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -693,7 +693,7 @@ static int __devinit tc6393xb_probe(struct platform_device *dev)
 			goto err_setup;
 	}
 
-	tc6393xb_cells[TC6393XB_CELL_NAND].driver_data = tcpd->nand_data;
+	tc6393xb_cells[TC6393XB_CELL_NAND].mfd_data = tcpd->nand_data;
 	tc6393xb_cells[TC6393XB_CELL_FB].driver_data = tcpd->fb_data;
 
 	ret = mfd_add_devices(&dev->dev, dev->id,
diff --git a/drivers/mtd/nand/tmio_nand.c b/drivers/mtd/nand/tmio_nand.c
index 5bf63e3..2383b8f 100644
--- a/drivers/mtd/nand/tmio_nand.c
+++ b/drivers/mtd/nand/tmio_nand.c
@@ -372,8 +372,7 @@ static void tmio_hw_stop(struct platform_device *dev, struct tmio_nand *tmio)
 
 static int tmio_probe(struct platform_device *dev)
 {
-	struct mfd_cell *cell = mfd_get_cell(dev);
-	struct tmio_nand_data *data = cell->driver_data;
+	struct tmio_nand_data *data = mfd_get_data(dev);
 	struct resource *fcr = platform_get_resource(dev,
 			IORESOURCE_MEM, 0);
 	struct resource *ccr = platform_get_resource(dev,
-- 
1.7.2.3


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

* [PATCH 7/9] tmio-fb: use mfd_data instead of driver_data
  2011-02-15 22:25 [PATCH 0/9] mfd-core: clean up platform_data/driver_data from mfd_cell Andres Salomon
                   ` (5 preceding siblings ...)
  2011-02-15 22:25 ` [PATCH 6/9] tmio-nand: " Andres Salomon
@ 2011-02-15 22:25 ` Andres Salomon
  2011-02-15 22:25 ` [PATCH 8/9] rdc321x-southbridge: " Andres Salomon
  2011-02-15 22:25 ` [PATCH 9/9] mfd-core: remove driver_data field from mfd_cell Andres Salomon
  8 siblings, 0 replies; 13+ messages in thread
From: Andres Salomon @ 2011-02-15 22:25 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Mark Brown, linux-kernel, Andrew Morton, linux-fbdev

Use mfd_data for passing information from mfd drivers to mfd
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().  This changes tmio-fb only; mfd drivers with
other cells are not modified.

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/mfd/tc6393xb.c |    2 +-
 drivers/video/tmiofb.c |   15 +++++++--------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index ecb045b..3d62ded 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -694,7 +694,7 @@ static int __devinit tc6393xb_probe(struct platform_device *dev)
 	}
 
 	tc6393xb_cells[TC6393XB_CELL_NAND].mfd_data = tcpd->nand_data;
-	tc6393xb_cells[TC6393XB_CELL_FB].driver_data = tcpd->fb_data;
+	tc6393xb_cells[TC6393XB_CELL_FB].mfd_data = tcpd->fb_data;
 
 	ret = mfd_add_devices(&dev->dev, dev->id,
 			tc6393xb_cells, ARRAY_SIZE(tc6393xb_cells),
diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c
index 6302882..7e57d3b 100644
--- a/drivers/video/tmiofb.c
+++ b/drivers/video/tmiofb.c
@@ -250,8 +250,7 @@ static irqreturn_t tmiofb_irq(int irq, void *__info)
  */
 static int tmiofb_hw_stop(struct platform_device *dev)
 {
-	struct mfd_cell *cell = mfd_get_cell(dev);
-	struct tmio_fb_data *data = cell->driver_data;
+	struct tmio_fb_data *data = mfd_get_data(dev);
 	struct fb_info *info = platform_get_drvdata(dev);
 	struct tmiofb_par *par = info->par;
 
@@ -313,7 +312,7 @@ static int tmiofb_hw_init(struct platform_device *dev)
 static void tmiofb_hw_mode(struct platform_device *dev)
 {
 	struct mfd_cell *cell = mfd_get_cell(dev);
-	struct tmio_fb_data *data = cell->driver_data;
+	struct tmio_fb_data *data = mfd_get_data(dev);
 	struct fb_info *info = platform_get_drvdata(dev);
 	struct fb_videomode *mode = info->mode;
 	struct tmiofb_par *par = info->par;
@@ -559,8 +558,8 @@ static int tmiofb_ioctl(struct fb_info *fbi,
 static struct fb_videomode *
 tmiofb_find_mode(struct fb_info *info, struct fb_var_screeninfo *var)
 {
-	struct mfd_cell *cell = mfd_get_cell(to_platform_device(info->device));
-	struct tmio_fb_data *data = cell->driver_data;
+	struct tmio_fb_data *data =
+			mfd_get_data(to_platform_device(info->device));
 	struct fb_videomode *best = NULL;
 	int i;
 
@@ -580,8 +579,8 @@ static int tmiofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 {
 
 	struct fb_videomode *mode;
-	struct mfd_cell *cell = mfd_get_cell(to_platform_device(info->device));
-	struct tmio_fb_data *data = cell->driver_data;
+	struct tmio_fb_data *data =
+			mfd_get_data(to_platform_device(info->device));
 
 	mode = tmiofb_find_mode(info, var);
 	if (!mode || var->bits_per_pixel > 16)
@@ -682,7 +681,7 @@ static struct fb_ops tmiofb_ops = {
 static int __devinit tmiofb_probe(struct platform_device *dev)
 {
 	struct mfd_cell *cell = mfd_get_cell(dev);
-	struct tmio_fb_data *data = cell->driver_data;
+	struct tmio_fb_data *data = mfd_get_data(dev);
 	struct resource *ccr = platform_get_resource(dev, IORESOURCE_MEM, 1);
 	struct resource *lcr = platform_get_resource(dev, IORESOURCE_MEM, 0);
 	struct resource *vram = platform_get_resource(dev, IORESOURCE_MEM, 2);
-- 
1.7.2.3


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

* [PATCH 8/9] rdc321x-southbridge: use mfd_data instead of driver_data
  2011-02-15 22:25 [PATCH 0/9] mfd-core: clean up platform_data/driver_data from mfd_cell Andres Salomon
                   ` (6 preceding siblings ...)
  2011-02-15 22:25 ` [PATCH 7/9] tmio-fb: " Andres Salomon
@ 2011-02-15 22:25 ` Andres Salomon
  2011-02-15 22:25 ` [PATCH 9/9] mfd-core: remove driver_data field from mfd_cell Andres Salomon
  8 siblings, 0 replies; 13+ messages in thread
From: Andres Salomon @ 2011-02-15 22:25 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Mark Brown, linux-kernel, Wim Van Sebroeck, Florian Fainelli,
	linux-watchdog

Use mfd_data for passing information from mfd drivers to soc
clients.  The mfd_cell's driver_data field is being phased out.

Clients that were using driver_data now access .mfd_data
via mfd_get_data().

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/gpio/rdc321x-gpio.c       |    2 +-
 drivers/mfd/rdc321x-southbridge.c |    4 ++--
 drivers/watchdog/rdc321x_wdt.c    |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/rdc321x-gpio.c b/drivers/gpio/rdc321x-gpio.c
index 897e057..5ecc9e1 100644
--- a/drivers/gpio/rdc321x-gpio.c
+++ b/drivers/gpio/rdc321x-gpio.c
@@ -135,7 +135,7 @@ static int __devinit rdc321x_gpio_probe(struct platform_device *pdev)
 	struct rdc321x_gpio *rdc321x_gpio_dev;
 	struct rdc321x_gpio_pdata *pdata;
 
-	pdata = platform_get_drvdata(pdev);
+	pdata = mfd_get_data(pdev);
 	if (!pdata) {
 		dev_err(&pdev->dev, "no platform data supplied\n");
 		return -ENODEV;
diff --git a/drivers/mfd/rdc321x-southbridge.c b/drivers/mfd/rdc321x-southbridge.c
index 5092297..193c940 100644
--- a/drivers/mfd/rdc321x-southbridge.c
+++ b/drivers/mfd/rdc321x-southbridge.c
@@ -61,12 +61,12 @@ static struct mfd_cell rdc321x_sb_cells[] = {
 		.name		= "rdc321x-wdt",
 		.resources	= rdc321x_wdt_resource,
 		.num_resources	= ARRAY_SIZE(rdc321x_wdt_resource),
-		.driver_data	= &rdc321x_wdt_pdata,
+		.mfd_data	= &rdc321x_wdt_pdata,
 	}, {
 		.name		= "rdc321x-gpio",
 		.resources	= rdc321x_gpio_resources,
 		.num_resources	= ARRAY_SIZE(rdc321x_gpio_resources),
-		.driver_data	= &rdc321x_gpio_pdata,
+		.mfd_data	= &rdc321x_gpio_pdata,
 	},
 };
 
diff --git a/drivers/watchdog/rdc321x_wdt.c b/drivers/watchdog/rdc321x_wdt.c
index 3939e53..9fd382d 100644
--- a/drivers/watchdog/rdc321x_wdt.c
+++ b/drivers/watchdog/rdc321x_wdt.c
@@ -231,7 +231,7 @@ static int __devinit rdc321x_wdt_probe(struct platform_device *pdev)
 	struct resource *r;
 	struct rdc321x_wdt_pdata *pdata;
 
-	pdata = platform_get_drvdata(pdev);
+	pdata = mfd_get_data(pdev);
 	if (!pdata) {
 		dev_err(&pdev->dev, "no platform data supplied\n");
 		return -ENODEV;
-- 
1.7.2.3


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

* [PATCH 9/9] mfd-core: remove driver_data field from mfd_cell
  2011-02-15 22:25 [PATCH 0/9] mfd-core: clean up platform_data/driver_data from mfd_cell Andres Salomon
                   ` (7 preceding siblings ...)
  2011-02-15 22:25 ` [PATCH 8/9] rdc321x-southbridge: " Andres Salomon
@ 2011-02-15 22:25 ` Andres Salomon
  8 siblings, 0 replies; 13+ messages in thread
From: Andres Salomon @ 2011-02-15 22:25 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Mark Brown, linux-kernel

All users of this have now been switched over to using mfd_data;
it can go away now.

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/mfd/mfd-core.c   |    1 -
 include/linux/mfd/core.h |    3 ---
 2 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 21a39dc..01115f6 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -37,7 +37,6 @@ static int mfd_add_device(struct device *parent, int id,
 		goto fail_device;
 
 	pdev->dev.parent = parent;
-	platform_set_drvdata(pdev, cell->driver_data);
 
 	ret = platform_device_add_data(pdev, cell, sizeof(*cell));
 	if (ret)
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index f317fe4..71cd1f9 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -30,9 +30,6 @@ struct mfd_cell {
 	int			(*suspend)(struct platform_device *dev);
 	int			(*resume)(struct platform_device *dev);
 
-	/* driver-specific data for MFD-aware "cell" drivers */
-	void			*driver_data;
-
 	/* mfd_data can be used to pass data to client drivers */
 	void			*mfd_data;
 
-- 
1.7.2.3


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

* Re: [PATCH 1/9] mfd-core: rename platform_data field of mfd_cell to mfd_data
  2011-02-15 22:25 ` [PATCH 1/9] mfd-core: rename platform_data field of mfd_cell to mfd_data Andres Salomon
@ 2011-02-16  8:39   ` Linus Walleij
  0 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2011-02-16  8:39 UTC (permalink / raw)
  To: Andres Salomon
  Cc: Samuel Ortiz, Mark Brown, linux-kernel@vger.kernel.org,
	Srinidhi KASAGAR, linux-arm-kernel@lists.infradead.org

On 02/15/2011 11:25 PM, Andres Salomon wrote:
> Rename the platform_data variable to imply a distinction between
> common platform_data driver usage (typically accessed via
> pdev->dev.platform_data) and the way MFD passes data down to
> clients (using a wrapper named mfd_get_data).
>
> All clients have already been changed to use the wrapper function,
> so this can be a quick single-commit change that only touches things
> in drivers/mfd.
>
> Signed-off-by: Andres Salomon<dilinger@queued.net>
>    

Thanks, I like easy-to-read code.
Acked-by: Linus Walleij <linus.walleij@stericsson.com>

Yours,
Linus Walleij

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

* Re: [PATCH 3/9] wm8400-codec: use mfd_data instead of driver_data
  2011-02-15 22:25 ` [PATCH 3/9] wm8400-codec: " Andres Salomon
@ 2011-02-16 21:29   ` Mark Brown
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2011-02-16 21:29 UTC (permalink / raw)
  To: Andres Salomon
  Cc: Samuel Ortiz, linux-kernel, Ian Lartey, Dimitris Papastamos,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, alsa-devel

On Tue, Feb 15, 2011 at 02:25:23PM -0800, Andres Salomon wrote:
> Use mfd_data for passing information from mfd drivers to soc
> clients.  The mfd_cell's driver_data field is being phased out.
> 
> Clients that were using driver_data now access .mfd_data
> via mfd_get_data().
> 
> Signed-off-by: Andres Salomon <dilinger@queued.net>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

* Re: [alsa-devel] [PATCH 2/9] davinci_voicecodec: use mfd_data instead of driver_data
  2011-02-15 22:25 ` [PATCH 2/9] davinci_voicecodec: use mfd_data instead of driver_data Andres Salomon
@ 2011-02-16 21:59   ` Mark Brown
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2011-02-16 21:59 UTC (permalink / raw)
  To: Andres Salomon
  Cc: Samuel Ortiz, alsa-devel, Takashi Iwai, linux-kernel,
	Liam Girdwood

On Tue, Feb 15, 2011 at 02:25:22PM -0800, Andres Salomon wrote:
> Use mfd_data for passing information from mfd drivers to soc
> clients.  The mfd_cell's driver_data field is being phased out.
> 
> Clients that were using driver_data now access .mfd_data
> via mfd_get_data().
> 
> Signed-off-by: Andres Salomon <dilinger@queued.net>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

end of thread, other threads:[~2011-02-16 21:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-15 22:25 [PATCH 0/9] mfd-core: clean up platform_data/driver_data from mfd_cell Andres Salomon
2011-02-15 22:25 ` [PATCH 1/9] mfd-core: rename platform_data field of mfd_cell to mfd_data Andres Salomon
2011-02-16  8:39   ` Linus Walleij
2011-02-15 22:25 ` [PATCH 2/9] davinci_voicecodec: use mfd_data instead of driver_data Andres Salomon
2011-02-16 21:59   ` [alsa-devel] " Mark Brown
2011-02-15 22:25 ` [PATCH 3/9] wm8400-codec: " Andres Salomon
2011-02-16 21:29   ` Mark Brown
2011-02-15 22:25 ` [PATCH 4/9] ds1wm: " Andres Salomon
2011-02-15 22:25 ` [PATCH 5/9] tmio-mmc: " Andres Salomon
2011-02-15 22:25 ` [PATCH 6/9] tmio-nand: " Andres Salomon
2011-02-15 22:25 ` [PATCH 7/9] tmio-fb: " Andres Salomon
2011-02-15 22:25 ` [PATCH 8/9] rdc321x-southbridge: " Andres Salomon
2011-02-15 22:25 ` [PATCH 9/9] mfd-core: remove driver_data field from mfd_cell Andres Salomon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox