* [PATCH] soc: imx: imx8m-blk-ctrl: Fix wrong check
@ 2022-09-13 7:21 Tang Bin
2022-09-13 7:40 ` Russell King (Oracle)
0 siblings, 1 reply; 2+ messages in thread
From: Tang Bin @ 2022-09-13 7:21 UTC (permalink / raw)
To: shawnguo, s.hauer, kernel, festevam, linux-imx
Cc: linux-arm-kernel, linux-kernel, Tang Bin
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 <tangbin@cmss.chinamobile.com>
---
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-ctrl.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_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\n");
- ret = PTR_ERR(domain->power_dev);
+ ret = PTR_ERR(domain->power_dev) ? : -ENODATA;
goto cleanup_pds;
}
--
2.20.1.windows.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] soc: imx: imx8m-blk-ctrl: Fix wrong check
2022-09-13 7:21 [PATCH] soc: imx: imx8m-blk-ctrl: Fix wrong check Tang Bin
@ 2022-09-13 7:40 ` Russell King (Oracle)
0 siblings, 0 replies; 2+ messages in thread
From: Russell King (Oracle) @ 2022-09-13 7:40 UTC (permalink / raw)
To: Tang Bin
Cc: shawnguo, s.hauer, kernel, festevam, linux-imx, linux-arm-kernel,
linux-kernel
On Tue, Sep 13, 2022 at 03:21:55PM +0800, Tang Bin wrote:
> 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 <tangbin@cmss.chinamobile.com>
Duplicate of a later patch. See comments on later patch for why this is
potentially wrong.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-13 7:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-13 7:21 [PATCH] soc: imx: imx8m-blk-ctrl: Fix wrong check Tang Bin
2022-09-13 7:40 ` Russell King (Oracle)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).