Skip to content

Commit

Permalink
video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()
Browse files Browse the repository at this point in the history
[ Upstream commit fee5c1e ]

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

Fixes: b985172 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dan Carpenter authored and gregkh committed Apr 8, 2022
1 parent 9280ef2 commit c19c542
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/video/fbdev/atmel_lcdfb.c
Expand Up @@ -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;

Expand Down

0 comments on commit c19c542

Please sign in to comment.