All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()
@ 2021-12-03  9:58 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-12-03  9:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Alexandre Belloni, Ludovic Desroches,
	Jean-Christophe PLAGNIOL-VILLARD, Tomi Valkeinen, linux-fbdev,
	dri-devel, kernel-janitors

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>
---
 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


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

* [PATCH] video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()
@ 2021-12-03  9:58 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-12-03  9:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Alexandre Belloni, kernel-janitors, linux-fbdev, dri-devel,
	Ludovic Desroches, Tomi Valkeinen,
	Jean-Christophe PLAGNIOL-VILLARD

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>
---
 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


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

* Re: [PATCH] video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()
  2021-12-03  9:58 ` Dan Carpenter
@ 2021-12-03 13:30   ` Nicolas Ferre
  -1 siblings, 0 replies; 4+ messages in thread
From: Nicolas Ferre @ 2021-12-03 13:30 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Alexandre Belloni, Ludovic Desroches,
	Jean-Christophe PLAGNIOL-VILLARD, Tomi Valkeinen, linux-fbdev,
	dri-devel, kernel-janitors

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 <dan.carpenter@oracle.com>

Looks good to me: thanks Dan!

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

Best regards,
   Nicolas

> ---
>   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

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

* Re: [PATCH] video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()
@ 2021-12-03 13:30   ` Nicolas Ferre
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Ferre @ 2021-12-03 13:30 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Alexandre Belloni, kernel-janitors, linux-fbdev, dri-devel,
	Ludovic Desroches, Tomi Valkeinen,
	Jean-Christophe PLAGNIOL-VILLARD

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 <dan.carpenter@oracle.com>

Looks good to me: thanks Dan!

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

Best regards,
   Nicolas

> ---
>   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

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

end of thread, other threads:[~2021-12-03 13:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03  9:58 [PATCH] video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe() Dan Carpenter
2021-12-03  9:58 ` Dan Carpenter
2021-12-03 13:30 ` Nicolas Ferre
2021-12-03 13:30   ` Nicolas Ferre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.