backlight/pcf50633: check for NULL consistently in
Subsystems (3)
PATCH 1/1 backlight/pcf50633: check for NULL consistently in
We checked "pdata" for NULL at the start of the function so we should check it here as well.
Signed-off-by Dan Carpenter <[email protected]>
---
Compile tested only. Please review.
drivers/video/backlight/pcf50633-backlight.c +3 -1
@@ -136,7 +136,9 @@ static int __devinit pcf50633_bl_probe(struct platform_device *pdev)platform_set_drvdata (pdev, pcf_bl); -pcf50633_reg_write (pcf_bl->pcf,PCF50633_REG_LEDDIM , pdata->ramp_time); +if (pdata) +pcf50633_reg_write (pcf_bl->pcf,PCF50633_REG_LEDDIM , + pdata->ramp_time);/* Should be different from bl_props.brightness, so we do not exit * update_status early the first time it's called */
Re: [patch] backlight/pcf50633: check for NULL consistently in pcf50633_bl_probe()
Quoted 4 lines · Dan Carpenter
We checked "pdata" for NULL at the start of the function so we should check it here as well.
Signed-off-by Dan Carpenter <[email protected]>
Quoted 18 lines
---
Compile tested only. Please review.drivers/video/backlight/pcf50633-backlight.c +3
-1@@ -136,7 +136,9 @@ static int __devinit pcf50633_bl_probe(struct platform_device *pdev)platform_set_drvdata (pdev, pcf_bl); -pcf50633_reg_write (pcf_bl->pcf,PCF50633_REG_LEDDIM , pdata->ramp_time); +if (pdata) +pcf50633_reg_write (pcf_bl->pcf,PCF50633_REG_LEDDIM , + pdata->ramp_time);/* Should be different from bl_props.brightness, so we do not exit * update_status early the first time it's called */