[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220913073434.7252-1-tangbin@cmss.chinamobile.com>
Date: Tue, 13 Sep 2022 15:34:34 +0800
From: Tang Bin <tangbin@...s.chinamobile.com>
To: shawnguo@...nel.org, s.hauer@...gutronix.de, kernel@...gutronix.de,
festevam@...il.com, linux-imx@....com
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Tang Bin <tangbin@...s.chinamobile.com>
Subject: [PATCH] soc: imx: fix error check in imx8mp_blk_ctrl_probe()
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 <tangbin@...s.chinamobile.com>
---
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);
--
2.33.0
Powered by blists - more mailing lists