mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
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>
This commit is contained in:
parent
79510cdbc7
commit
1902a9e62b
@ -35,7 +35,7 @@ struct pasic3_data {
|
|||||||
*/
|
*/
|
||||||
void pasic3_write_register(struct device *dev, u32 reg, u8 val)
|
void pasic3_write_register(struct device *dev, u32 reg, u8 val)
|
||||||
{
|
{
|
||||||
struct pasic3_data *asic = dev->driver_data;
|
struct pasic3_data *asic = dev_get_drvdata(dev);
|
||||||
int bus_shift = asic->bus_shift;
|
int bus_shift = asic->bus_shift;
|
||||||
void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift);
|
void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift);
|
||||||
void __iomem *data = asic->mapping + (REG_DATA << bus_shift);
|
void __iomem *data = asic->mapping + (REG_DATA << bus_shift);
|
||||||
@ -50,7 +50,7 @@ EXPORT_SYMBOL(pasic3_write_register); /* for leds-pasic3 */
|
|||||||
*/
|
*/
|
||||||
u8 pasic3_read_register(struct device *dev, u32 reg)
|
u8 pasic3_read_register(struct device *dev, u32 reg)
|
||||||
{
|
{
|
||||||
struct pasic3_data *asic = dev->driver_data;
|
struct pasic3_data *asic = dev_get_drvdata(dev);
|
||||||
int bus_shift = asic->bus_shift;
|
int bus_shift = asic->bus_shift;
|
||||||
void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift);
|
void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift);
|
||||||
void __iomem *data = asic->mapping + (REG_DATA << bus_shift);
|
void __iomem *data = asic->mapping + (REG_DATA << bus_shift);
|
||||||
|
@ -618,7 +618,7 @@ static int __devinit pcf50633_probe(struct i2c_client *client,
|
|||||||
|
|
||||||
pdev->dev.parent = pcf->dev;
|
pdev->dev.parent = pcf->dev;
|
||||||
pdev->dev.platform_data = &pdata->reg_init_data[i];
|
pdev->dev.platform_data = &pdata->reg_init_data[i];
|
||||||
pdev->dev.driver_data = pcf;
|
dev_set_drvdata(&pdev->dev, pcf);
|
||||||
pcf->regulator_pdev[i] = pdev;
|
pcf->regulator_pdev[i] = pdev;
|
||||||
|
|
||||||
platform_device_add(pdev);
|
platform_device_add(pdev);
|
||||||
|
@ -265,7 +265,7 @@ static int wm8400_init(struct wm8400 *wm8400,
|
|||||||
|
|
||||||
mutex_init(&wm8400->io_lock);
|
mutex_init(&wm8400->io_lock);
|
||||||
|
|
||||||
wm8400->dev->driver_data = wm8400;
|
dev_set_drvdata(wm8400->dev, wm8400);
|
||||||
|
|
||||||
/* Check that this is actually a WM8400 */
|
/* Check that this is actually a WM8400 */
|
||||||
ret = wm8400->read_dev(wm8400->io_data, WM8400_RESET_ID, 1, ®);
|
ret = wm8400->read_dev(wm8400->io_data, WM8400_RESET_ID, 1, ®);
|
||||||
|
Loading…
Reference in New Issue
Block a user