video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 3 Dec 2021 09:58:08 +0000 (12:58 +0300)
committerHelge Deller <deller@gmx.de>
Sun, 30 Jan 2022 18:38:35 +0000 (19:38 +0100)
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 <dan.carpenter@oracle.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/atmel_lcdfb.c

index 355b612..1fc8de4 100644 (file)
@@ -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;