backlight/ld9040.c: testing the wrong variable in

Started by Dan Carpenter on Mar 29, 2011 · 2 messages from 2 authors · Last reply Mar 29, 2011

Subsystems (3)

Maintainers (5)

Show 1 more
STALE5709d

open the first message on its own page

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

Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c
index 7281b25..9e81d69 100644
--- a/drivers/video/backlight/ld9040.c
+++ b/drivers/video/backlight/ld9040.c
@@ -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;
 	}
 
Message details and related content
 On 2011-03-29, Dan Carpenter wrote:
quoted hunk
We should be testing "bd" here instead of "ld".  It's a copy and
paste bug.

Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c
index 7281b25..9e81d69 100644
--- a/drivers/video/backlight/ld9040.c
+++ b/drivers/video/backlight/ld9040.c
@@ -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,
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help