mfd-core: clean up platform_data/driver_data from mfd_cell
Subsystems (13)
PATCH 1/9 mfd-core: rename platform_data field of mfd_cell to mfd_data
In reply to Andres SalomonRename 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.
--- 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(-)
drivers/mfd/ab3100-core.c +1 -1
@@ -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 );
drivers/mfd/ab3550-core.c +1 -1
@@ -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,
drivers/mfd/janz-cmodio.c +1 -1
@@ -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 ;
drivers/mfd/mc13xxx-core.c +1 -1
@@ -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 :-( */
drivers/mfd/timberdale.c +27 -27
198 lines not on this page · raw message
drivers/mfd/twl4030-codec.c +2 -2
@@ -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++; }
drivers/mfd/wl1273-core.c +2 -2
@@ -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++; }
include/linux/mfd/core.h +4 -4
@@ -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,
Signature · 1 line
1.7.2.3
PATCH 3/9 wm8400-codec: use mfd_data instead of driver_data
In reply to Andres SalomonUse 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().
--- drivers/mfd/wm8400-core.c | 2 +- sound/soc/codecs/wm8400.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/wm8400-core.c +1 -1
@@ -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 );
sound/soc/codecs/wm8400.c +1 -1
@@ -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;
Signature · 1 line
1.7.2.3
PATCH 7/9 tmio-fb: use mfd_data instead of driver_data
In reply to Andres SalomonUse 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.
--- drivers/mfd/tc6393xb.c | 2 +- drivers/video/tmiofb.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-)
drivers/mfd/tc6393xb.c +1 -1
@@ -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),
drivers/video/tmiofb.c +5 -8
@@ -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 );
Signature · 1 line
1.7.2.3
cover mfd-core: clean up platform_data/driver_data from mfd_cell
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(-)
PATCH 2/9 davinci_voicecodec: use mfd_data instead of driver_data
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().
--- 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(-)
drivers/mfd/davinci_voicecodec.c +2 -2
@@ -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 );
sound/soc/codecs/cq93vc.c +2 -1
@@ -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;
sound/soc/davinci/davinci-vcif.c +1 -1
@@ -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;
Signature · 1 line
1.7.2.3
PATCH 5/9 tmio-mmc: use mfd_data instead of driver_data
In reply to Andres SalomonUse 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.
--- 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(-)
drivers/mfd/asic3.c +1 -1
@@ -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, };
drivers/mfd/sh_mobile_sdhi.c +1 -1
@@ -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);
drivers/mfd/t7l66xb.c +1 -1
@@ -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, },
drivers/mfd/tc6387xb.c +1 -1
@@ -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, },
drivers/mfd/tc6393xb.c +1 -1
@@ -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, },
drivers/mmc/host/tmio_mmc.c +9 -17
@@ -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;
Signature · 1 line
1.7.2.3
PATCH 6/9 tmio-nand: use mfd_data instead of driver_data
In reply to Andres SalomonUse 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.
--- drivers/mfd/t7l66xb.c | 2 +- drivers/mfd/tc6393xb.c | 2 +- drivers/mtd/nand/tmio_nand.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-)
drivers/mfd/t7l66xb.c +1 -1
@@ -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),
drivers/mfd/tc6393xb.c +1 -1
@@ -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,
drivers/mtd/nand/tmio_nand.c +1 -2
@@ -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,
Signature · 1 line
1.7.2.3
PATCH 8/9 rdc321x-southbridge: use mfd_data instead of driver_data
In reply to Andres SalomonUse 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().
--- 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(-)
drivers/gpio/rdc321x-gpio.c +1 -1
@@ -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 ;
drivers/mfd/rdc321x-southbridge.c +2 -2
@@ -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, }, };
drivers/watchdog/rdc321x_wdt.c +1 -1
@@ -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 ;
Signature · 1 line
1.7.2.3
PATCH 9/9 mfd-core: remove driver_data field from mfd_cell
In reply to Andres SalomonAll users of this have now been switched over to using mfd_data; it can go away now.
--- drivers/mfd/mfd-core.c | 1 - include/linux/mfd/core.h | 3 --- 2 files changed, 0 insertions(+), 4 deletions(-)
drivers/mfd/mfd-core.c +0 -1
@@ -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)
include/linux/mfd/core.h +0 -3
@@ -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;
Signature · 1 line
1.7.2.3
PATCH 4/9 ds1wm: use mfd_data instead of driver_data
In reply to Andres SalomonUse 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.
--- drivers/mfd/asic3.c | 2 +- drivers/mfd/htc-pasic3.c | 3 +-- drivers/w1/masters/ds1wm.c | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-)
drivers/mfd/asic3.c +1 -1
@@ -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, };
drivers/mfd/htc-pasic3.c +1 -2
@@ -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" );
drivers/w1/masters/ds1wm.c +2 -2
@@ -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 ;
Signature · 1 line
1.7.2.3
Re: [PATCH 1/9] mfd-core: rename platform_data field of mfd_cell to mfd_data
In reply to Andres SalomonQuoted 11 lines · Andres Salomon
Rename the
platform_datavariable to imply a distinction between commonplatform_datadriver usage (typically accessed viapdev->dev.platform_data) and the way MFD passes data down to clients (using a wrapper namedmfd_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<[email protected]>
Thanks, I like easy-to-read code.
Yours,
Linus Walleij
Re: [PATCH 3/9] wm8400-codec: use mfd_data instead of driver_data
In reply to Andres SalomonQuoted 7 lines · Andres Salomon
Use
mfd_datafor passing information from mfd drivers to soc clients. The mfd_cell'sdriver_datafield is being phased out.Clients that were using
driver_datanow access .mfd_data viamfd_get_data().Signed-off-by Andres Salomon <[email protected]>
Re: [alsa-devel] [PATCH 2/9] davinci_voicecodec: use mfd_data instead of driver_data
In reply to Andres SalomonQuoted 7 lines · Andres Salomon
Use
mfd_datafor passing information from mfd drivers to soc clients. The mfd_cell'sdriver_datafield is being phased out.Clients that were using
driver_datanow access .mfd_data viamfd_get_data().Signed-off-by Andres Salomon <[email protected]>