diff options
Diffstat (limited to 'drivers/video/backlight/pcf50633-backlight.c')
-rw-r--r-- | drivers/video/backlight/pcf50633-backlight.c | 8 |
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); |