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: 8181d061dc ("memory: Add STM32 Octo Memory Manager driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/a1645f1eedaa9b2ae62ac07feed0552eea75bc46.1746781081.git.dan.carpenter@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
This commit is contained in:
Dan Carpenter 2025-05-09 14:04:37 +03:00 committed by Krzysztof Kozlowski
parent d44eeb20d9
commit 0169a24036
1 changed files with 2 additions and 2 deletions

View File

@ -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) {