Re: (subset) [PATCH] backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() function

2024-06-13 Thread Lee Jones
On Thu, 06 Jun 2024 16:10:23 +0300, Dan Carpenter wrote:
> The devm_backlight_device_register() doesn't return NULL, it returns
> error pointers.  Update the error checking to match.
> 
> 

Applied, thanks!

[1/1] backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() function
  commit: 90b7f2ead953aab5677ae8235d78841cee8fd13e

--
Lee Jones [李琼斯]



Re: [PATCH] backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() function

2024-06-13 Thread Daniel Thompson
On Thu, Jun 06, 2024 at 04:10:23PM +0300, Dan Carpenter wrote:
> 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 

Reviewed-by: Daniel Thompson 


Daniel.


[PATCH] backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() function

2024-06-06 Thread Dan Carpenter
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 
---
 drivers/video/backlight/lm3509_bl.c | 5 +++--
 1 file 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, );
-   if (bd)
-   backlight_update_status(bd);
+   if (IS_ERR(bd))
+   return bd;
 
+   backlight_update_status(bd);
return bd;
 }
 
-- 
2.43.0