spi: stm32-ospi: Fix NULL vs IS_ERR() bug in stm32_ospi_get_resources()

This code was changed from using devm_ioremap() which returns NULL to
using devm_ioremap_resource() which returns error pointers.  Update
the error checking to match.

Fixes: defe01abfb ("spi: stm32-ospi: Use of_reserved_mem_region_to_resource() for "memory-region"")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/fb2a26a2-119b-4b5a-8d44-b29e2c736081@sabinyo.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Dan Carpenter 2025-07-15 18:01:39 -05:00 committed by Mark Brown
parent d929cc75e9
commit 951a6d8d41
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -823,9 +823,9 @@ static int stm32_ospi_get_resources(struct platform_device *pdev)
if (!ret) {
ospi->mm_size = resource_size(res);
ospi->mm_base = devm_ioremap_resource(dev, res);
if (!ospi->mm_base) {
if (IS_ERR(ospi->mm_base)) {
dev_err(dev, "unable to map memory region: %pR\n", res);
ret = -ENOMEM;
ret = PTR_ERR(ospi->mm_base);
goto err_dma;
}