Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/panel: novatek-nt35950: fix return value check in nt35950_probe()

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

authored by

Yang Yingliang and committed by
Neil Armstrong
f8fd0968 e1e1af91

+2 -2
+2 -2
drivers/gpu/drm/panel/panel-novatek-nt35950.c
··· 481 481 return dev_err_probe(dev, -EPROBE_DEFER, "Cannot get secondary DSI host\n"); 482 482 483 483 nt->dsi[1] = mipi_dsi_device_register_full(dsi_r_host, info); 484 - if (!nt->dsi[1]) { 484 + if (IS_ERR(nt->dsi[1])) { 485 485 dev_err(dev, "Cannot get secondary DSI node\n"); 486 - return -ENODEV; 486 + return PTR_ERR(nt->dsi[1]); 487 487 } 488 488 num_dsis++; 489 489 }