Skip to contentSkip to conversation

backlight/pcf50633: check for NULL consistently in

PATCH In review Dan Carpenter 2 participants 2 messages Mar 29, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

---
Compile tested only. Please review.

drivers/video/backlight/pcf50633-backlight.c +3 -1
index ef5628d..0fe934f 100644
@@ -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 */
Acked-by on v1 1/1
#1 lore raw

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.

Quoted 18 lines

---
Compile tested only. Please review.

drivers/video/backlight/pcf50633-backlight.c +3 -1
index ef5628d..0fe934f 100644
@@ -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 */