aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2024-06-06 16:10:23 +0300
committerLee Jones <[email protected]>2024-06-13 17:45:23 +0100
commit90b7f2ead953aab5677ae8235d78841cee8fd13e (patch)
treec89ba61b1b4d8e1c5b64701016ac9ee3557ed399
parentb72755f5b577357cac661cbf9048cad704eb4ad8 (diff)
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: b72755f5b577 ("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]>
-rw-r--r--drivers/video/backlight/lm3509_bl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/backlight/lm3509_bl.c b/drivers/video/backlight/lm3509_bl.c
index ab57f79ffe23..c93cdedff5ad 100644
--- a/drivers/video/backlight/lm3509_bl.c
+++ b/drivers/video/backlight/lm3509_bl.c
@@ -114,9 +114,10 @@ lm3509_backlight_register(struct device *dev, const char *name_suffix,
}
bd = devm_backlight_device_register(dev, label, dev, data, ops, &props);
- if (bd)
- backlight_update_status(bd);
+ if (IS_ERR(bd))
+ return bd;
+ backlight_update_status(bd);
return bd;
}