diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2023-11-29 12:07:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-08 10:52:24 +0300 |
commit | 684cf5d6aef1a8d5355cc23d3f0577513575833a (patch) | |
tree | ab6d4928a9ba2357421601fb60178baffa32a566 /drivers/gpu/drm/panel/panel-novatek-nt36523.c | |
parent | 7f4ea4035fce404433a48f248fdcada7725e77df (diff) | |
download | linux-684cf5d6aef1a8d5355cc23d3f0577513575833a.tar.xz |
drm/panel: nt36523: fix return value check in nt36523_probe()
[ Upstream commit fb18fe0fdf22a2f4512a8b644bb5ea1473829cda ]
mipi_dsi_device_register_full() never returns NULL pointer, it
will return ERR_PTR() when it fails, so replace the check with
IS_ERR().
Fixes: 0993234a0045 ("drm/panel: Add driver for Novatek NT36523")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231129090715.856263-1-yangyingliang@huaweicloud.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231129090715.856263-1-yangyingliang@huaweicloud.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/panel/panel-novatek-nt36523.c')
-rw-r--r-- | drivers/gpu/drm/panel/panel-novatek-nt36523.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36523.c b/drivers/gpu/drm/panel/panel-novatek-nt36523.c index 9632b9e95b71..c4a804c5d6aa 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt36523.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt36523.c @@ -1266,9 +1266,9 @@ static int nt36523_probe(struct mipi_dsi_device *dsi) return dev_err_probe(dev, -EPROBE_DEFER, "cannot get secondary DSI host\n"); pinfo->dsi[1] = mipi_dsi_device_register_full(dsi1_host, info); - if (!pinfo->dsi[1]) { + if (IS_ERR(pinfo->dsi[1])) { dev_err(dev, "cannot get secondary DSI device\n"); - return -ENODEV; + return PTR_ERR(pinfo->dsi[1]); } } |