All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] drm/mcde: dsi: Fix return value check in dev_err()
@ 2020-04-28 14:14 ` Wei Yongjun
  0 siblings, 0 replies; 15+ messages in thread
From: Wei Yongjun @ 2020-04-28 14:14 UTC (permalink / raw)
  To: Linus Walleij, David Airlie, Daniel Vetter
  Cc: Wei Yongjun, dri-devel, linux-kernel, kernel-janitors

In case of error, the function of_drm_find_bridge() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/gpu/drm/mcde/mcde_dsi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
index 7af5ebb0c436..e705afc08c4e 100644
--- a/drivers/gpu/drm/mcde/mcde_dsi.c
+++ b/drivers/gpu/drm/mcde/mcde_dsi.c
@@ -1073,10 +1073,9 @@ static int mcde_dsi_bind(struct device *dev, struct device *master,
 			panel = NULL;
 
 			bridge = of_drm_find_bridge(child);
-			if (IS_ERR(bridge)) {
-				dev_err(dev, "failed to find bridge (%ld)\n",
-					PTR_ERR(bridge));
-				return PTR_ERR(bridge);
+			if (!bridge) {
+				dev_err(dev, "failed to find bridge\n");
+				return -EINVAL;
 			}
 		}
 	}






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

* [PATCH -next] drm/mcde: dsi: Fix return value check in dev_err()
@ 2020-04-28 14:14 ` Wei Yongjun
  0 siblings, 0 replies; 15+ messages in thread
From: Wei Yongjun @ 2020-04-28 14:14 UTC (permalink / raw)
  To: Linus Walleij, David Airlie, Daniel Vetter
  Cc: kernel-janitors, Wei Yongjun, linux-kernel, dri-devel

In case of error, the function of_drm_find_bridge() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/gpu/drm/mcde/mcde_dsi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
index 7af5ebb0c436..e705afc08c4e 100644
--- a/drivers/gpu/drm/mcde/mcde_dsi.c
+++ b/drivers/gpu/drm/mcde/mcde_dsi.c
@@ -1073,10 +1073,9 @@ static int mcde_dsi_bind(struct device *dev, struct device *master,
 			panel = NULL;
 
 			bridge = of_drm_find_bridge(child);
-			if (IS_ERR(bridge)) {
-				dev_err(dev, "failed to find bridge (%ld)\n",
-					PTR_ERR(bridge));
-				return PTR_ERR(bridge);
+			if (!bridge) {
+				dev_err(dev, "failed to find bridge\n");
+				return -EINVAL;
 			}
 		}
 	}

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

* [PATCH -next] drm/mcde: dsi: Fix return value check in dev_err()
@ 2020-04-28 14:14 ` Wei Yongjun
  0 siblings, 0 replies; 15+ messages in thread
From: Wei Yongjun @ 2020-04-28 14:14 UTC (permalink / raw)
  To: Linus Walleij, David Airlie, Daniel Vetter
  Cc: kernel-janitors, Wei Yongjun, linux-kernel, dri-devel

In case of error, the function of_drm_find_bridge() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/gpu/drm/mcde/mcde_dsi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
index 7af5ebb0c436..e705afc08c4e 100644
--- a/drivers/gpu/drm/mcde/mcde_dsi.c
+++ b/drivers/gpu/drm/mcde/mcde_dsi.c
@@ -1073,10 +1073,9 @@ static int mcde_dsi_bind(struct device *dev, struct device *master,
 			panel = NULL;
 
 			bridge = of_drm_find_bridge(child);
-			if (IS_ERR(bridge)) {
-				dev_err(dev, "failed to find bridge (%ld)\n",
-					PTR_ERR(bridge));
-				return PTR_ERR(bridge);
+			if (!bridge) {
+				dev_err(dev, "failed to find bridge\n");
+				return -EINVAL;
 			}
 		}
 	}





_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH -next v2] drm/mcde: dsi: Fix return value check in mcde_dsi_bind()
  2020-04-28 14:14 ` Wei Yongjun
  (?)
