* [PATCH -next] soc: loongson: Fix an IS_ERR() vs NULL bug in loongson2_guts_probe()
@ 2022-11-16 0:51 Peng Wu
0 siblings, 0 replies; only message in thread
From: Peng Wu @ 2022-11-16 0:51 UTC (permalink / raw)
To: zhuyinbo, arnd, loongarch; +Cc: linux-kernel, liwei391, Peng Wu
The ioremap() function returns NULL on error, it doesn't return
error pointers.
Fixes: b82621ac8450 ("soc: loongson: add GUTS driver for loongson-2 platforms")
Signed-off-by: Peng Wu <wupeng58@huawei.com>
---
drivers/soc/loongson/loongson2_guts.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/loongson/loongson2_guts.c b/drivers/soc/loongson/loongson2_guts.c
index bace4bc8e03b..52c222b1e6ef 100644
--- a/drivers/soc/loongson/loongson2_guts.c
+++ b/drivers/soc/loongson/loongson2_guts.c
@@ -108,8 +108,8 @@ static int loongson2_guts_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
guts->regs = ioremap(res->start, res->end - res->start + 1);
- if (IS_ERR(guts->regs))
- return PTR_ERR(guts->regs);
+ if (!guts->regs)
+ return -ENOMEM;
/* Register soc device */
root = of_find_node_by_path("/");
--
2.17.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-16 0:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 0:51 [PATCH -next] soc: loongson: Fix an IS_ERR() vs NULL bug in loongson2_guts_probe() Peng Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®