linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() function
@ 2024-06-06 13:10 Dan Carpenter
  2024-06-13 16:24 ` Daniel Thompson
  2024-06-13 16:48 ` (subset) " Lee Jones
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-06-06 13:10 UTC (permalink / raw)
  To: Patrick Gansterer
  Cc: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, dri-devel,
	linux-fbdev, linux-kernel, kernel-janitors

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 <dan.carpenter@linaro.org>
---
 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, &props);
-	if (bd)
-		backlight_update_status(bd);
+	if (IS_ERR(bd))
+		return bd;
 
+	backlight_update_status(bd);
 	return bd;
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() function
  2024-06-06 13:10 [PATCH] backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() function Dan Carpenter
@ 2024-06-13 16:24 ` Daniel Thompson
  2024-06-13 16:48 ` (subset) " Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Thompson @ 2024-06-13 16:24 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Patrick Gansterer, Lee Jones, Jingoo Han, Helge Deller, dri-devel,
	linux-fbdev, linux-kernel, kernel-janitors

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 <dan.carpenter@linaro.org>

Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


Daniel.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: (subset) [PATCH] backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() function
  2024-06-06 13:10 [PATCH] backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() function Dan Carpenter
  2024-06-13 16:24 ` Daniel Thompson
@ 2024-06-13 16:48 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2024-06-13 16:48 UTC (permalink / raw)
  To: Patrick Gansterer, Dan Carpenter
  Cc: Daniel Thompson, Jingoo Han, Helge Deller, dri-devel, linux-fbdev,
	linux-kernel, kernel-janitors

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 [李琼斯]


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-13 16:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-06 13:10 [PATCH] backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() function Dan Carpenter
2024-06-13 16:24 ` Daniel Thompson
2024-06-13 16:48 ` (subset) " Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).