From nobody Mon Apr 6 00:32:01 2026 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 0BC23C6FA82 for ; Tue, 13 Sep 2022 07:21:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbiIMHVy (ORCPT ); Tue, 13 Sep 2022 03:21:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbiIMHVr (ORCPT ); Tue, 13 Sep 2022 03:21:47 -0400 Received: from cmccmta2.chinamobile.com (cmccmta2.chinamobile.com [221.176.66.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 39FE258DD6 for ; Tue, 13 Sep 2022 00:21:44 -0700 (PDT) X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from spf.mail.chinamobile.com (unknown[172.16.121.1]) by rmmx-syy-dmz-app08-12008 (RichMail) with SMTP id 2ee863202f85593-3745f; Tue, 13 Sep 2022 15:21:43 +0800 (CST) X-RM-TRANSID: 2ee863202f85593-3745f X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.108.79.98]) by rmsmtp-syy-appsvr01-12001 (RichMail) with SMTP id 2ee163202f844cd-4e1df; Tue, 13 Sep 2022 15:21:43 +0800 (CST) X-RM-TRANSID: 2ee163202f844cd-4e1df 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: imx8m-blk-ctrl: Fix wrong check Date: Tue, 13 Sep 2022 15:21:55 +0800 Message-Id: <20220913072155.13392-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In the function imx8m_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: 2684ac05a8c4 ("soc: imx: add i.MX8M blk-ctrl driver") Signed-off-by: Tang Bin --- drivers/soc/imx/imx8m-blk-ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-c= trl.c index ccd0577a7..98a1f2151 100644 --- a/drivers/soc/imx/imx8m-blk-ctrl.c +++ b/drivers/soc/imx/imx8m-blk-ctrl.c @@ -235,10 +235,10 @@ static int imx8m_blk_ctrl_probe(struct platform_devic= e *pdev) =20 domain->power_dev =3D 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\n"); - ret =3D PTR_ERR(domain->power_dev); + ret =3D PTR_ERR(domain->power_dev) ? : -ENODATA; goto cleanup_pds; } =20 --=20 2.20.1.windows.1