* [PATCH,v2] drm/panel: Fix return value check in nt35950_probe()
@ 2022-03-17 8:37 ` Lu Wei
0 siblings, 0 replies; 5+ messages in thread
From: Lu Wei @ 2022-03-17 8:37 UTC (permalink / raw)
To: thierry.reding, sam, airlied, daniel, marijn.suijten,
angelogioacchino.delregno, dri-devel
Cc: linux-kernel
In function nt35950_probe(), mipi_dsi_device_register_full() is called
to create a MIPI DSI device. If it fails, a pointer encoded with an error
will be returned, so use IS_ERR() to check the return value. Besides, use
PTR_ERR to return the actual errno.
Fixes: 623a3531e9cf ("drm/panel: Add driver for Novatek NT35950 DSI DriverIC panels")
Signed-off-by: Lu Wei <luwei32@huawei.com>
---
drivers/gpu/drm/panel/panel-novatek-nt35950.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
index 288c7fa83ecc..d252e5e56228 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
@@ -579,9 +579,9 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
}
nt->dsi[1] = mipi_dsi_device_register_full(dsi_r_host, info);
- if (!nt->dsi[1]) {
+ if (IS_ERR(nt->dsi[1])) {
dev_err(dev, "Cannot get secondary DSI node\n");
- return -ENODEV;
+ return PTR_ERR(nt->dsi[1]);
}
num_dsis++;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH,v2] drm/panel: Fix return value check in nt35950_probe()
@ 2022-03-17 8:37 ` Lu Wei
0 siblings, 0 replies; 5+ messages in thread
From: Lu Wei @ 2022-03-17 8:37 UTC (permalink / raw)
To: thierry.reding, sam, airlied, daniel, marijn.suijten,
angelogioacchino.delregno, dri-devel
Cc: linux-kernel
In function nt35950_probe(), mipi_dsi_device_register_full() is called
to create a MIPI DSI device. If it fails, a pointer encoded with an error
will be returned, so use IS_ERR() to check the return value. Besides, use
PTR_ERR to return the actual errno.
Fixes: 623a3531e9cf ("drm/panel: Add driver for Novatek NT35950 DSI DriverIC panels")
Signed-off-by: Lu Wei <luwei32@huawei.com>
---
drivers/gpu/drm/panel/panel-novatek-nt35950.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
index 288c7fa83ecc..d252e5e56228 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
@@ -579,9 +579,9 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
}
nt->dsi[1] = mipi_dsi_device_register_full(dsi_r_host, info);
- if (!nt->dsi[1]) {
+ if (IS_ERR(nt->dsi[1])) {
dev_err(dev, "Cannot get secondary DSI node\n");
- return -ENODEV;
+ return PTR_ERR(nt->dsi[1]);
}
num_dsis++;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH,v2] drm/panel: Fix return value check in nt35950_probe()
2022-03-17 8:37 ` Lu Wei
(?)
@ 2022-03-17 9:13 ` AngeloGioacchino Del Regno
-1 siblings, 0 replies; 5+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-03-17 9:13 UTC (permalink / raw)
To: Lu Wei, thierry.reding, sam, airlied, daniel, marijn.suijten, dri-devel
Cc: linux-kernel
Il 17/03/22 09:37, Lu Wei ha scritto:
> In function nt35950_probe(), mipi_dsi_device_register_full() is called
> to create a MIPI DSI device. If it fails, a pointer encoded with an error
> will be returned, so use IS_ERR() to check the return value. Besides, use
> PTR_ERR to return the actual errno.
>
> Fixes: 623a3531e9cf ("drm/panel: Add driver for Novatek NT35950 DSI DriverIC panels")
> Signed-off-by: Lu Wei <luwei32@huawei.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Thanks!
> ---
> drivers/gpu/drm/panel/panel-novatek-nt35950.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
> index 288c7fa83ecc..d252e5e56228 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
> @@ -579,9 +579,9 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
> }
>
> nt->dsi[1] = mipi_dsi_device_register_full(dsi_r_host, info);
> - if (!nt->dsi[1]) {
> + if (IS_ERR(nt->dsi[1])) {
> dev_err(dev, "Cannot get secondary DSI node\n");
> - return -ENODEV;
> + return PTR_ERR(nt->dsi[1]);
> }
> num_dsis++;
> }
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH,v2] drm/panel: Fix return value check in nt35950_probe()
2022-03-17 8:37 ` Lu Wei
@ 2022-03-17 19:21 ` Sam Ravnborg
-1 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2022-03-17 19:21 UTC (permalink / raw)
To: Lu Wei
Cc: thierry.reding, airlied, daniel, marijn.suijten,
angelogioacchino.delregno, dri-devel, linux-kernel
On Thu, Mar 17, 2022 at 04:37:07PM +0800, Lu Wei wrote:
> In function nt35950_probe(), mipi_dsi_device_register_full() is called
> to create a MIPI DSI device. If it fails, a pointer encoded with an error
> will be returned, so use IS_ERR() to check the return value. Besides, use
> PTR_ERR to return the actual errno.
>
> Fixes: 623a3531e9cf ("drm/panel: Add driver for Novatek NT35950 DSI DriverIC panels")
> Signed-off-by: Lu Wei <luwei32@huawei.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH,v2] drm/panel: Fix return value check in nt35950_probe()
@ 2022-03-17 19:21 ` Sam Ravnborg
0 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2022-03-17 19:21 UTC (permalink / raw)
To: Lu Wei
Cc: airlied, linux-kernel, dri-devel, thierry.reding,
angelogioacchino.delregno, marijn.suijten
On Thu, Mar 17, 2022 at 04:37:07PM +0800, Lu Wei wrote:
> In function nt35950_probe(), mipi_dsi_device_register_full() is called
> to create a MIPI DSI device. If it fails, a pointer encoded with an error
> will be returned, so use IS_ERR() to check the return value. Besides, use
> PTR_ERR to return the actual errno.
>
> Fixes: 623a3531e9cf ("drm/panel: Add driver for Novatek NT35950 DSI DriverIC panels")
> Signed-off-by: Lu Wei <luwei32@huawei.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-03-17 19:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-17 8:37 [PATCH,v2] drm/panel: Fix return value check in nt35950_probe() Lu Wei
2022-03-17 8:37 ` Lu Wei
2022-03-17 9:13 ` AngeloGioacchino Del Regno
2022-03-17 19:21 ` Sam Ravnborg
2022-03-17 19:21 ` Sam Ravnborg
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.