Skip to contentSkip to conversation

backlight/ld9040.c: testing the wrong variable 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/ld9040.c: testing the wrong variable in

We should be testing "bd" here instead of "ld". It's a copy and paste bug.

drivers/video/backlight/ld9040.c +2 -2
index 7281b25..9e81d69 100644
@@ -701,8 +701,8 @@ static int ld9040_probe(struct spi_device *spi)
 
 	bd = backlight_device_register("ld9040-bl", &spi->dev,
 		lcd, &ld9040_backlight_ops, NULL);
-	if (IS_ERR(ld)) {
-		ret = PTR_ERR(ld);
+	if (IS_ERR(bd)) {
+		ret = PTR_ERR(bd);
 		goto out_free_lcd;
 	}
 
#1 lore raw
Quoted 11 lines · Dan Carpenter

We should be testing "bd" here instead of "ld". It's a copy and paste bug.

drivers/video/backlight/ld9040.c +0 -0
index 7281b25..9e81d69 100644

drivers/video/backlight/ld9040.c static int ld9040_probe(struct spi_device *spi) · line 708

Quoted 10 lines
drivers/video/backlight/ld9040.c +2 -2
@@ -701,8 +701,8 @@ static int ld9040_probe(struct spi_device *spi)
 
 	bd = backlight_device_register("ld9040-bl", &spi->dev,
 		lcd, &ld9040_backlight_ops, NULL);
-	if (IS_ERR(ld)) {
-		ret = PTR_ERR(ld);
+	if (IS_ERR(bd)) {
+		ret = PTR_ERR(bd);
 		goto out_free_lcd;
 	}
 

Yes, It's my mistake. It has to be changed as you said.

Thank you,