From patchwork Tue Sep 13 07:34:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tang Bin X-Patchwork-Id: 12974506 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E19B8C6FA82 for ; Tue, 13 Sep 2022 07:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=53wld8hr302HIvzMKHw15rE2SroQylqkzBqZexab2YY=; b=eEL3MvHYquE4Pw nsIvyVpKdEQUU0/U4Ye7VwKfsIAWq8SwykqqdQ0xHSx4gPPqcV5YneUAkBtimDU9yuOleNhUga2Pq EjhsbZxmP4I3Hjr/q+4/jXtfW9bP32o+YnwSdN5eU5WImXyIc5mOiyhHKLYHuLo69SHy3eYQnZtp7 Nn0Jc+Z1jlrwuWSLc2ofS/uZJMkWu6B0+aIkdy6nxtuRqTCke4wCHUmM9/7WenQHQJBkVNVqeUbjS fTWC3FG3HPnGIWGxXMhb3e38asmE0Inq1wc9s5wqzlcahY/bcziBeZhqet4ZT+9HpKs137NtsZ62Y pfo2mPmr/HwcdOxSrVdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oY0RC-003c0f-Cw; Tue, 13 Sep 2022 07:34:30 +0000 Received: from cmccmta2.chinamobile.com ([221.176.66.80]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oY0Qv-003bvT-GF for linux-arm-kernel@lists.infradead.org; Tue, 13 Sep 2022 07:34:16 +0000 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from spf.mail.chinamobile.com (unknown[172.16.121.13]) by rmmx-syy-dmz-app07-12007 (RichMail) with SMTP id 2ee763203271369-36320; Tue, 13 Sep 2022 15:34:10 +0800 (CST) X-RM-TRANSID: 2ee763203271369-36320 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.108.79.98]) by rmsmtp-syy-appsvr07-12007 (RichMail) with SMTP id 2ee763203270ff5-51eb6; Tue, 13 Sep 2022 15:34:10 +0800 (CST) X-RM-TRANSID: 2ee763203270ff5-51eb6 From: Tang Bin To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tang Bin Subject: [PATCH] soc: imx: fix error check in imx8mp_blk_ctrl_probe() Date: Tue, 13 Sep 2022 15:34:34 +0800 Message-Id: <20220913073434.7252-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220913_003414_088430_2EED1001 X-CRM114-Status: GOOD ( 10.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In the function imx8mp_blk_ctrl_probe(), dev_pm_domain_attach_by_name() may return NULL in some cases, so IS_ERR() doesn't meet the requirements. Thus fix it. Fixes: 556f5cf9568a ("soc: imx: add i.MX8MP HSIO blk-ctrl") Signed-off-by: Tang Bin --- drivers/soc/imx/imx8mp-blk-ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/imx/imx8mp-blk-ctrl.c b/drivers/soc/imx/imx8mp-blk-ctrl.c index ccb30c6cd..ed8557eaf 100644 --- a/drivers/soc/imx/imx8mp-blk-ctrl.c +++ b/drivers/soc/imx/imx8mp-blk-ctrl.c @@ -597,11 +597,11 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev) domain->power_dev = dev_pm_domain_attach_by_name(dev, data->gpc_name); - if (IS_ERR(domain->power_dev)) { + if (IS_ERR_OR_NULL(domain->power_dev)) { dev_err_probe(dev, PTR_ERR(domain->power_dev), "failed to attach power domain %s\n", data->gpc_name); - ret = PTR_ERR(domain->power_dev); + ret = PTR_ERR(domain->power_dev) ? : -ENODATA; goto cleanup_pds; } dev_set_name(domain->power_dev, "%s", data->name);