From patchwork Mon Jul 17 01:47:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaosheng Cui X-Patchwork-Id: 703780 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ACC4C001B0 for ; Mon, 17 Jul 2023 01:47:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230239AbjGQBrv (ORCPT ); Sun, 16 Jul 2023 21:47:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230220AbjGQBru (ORCPT ); Sun, 16 Jul 2023 21:47:50 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44558E5C for ; Sun, 16 Jul 2023 18:47:43 -0700 (PDT) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R44dJ61mjztRBx; Mon, 17 Jul 2023 09:44:36 +0800 (CST) Received: from cgs.huawei.com (10.244.148.83) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 17 Jul 2023 09:47:40 +0800 From: Gaosheng Cui To: , , , , , , , , , , , , , , , CC: , , Subject: [PATCH v4 1/3] drm/panel: Fix IS_ERR() vs NULL check in nt35950_probe() Date: Mon, 17 Jul 2023 09:47:37 +0800 Message-ID: <20230717014739.2952665-2-cuigaosheng1@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230717014739.2952665-1-cuigaosheng1@huawei.com> References: <20230717014739.2952665-1-cuigaosheng1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.244.148.83] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The mipi_dsi_device_register_full() returns an ERR_PTR() on failure, we should use IS_ERR() to check the return value. By the way, use dev_err_probe instead of dev_err to print the error code. Fixes: 623a3531e9cf ("drm/panel: Add driver for Novatek NT35950 DSI DriverIC panels") Signed-off-by: Gaosheng Cui --- drivers/gpu/drm/panel/panel-novatek-nt35950.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/drm/panel/panel-novatek-nt35950.c index 8b108ac80b55..2731ce02ce53 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c @@ -571,8 +571,8 @@ static int nt35950_probe(struct mipi_dsi_device *dsi) } nt->dsi[1] = mipi_dsi_device_register_full(dsi_r_host, info); - if (!nt->dsi[1]) { - dev_err(dev, "Cannot get secondary DSI node\n"); + if (IS_ERR(nt->dsi[1])) { + dev_err_probe(dev, PTR_ERR(nt->dsi[1]), "Cannot get secondary DSI node\n"); return -ENODEV; } num_dsis++;