Skip to content

Commit 951a6d8

Browse files
Dan Carpenterbroonie
authored andcommitted
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: defe01a ("spi: stm32-ospi: Use of_reserved_mem_region_to_resource() for "memory-region"") Signed-off-by: Dan Carpenter <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d929cc7 commit 951a6d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi-stm32-ospi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,9 +823,9 @@ static int stm32_ospi_get_resources(struct platform_device *pdev)
823823
if (!ret) {
824824
ospi->mm_size = resource_size(res);
825825
ospi->mm_base = devm_ioremap_resource(dev, res);
826-
if (!ospi->mm_base) {
826+
if (IS_ERR(ospi->mm_base)) {
827827
dev_err(dev, "unable to map memory region: %pR\n", res);
828-
ret = -ENOMEM;
828+
ret = PTR_ERR(ospi->mm_base);
829829
goto err_dma;
830830
}
831831

0 commit comments

Comments
 (0)