drm/panel: nt36523: fix return value check in nt36523_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 29 Nov 2023 09:07:15 +0000 (17:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Dec 2023 07:52:24 +0000 (08:52 +0100)
[ 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>
drivers/gpu/drm/panel/panel-novatek-nt36523.c

index 9632b9e95b7159d2e852593bf82bf7e4f60d574e..c4a804c5d6aac2f2123307d07ed9d8bcf07626f7 100644 (file)
@@ -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]);
                }
        }