[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a1645f1eedaa9b2ae62ac07feed0552eea75bc46.1746781081.git.dan.carpenter@linaro.org>
Date: Fri, 9 May 2025 14:04:37 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Patrice Chotard <patrice.chotard@...s.st.com>
Cc: Krzysztof Kozlowski <krzk@...nel.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Christophe Kerello <christophe.kerello@...s.st.com>,
linux-kernel@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH 2/2] memory: stm32_omm: Fix NULL vs IS_ERR() check in probe()
The platform_get_resource_byname() function returns NULL on error. It
doesn't return error pointers. Update the check to match.
Fixes: 8181d061dcff ("memory: Add STM32 Octo Memory Manager driver")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
drivers/memory/stm32_omm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/memory/stm32_omm.c b/drivers/memory/stm32_omm.c
index fa0f75e4a6e8..c8de785401f2 100644
--- a/drivers/memory/stm32_omm.c
+++ b/drivers/memory/stm32_omm.c
@@ -320,8 +320,8 @@ static int stm32_omm_probe(struct platform_device *pdev)
return PTR_ERR(omm->io_base);
omm->mm_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory_map");
- if (IS_ERR(omm->mm_res))
- return PTR_ERR(omm->mm_res);
+ if (!omm->mm_res)
+ return -ENODEV;
/* check child's access */
for_each_child_of_node_scoped(dev->of_node, child) {
--
2.47.2
Powered by blists - more mailing lists