[PATCH] video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()

Subsystems: framebuffer layer, microchip lcdfb driver, the rest

STALE1717d

2 messages, 2 authors, 2021-12-03 · open the first message on its own page

[PATCH] video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()

From: Dan Carpenter <hidden>
Date: 2021-12-03 09:58:40

If "sinfo->config" is not found, then return -ENODEV.  Don't
return success.

Fixes: b985172b328a ("video: atmel_lcdfb: add device tree suport")
Signed-off-by: Dan Carpenter <redacted>
---
 drivers/video/fbdev/atmel_lcdfb.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
index 355b6120dc4f..1fc8de4ecbeb 100644
--- a/drivers/video/fbdev/atmel_lcdfb.c
+++ b/drivers/video/fbdev/atmel_lcdfb.c
@@ -1062,15 +1062,16 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
 
 	INIT_LIST_HEAD(&info->modelist);
 
-	if (pdev->dev.of_node) {
-		ret = atmel_lcdfb_of_init(sinfo);
-		if (ret)
-			goto free_info;
-	} else {
+	if (!pdev->dev.of_node) {
 		dev_err(dev, "cannot get default configuration\n");
 		goto free_info;
 	}
 
+	ret = atmel_lcdfb_of_init(sinfo);
+	if (ret)
+		goto free_info;
+
+	ret = -ENODEV;
 	if (!sinfo->config)
 		goto free_info;
 
-- 
2.20.1

Re: [PATCH] video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()

From: Nicolas Ferre <nicolas.ferre@microchip.com>
Date: 2021-12-03 13:38:00

On 03/12/2021 at 10:58, Dan Carpenter wrote:
If "sinfo->config" is not found, then return -ENODEV.  Don't
return success.

Fixes: b985172b328a ("video: atmel_lcdfb: add device tree suport")
Signed-off-by: Dan Carpenter <redacted>
Looks good to me: thanks Dan!

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Best regards,
   Nicolas
quoted hunk
---
  drivers/video/fbdev/atmel_lcdfb.c | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
index 355b6120dc4f..1fc8de4ecbeb 100644
--- a/drivers/video/fbdev/atmel_lcdfb.c
+++ b/drivers/video/fbdev/atmel_lcdfb.c
@@ -1062,15 +1062,16 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)

         INIT_LIST_HEAD(&info->modelist);

-       if (pdev->dev.of_node) {
-               ret = atmel_lcdfb_of_init(sinfo);
-               if (ret)
-                       goto free_info;
-       } else {
+       if (!pdev->dev.of_node) {
                 dev_err(dev, "cannot get default configuration\n");
                 goto free_info;
         }

+       ret = atmel_lcdfb_of_init(sinfo);
+       if (ret)
+               goto free_info;
+
+       ret = -ENODEV;
         if (!sinfo->config)
                 goto free_info;

--
2.20.1

-- 
Nicolas Ferre
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help