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:
Dan Carpenter 2024-06-06 16:10:23 +03:00 committed by Lee Jones
parent b72755f5b5
commit 90b7f2ead9

View File

@ -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;
}