projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5fac6c2
)
spi: stm32-ospi: Fix an IS_ERR() vs NULL bug in stm32_ospi_get_resources()
author
Dan Carpenter
<dan.carpenter@linaro.org>
Thu, 6 Mar 2025 09:48:34 +0000
(12:48 +0300)
committer
Mark Brown
<broonie@kernel.org>
Thu, 6 Mar 2025 13:27:16 +0000
(13:27 +0000)
The devm_ioremap() function returns NULL on error, it doesn't return
error pointers. Fix the check to match.
Fixes:
79b8a705e26c
("spi: stm32: Add OSPI driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Link:
https://patch.msgid.link/bc4c9123-df43-4616-962f-765801d30b4c@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-stm32-ospi.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/spi/spi-stm32-ospi.c
b/drivers/spi/spi-stm32-ospi.c
index 8eadcb64f34a2fcbcb3d94ad325e2587bbb1de4c..a544d7897edfa28962e43ada32724512aede1d29 100644
(file)
--- a/
drivers/spi/spi-stm32-ospi.c
+++ b/
drivers/spi/spi-stm32-ospi.c
@@
-835,10
+835,10
@@
static int stm32_ospi_get_resources(struct platform_device *pdev)
if (rmem) {
ospi->mm_size = rmem->size;
ospi->mm_base = devm_ioremap(dev, rmem->base, rmem->size);
- if (
IS_ERR(ospi->mm_base)
) {
+ if (
!ospi->mm_base
) {
dev_err(dev, "unable to map memory region: %pa+%pa\n",
&rmem->base, &rmem->size);
- ret =
PTR_ERR(ospi->mm_base)
;
+ ret =
-ENOMEM
;
goto err_dma;
}