mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 10:43:43 +00:00
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: b72755f5b5
("backlight: Add new lm3509 backlight driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/187b5bc5-a010-46c2-8ead-980df9efae79@moroto.mountain
Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
parent
b72755f5b5
commit
90b7f2ead9
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user