leds: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
This commit is contained in:
parent
bfa855bad3
commit
84196a2ffb
3 changed files with 4 additions and 4 deletions
|
@ -204,7 +204,7 @@ static int pm860x_led_probe(struct platform_device *pdev)
|
||||||
sprintf(data->name, "led1-blue");
|
sprintf(data->name, "led1-blue");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dev_set_drvdata(&pdev->dev, data);
|
platform_set_drvdata(pdev, data);
|
||||||
data->chip = chip;
|
data->chip = chip;
|
||||||
data->i2c = (chip->id == CHIP_PM8606) ? chip->client : chip->companion;
|
data->i2c = (chip->id == CHIP_PM8606) ? chip->client : chip->companion;
|
||||||
data->port = pdev->id;
|
data->port = pdev->id;
|
||||||
|
|
|
@ -159,14 +159,14 @@ static int sunfire_led_generic_probe(struct platform_device *pdev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_set_drvdata(&pdev->dev, p);
|
platform_set_drvdata(pdev, p);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sunfire_led_generic_remove(struct platform_device *pdev)
|
static int sunfire_led_generic_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct sunfire_drvdata *p = dev_get_drvdata(&pdev->dev);
|
struct sunfire_drvdata *p = platform_get_drvdata(pdev);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < NUM_LEDS_PER_BOARD; i++)
|
for (i = 0; i < NUM_LEDS_PER_BOARD; i++)
|
||||||
|
|
|
@ -241,7 +241,7 @@ static int wm831x_status_probe(struct platform_device *pdev)
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!drvdata)
|
if (!drvdata)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
dev_set_drvdata(&pdev->dev, drvdata);
|
platform_set_drvdata(pdev, drvdata);
|
||||||
|
|
||||||
drvdata->wm831x = wm831x;
|
drvdata->wm831x = wm831x;
|
||||||
drvdata->reg = res->start;
|
drvdata->reg = res->start;
|
||||||
|
|
Loading…
Reference in a new issue