@ 2020-04-30  7:31   ` Wei Yongjun
  -1 siblings, 0 replies; 15+ messages in thread
From: Wei Yongjun @ 2020-04-30  7:31 UTC (permalink / raw)
  To: Linus Walleij, David Airlie, Daniel Vetter
  Cc: Wei Yongjun, dri-devel, linux-kernel, kernel-janitors

The of_drm_find_bridge() function returns NULL on error, it doesn't return
error pointers so this check doesn't work.

Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
v1 - > v2: add fixes and fix the subject
---
 drivers/gpu/drm/mcde/mcde_dsi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
index 7af5ebb0c436..e705afc08c4e 100644
--- a/drivers/gpu/drm/mcde/mcde_dsi.c
+++ b/drivers/gpu/drm/mcde/mcde_dsi.c
@@ -1073,10 +1073,9 @@ static int mcde_dsi_bind(struct device *dev, struct device *master,
 			panel = NULL;
 
 			bridge = of_drm_find_bridge(child);
-			if (IS_ERR(bridge)) {
-				dev_err(dev, "failed to find bridge (%ld)\n",
-					PTR_ERR(bridge));
-				return PTR_ERR(bridge);
+			if (!bridge) {
+				dev_err(dev, "failed to find bridge\n");
+				return -EINVAL;
 			}
 		}
 	}




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

* [PATCH -next v2] drm/mcde: dsi: Fix return value check in mcde_dsi_bind()
@ 2020-04-30  7:31   ` Wei Yongjun
  0 siblings, 0 replies; 15+ messages in thread
From: Wei Yongjun @ 2020-04-30  7:31 UTC (permalink / raw)
  To: Linus Walleij, David Airlie, Daniel Vetter
  Cc: kernel-janitors, Wei Yongjun, linux-kernel, dri-devel

The of_drm_find_bridge() function returns NULL on error, it doesn't return
error pointers so this check doesn't work.

Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
v1 - > v2: add fixes and fix the subject
---
 drivers/gpu/drm/mcde/mcde_dsi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
index 7af5ebb0c436..e705afc08c4e 100644
--- a/drivers/gpu/drm/mcde/mcde_dsi.c
+++ b/drivers/gpu/drm/mcde/mcde_dsi.c
@@ -1073,10 +1073,9 @@ static int mcde_dsi_bind(struct device *dev, struct device *master,
 			panel = NULL;
 
 			bridge = of_drm_find_bridge(child);
-			if (IS_ERR(bridge)) {
-				dev_err(dev, "failed to find bridge (%ld)\n",
-					PTR_ERR(bridge));
-				return PTR_ERR(bridge);
+			if (!bridge) {
+				dev_err(dev, "failed to find bridge\n");
+				return -EINVAL;
 			}
 		}
 	}

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

* [PATCH -next v2] drm/mcde: dsi: Fix return value check in mcde_dsi_bind()
@ 2020-04-30  7:31   ` Wei Yongjun
  0 siblings, 0 replies; 15+ messages in thread
From: Wei Yongjun @ 2020-04-30  7:31 UTC (permalink / raw)
  To: Linus Walleij, David Airlie, Daniel Vetter
  Cc: kernel-janitors, Wei Yongjun, linux-kernel, dri-devel

The of_drm_find_bridge() function returns NULL on error, it doesn't return
error pointers so this check doesn't work.

Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
v1 - > v2: add fixes and fix the subject
---
 drivers/gpu/drm/mcde/mcde_dsi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
index 7af5ebb0c436..e705afc08c4e 100644
--- a/drivers/gpu/drm/mcde/mcde_dsi.c
+++ b/drivers/gpu/drm/mcde/mcde_dsi.c
@@ -1073,10 +1073,9 @@ static int mcde_dsi_bind(struct device *dev, struct device *master,
 			panel = NULL;
 
 			bridge = of_drm_find_bridge(child);
-			if (IS_ERR(bridge)) {
-				dev_err(dev, "failed to find bridge (%ld)\n",
-					PTR_ERR(bridge));
-				return PTR_ERR(bridge);
+			if (!bridge) {
+				dev_err(dev, "failed to find bridge\n");
+				return -EINVAL;
 			}
 		}
 	}



_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH -next] drm/mcde: dsi: Fix return value check in dev_err()
  2020-04-28 14:14 ` Wei Yongjun
  (?)
