aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/backlight/pcf50633-backlight.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2010-05-24 23:37:19 +0200
committerLars-Peter Clausen <lars@metafoo.de>2010-06-08 15:37:09 +0200
commit4a29094bdf6ff382b7558e242ddb91c67fc200c7 (patch)
treea6956e158bdcf88c2b916e2f383a810f81acef86 /drivers/video/backlight/pcf50633-backlight.c
parent7c3f9799aa31d974507bf73e8c29172ecc672ecf (diff)
MFD: pcf50633: Use mfd cells to register child devices
This patch changes the pcf50633 core code to use mfd cells to register child devices instead of calling platform_device_{alloc,add} for each child. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Diffstat (limited to 'drivers/video/backlight/pcf50633-backlight.c')
-rw-r--r--drivers/video/backlight/pcf50633-backlight.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/video/backlight/pcf50633-backlight.c b/drivers/video/backlight/pcf50633-backlight.c
index 5b72089c9c3..fbcb0ea82f0 100644
--- a/drivers/video/backlight/pcf50633-backlight.c
+++ b/drivers/video/backlight/pcf50633-backlight.c
@@ -44,7 +44,7 @@ struct pcf50633_bl {
*/
int pcf50633_bl_set_brightness_limit(struct pcf50633 *pcf, unsigned int limit)
{
- struct pcf50633_bl *pcf_bl = platform_get_drvdata(pcf->bl_pdev);
+ struct pcf50633_bl *pcf_bl = pcf->bl;
if (!pcf_bl)
return -ENODEV;
@@ -102,6 +102,7 @@ static struct backlight_ops pcf50633_bl_ops = {
static int __devinit pcf50633_bl_probe(struct platform_device *pdev)
{
int ret;
+ struct pcf50633 *pcf = dev_to_pcf50633(pdev->dev.parent);
struct pcf50633_bl *pcf_bl;
struct pcf50633_platform_data *pcf50633_data = pdev->dev.parent->platform_data;
struct pcf50633_bl_platform_data *pdata = pcf50633_data->backlight_data;
@@ -122,7 +123,7 @@ static int __devinit pcf50633_bl_probe(struct platform_device *pdev)
pcf_bl->brightness_limit = 0x3f;
}
- pcf_bl->pcf = dev_to_pcf50633(pdev->dev.parent);
+ pcf_bl->pcf = pcf;
pcf_bl->bl = backlight_device_register(pdev->name, &pdev->dev, pcf_bl,
&pcf50633_bl_ops, &bl_props);
@@ -132,6 +133,7 @@ static int __devinit pcf50633_bl_probe(struct platform_device *pdev)
goto err_free;
}
+ pcf->bl = pcf_bl;
platform_set_drvdata(pdev, pcf_bl);
pcf50633_reg_write(pcf_bl->pcf, PCF50633_REG_LEDDIM, pdata->ramp_time);
@@ -154,6 +156,8 @@ static int __devexit pcf50633_bl_remove(struct platform_device *pdev)
{
struct pcf50633_bl *pcf_bl = platform_get_drvdata(pdev);
+ pcf_bl->pcf->bl = NULL;
+
backlight_device_unregister(pcf_bl->bl);
platform_set_drvdata(pdev, NULL);