From patchwork Wed Nov 29 09:07:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 13472552 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55082C4167B for ; Wed, 29 Nov 2023 09:34:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FCD110E3B2; Wed, 29 Nov 2023 09:34:18 +0000 (UTC) X-Greylist: delayed 919 seconds by postgrey-1.36 at gabe; Wed, 29 Nov 2023 09:18:33 UTC Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5596010E392 for ; Wed, 29 Nov 2023 09:18:33 +0000 (UTC) Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4SgCyx5hCJz4f3kk7 for ; Wed, 29 Nov 2023 17:03:05 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id A87B31A0D9D for ; Wed, 29 Nov 2023 17:03:08 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.103.91]) by APP1 (Coremail) with SMTP id cCh0CgDnNw5I_mZlCIsBCQ--.34087S4; Wed, 29 Nov 2023 17:03:08 +0800 (CST) From: Yang Yingliang To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/panel: nt36523: fix return value check in nt36523_probe() Date: Wed, 29 Nov 2023 17:07:15 +0800 Message-Id: <20231129090715.856263-1-yangyingliang@huaweicloud.com> X-Mailer: git-send-email 2.25.1 MIME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FyTuYvjxUzeOJUUUUU X-CM-SenderInfo: 51dqw5xlqjzxhdqjqx5xdzvxpfor3voofrz/ X-Mailman-Approved-At: Wed, 29 Nov 2023 09:34:16 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: neil.armstrong@linaro.org, mripard@kernel.org, lujianhua000@gmail.com, tzimmermann@suse.de, yangyingliang@huawei.com, quic_jesszhan@quicinc.com, sam@ravnborg.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Yang Yingliang 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 Reviewed-by: Neil Armstrong --- drivers/gpu/drm/panel/panel-novatek-nt36523.c | 4 ++-- 1 file 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 9b9a7eb1bc60..a189ce236328 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt36523.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt36523.c @@ -1254,9 +1254,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]); } }