@ 2020-05-12 11:49   ` Linus Walleij
  -1 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2020-05-12 11:49 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: David Airlie, Daniel Vetter, open list:DRM PANEL DRIVERS,
	linux-kernel, kernel-janitors

On Tue, Apr 28, 2020 at 4:13 PM Wei Yongjun <weiyongjun1@huawei.com> wrote:

> In case of error, the function of_drm_find_bridge() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Patch applied! Thanks Wei, sorry for the long delay.

Yours,
Linus Walleij

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

* Re: [PATCH -next] drm/mcde: dsi: Fix return value check in dev_err()
@ 2020-05-12 11:49   ` Linus Walleij
  0 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2020-05-12 11:49 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: David Airlie, kernel-janitors, open list:DRM PANEL DRIVERS, linux-kernel

On Tue, Apr 28, 2020 at 4:13 PM Wei Yongjun <weiyongjun1@huawei.com> wrote:

> In case of error, the function of_drm_find_bridge() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Patch applied! Thanks Wei, sorry for the long delay.

Yours,
Linus Walleij

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

* Re: [PATCH -next] drm/mcde: dsi: Fix return value check in dev_err()
@ 2020-05-12 11:49   ` Linus Walleij
  0 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2020-05-12 11:49 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: David Airlie, kernel-janitors, open list:DRM PANEL DRIVERS, linux-kernel

On Tue, Apr 28, 2020 at 4:13 PM Wei Yongjun <weiyongjun1@huawei.com> wrote:

> In case of error, the function of_drm_find_bridge() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Patch applied! Thanks Wei, sorry for the long delay.

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH -next v2] drm/mcde: dsi: Fix return value check in mcde_dsi_bind()
  2020-04-30  7:31   ` Wei Yongjun
  (?)
@ 2020-05-12 12:04     ` Linus Walleij
  -1 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2020-05-12 12:04 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: David Airlie, Daniel Vetter, open list:DRM PANEL DRIVERS,
	linux-kernel, kernel-janitors

On Thu, Apr 30, 2020 at 9:30 AM Wei Yongjun <weiyongjun1@huawei.com> wrote:

> The of_drm_find_bridge() function returns NULL on error, it doesn't return
> error pointers so this check doesn't work.
>
> Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> v1 - > v2: add fixes and fix the subject

Already applied v1, no big deal anyways, its a nonurgent fix.

Yours,
Linus Walleij

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

* Re: [PATCH -next v2] drm/mcde: dsi: Fix return value check in mcde_dsi_bind()
@ 2020-05-12 12:04     ` Linus Walleij
  0 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2020-05-12 12:04 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: David Airlie, kernel-janitors, open list:DRM PANEL DRIVERS, linux-kernel

On Thu, Apr 30, 2020 at 9:30 AM Wei Yongjun <weiyongjun1@huawei.com> wrote:

> The of_drm_find_bridge() function returns NULL on error, it doesn't return
> error pointers so this check doesn't work.
>
> Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> v1 - > v2: add fixes and fix the subject

Already applied v1, no big deal anyways, its a nonurgent fix.

Yours,
Linus Walleij

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

* Re: [PATCH -next v2] drm/mcde: dsi: Fix return value check in mcde_dsi_bind()
@ 2020-05-12 12:04     ` Linus Walleij
  0 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2020-05-12 12:04 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: David Airlie, kernel-janitors, open list:DRM PANEL DRIVERS, linux-kernel

On Thu, Apr 30, 2020 at 9:30 AM Wei Yongjun <weiyongjun1@huawei.com> wrote:

> The of_drm_find_bridge() function returns NULL on error, it doesn't return
> error pointers so this check doesn't work.
>
> Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> v1 - > v2: add fixes and fix the subject

Already applied v1, no big deal anyways, its a nonurgent fix.

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH -next] drm/mcde: dsi: Fix return value check in dev_err()
  2020-05-12 11:49   ` Linus Walleij
  (?)
