Commit 90b7f2ea authored by Dan Carpenter's avatar Dan Carpenter Committed by Lee Jones

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: b72755f5 ("backlight: Add new lm3509 backlight driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/187b5bc5-a010-46c2-8ead-980df9efae79@moroto.mountainSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent b72755f5
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment