Skip to content

Commit 90b7f2e

Browse files
Dan Carpenterlag-linaro
authored andcommitted
backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() function
The devm_backlight_device_register() doesn't return NULL, it returns error pointers. Update the error checking to match. Fixes: b72755f ("backlight: Add new lm3509 backlight driver") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent b72755f commit 90b7f2e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/video/backlight/lm3509_bl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ lm3509_backlight_register(struct device *dev, const char *name_suffix,
114114
}
115115

116116
bd = devm_backlight_device_register(dev, label, dev, data, ops, &props);
117-
if (bd)
118-
backlight_update_status(bd);
117+
if (IS_ERR(bd))
118+
return bd;
119119

120+
backlight_update_status(bd);
120121
return bd;
121122
}
122123

0 commit comments

Comments
 (0)