@ 2020-05-12 13:01     ` Emil Velikov
  -1 siblings, 0 replies; 15+ messages in thread
From: Emil Velikov @ 2020-05-12 13:01 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Wei Yongjun, David Airlie, kernel-janitors,
	open list:DRM PANEL DRIVERS, linux-kernel

Hi all,

On Tue, 12 May 2020 at 12:49, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Tue, Apr 28, 2020 at 4:13 PM Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> > In case of error, the function of_drm_find_bridge() returns NULL pointer
> > not ERR_PTR(). The IS_ERR() test in the return value check should be
> > replaced with NULL test.
> >
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>
> Patch applied! Thanks Wei, sorry for the long delay.
>
It would be nice if of_drm_find_bridge and of_drm_find_panel were
consistent - either return NULL or an ERR_PTR.
Otherwise the next person using them is likely to get it wrong.

-Emil

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

* Re: [PATCH -next] drm/mcde: dsi: Fix return value check in dev_err()
@ 2020-05-12 13:01     ` Emil Velikov
  0 siblings, 0 replies; 15+ messages in thread
From: Emil Velikov @ 2020-05-12 13:01 UTC (permalink / raw)
  To: Linus Walleij
  Cc: David Airlie, kernel-janitors, Wei Yongjun, linux-kernel,
	open list:DRM PANEL DRIVERS

Hi all,

On Tue, 12 May 2020 at 12:49, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Tue, Apr 28, 2020 at 4:13 PM Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> > In case of error, the function of_drm_find_bridge() returns NULL pointer
> > not ERR_PTR(). The IS_ERR() test in the return value check should be
> > replaced with NULL test.
> >
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>
> Patch applied! Thanks Wei, sorry for the long delay.
>
It would be nice if of_drm_find_bridge and of_drm_find_panel were
consistent - either return NULL or an ERR_PTR.
Otherwise the next person using them is likely to get it wrong.

-Emil

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

* Re: [PATCH -next] drm/mcde: dsi: Fix return value check in dev_err()
@ 2020-05-12 13:01     ` Emil Velikov
  0 siblings, 0 replies; 15+ messages in thread
From: Emil Velikov @ 2020-05-12 13:01 UTC (permalink / raw)
  To: Linus Walleij
  Cc: David Airlie, kernel-janitors, Wei Yongjun, linux-kernel,
	open list:DRM PANEL DRIVERS

Hi all,

On Tue, 12 May 2020 at 12:49, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Tue, Apr 28, 2020 at 4:13 PM Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> > In case of error, the function of_drm_find_bridge() returns NULL pointer
> > not ERR_PTR(). The IS_ERR() test in the return value check should be
> > replaced with NULL test.
> >
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>
> Patch applied! Thanks Wei, sorry for the long delay.
>
It would be nice if of_drm_find_bridge and of_drm_find_panel were
consistent - either return NULL or an ERR_PTR.
Otherwise the next person using them is likely to get it wrong.

-Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2020-05-12 13:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 14:14 [PATCH -next] drm/mcde: dsi: Fix return value check in dev_err() Wei Yongjun
2020-04-28 14:14 ` Wei Yongjun
2020-04-28 14:14 ` Wei Yongjun
2020-04-30  7:31 ` [PATCH -next v2] drm/mcde: dsi: Fix return value check in mcde_dsi_bind() Wei Yongjun
2020-04-30  7:31   ` Wei Yongjun
2020-04-30  7:31   ` Wei Yongjun
2020-05-12 12:04   ` Linus Walleij
2020-05-12 12:04     ` Linus Walleij
2020-05-12 12:04     ` Linus Walleij
2020-05-12 11:49 ` [PATCH -next] drm/mcde: dsi: Fix return value check in dev_err() Linus Walleij
2020-05-12 11:49   ` Linus Walleij
2020-05-12 11:49   ` Linus Walleij
2020-05-12 13:01   ` Emil Velikov
2020-05-12 13:01     ` Emil Velikov
2020-05-12 13:01     ` Emil Velikov

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.