video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()
Subsystems (4)
PATCH 1/1 video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()
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 <[email protected]>
--- drivers/video/fbdev/atmel_lcdfb.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/video/fbdev/atmel_lcdfb.c +6 -5
@@ -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;
Signature · 1 line
2.20.1
Quoted 5 lines · Dan Carpenter
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 <[email protected]>
Looks good to me: thanks Dan!
Acked-by Nicolas Ferre <[email protected]>
Best regards,
Nicolas
Quoted 33 lines
--- drivers/video/fbdev/atmel_lcdfb.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)drivers/video/fbdev/atmel_lcdfb.c +6
-6@@ -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
Signature · 1 line
Nicolas Ferre