diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-30 17:43:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:30:27 -0400 |
commit | 1902a9e62ba34a1071407ab61cef626e019a0923 (patch) | |
tree | 082b821299d7a543b8827f571f809e535d3663ed /drivers/mfd | |
parent | 79510cdbc76265426c6d75326436624393694ea7 (diff) |
mfd: remove driver_data direct access of struct device
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device. Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used. These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.
Cc: Samuel Ortiz <sameo@linux.intel.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/htc-pasic3.c | 4 | ||||
-rw-r--r-- | drivers/mfd/pcf50633-core.c | 2 | ||||
-rw-r--r-- | drivers/mfd/wm8400-core.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c index 386da1566fcc..cb73051e43db 100644 --- a/drivers/mfd/htc-pasic3.c +++ b/drivers/mfd/htc-pasic3.c | |||
@@ -35,7 +35,7 @@ struct pasic3_data { | |||
35 | */ | 35 | */ |
36 | void pasic3_write_register(struct device *dev, u32 reg, u8 val) | 36 | void pasic3_write_register(struct device *dev, u32 reg, u8 val) |
37 | { | 37 | { |
38 | struct pasic3_data *asic = dev->driver_data; | 38 | struct pasic3_data *asic = dev_get_drvdata(dev); |
39 | int bus_shift = asic->bus_shift; | 39 | int bus_shift = asic->bus_shift; |
40 | void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift); | 40 | void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift); |
41 | void __iomem *data = asic->mapping + (REG_DATA << bus_shift); | 41 | void __iomem *data = asic->mapping + (REG_DATA << bus_shift); |
@@ -50,7 +50,7 @@ EXPORT_SYMBOL(pasic3_write_register); /* for leds-pasic3 */ | |||
50 | */ | 50 | */ |
51 | u8 pasic3_read_register(struct device *dev, u32 reg) | 51 | u8 pasic3_read_register(struct device *dev, u32 reg) |
52 | { | 52 | { |
53 | struct pasic3_data *asic = dev->driver_data; | 53 | struct pasic3_data *asic = dev_get_drvdata(dev); |
54 | int bus_shift = asic->bus_shift; | 54 | int bus_shift = asic->bus_shift; |
55 | void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift); | 55 | void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift); |
56 | void __iomem *data = asic->mapping + (REG_DATA << bus_shift); | 56 | void __iomem *data = asic->mapping + (REG_DATA << bus_shift); |
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 11a6248cc1c1..082c197ab9b8 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c | |||
@@ -618,7 +618,7 @@ static int __devinit pcf50633_probe(struct i2c_client *client, | |||
618 | 618 | ||
619 | pdev->dev.parent = pcf->dev; | 619 | pdev->dev.parent = pcf->dev; |
620 | pdev->dev.platform_data = &pdata->reg_init_data[i]; | 620 | pdev->dev.platform_data = &pdata->reg_init_data[i]; |
621 | pdev->dev.driver_data = pcf; | 621 | dev_set_drvdata(&pdev->dev, pcf); |
622 | pcf->regulator_pdev[i] = pdev; | 622 | pcf->regulator_pdev[i] = pdev; |
623 | 623 | ||
624 | platform_device_add(pdev); | 624 | platform_device_add(pdev); |
diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c index cf30d06a0104..7c21bf791569 100644 --- a/drivers/mfd/wm8400-core.c +++ b/drivers/mfd/wm8400-core.c | |||
@@ -265,7 +265,7 @@ static int wm8400_init(struct wm8400 *wm8400, | |||
265 | 265 | ||
266 | mutex_init(&wm8400->io_lock); | 266 | mutex_init(&wm8400->io_lock); |
267 | 267 | ||
268 | wm8400->dev->driver_data = wm8400; | 268 | dev_set_drvdata(wm8400->dev, wm8400); |
269 | 269 | ||
270 | /* Check that this is actually a WM8400 */ | 270 | /* Check that this is actually a WM8400 */ |
271 | ret = wm8400->read_dev(wm8400->io_data, WM8400_RESET_ID, 1, ®); | 271 | ret = wm8400->read_dev(wm8400->io_data, WM8400_RESET_ID, 1, ®); |