]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/panel: novatek-nt35950: fix return value check in nt35950_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 29 Oct 2024 12:39:57 +0000 (20:39 +0800)
committerNeil Armstrong <neil.armstrong@linaro.org>
Fri, 13 Dec 2024 09:51:39 +0000 (10:51 +0100)
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: 623a3531e9cf ("drm/panel: Add driver for Novatek NT35950 DSI DriverIC panels")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20241029123957.1588-1-yangyingliang@huaweicloud.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241029123957.1588-1-yangyingliang@huaweicloud.com
drivers/gpu/drm/panel/panel-novatek-nt35950.c

index b036208f93560ee652b7f3625a417e138ead4afb..08b22b592ab0452973aa7373dd0692a9bf98e5f2 100644 (file)
@@ -481,9 +481,9 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
                        return dev_err_probe(dev, -EPROBE_DEFER, "Cannot get secondary DSI host\n");
 
                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++;
        }