projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
575bec5
)
spi: fsl-spi: fix devm_ioremap_resource() error case
author
Christophe Leroy
<
[email protected]
>
Thu, 23 Apr 2015 12:11:47 +0000
(14:11 +0200)
committer
Mark Brown
<
[email protected]
>
Fri, 24 Apr 2015 12:27:53 +0000
(13:27 +0100)
devm_ioremap_resource() doesn't return NULL but an ERR_PTR on error.
Reported-by: Jonas Gorsky <
[email protected]
>
Signed-off-by: Christophe Leroy <
[email protected]
>
Signed-off-by: Mark Brown <
[email protected]
>
drivers/spi/spi-fsl-cpm.c
patch
|
blob
|
history
diff --git
a/drivers/spi/spi-fsl-cpm.c
b/drivers/spi/spi-fsl-cpm.c
index 6f466ab1201a3fd365822bea57e97df50885336a..896add8cfd3b6c6bba311a335072e63a4060a3a4 100644
(file)
--- a/
drivers/spi/spi-fsl-cpm.c
+++ b/
drivers/spi/spi-fsl-cpm.c
@@
-310,10
+310,15
@@
int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi)
if (mspi->flags & SPI_CPM1) {
struct resource *res;
+ void *pram;
res = platform_get_resource(to_platform_device(dev),
IORESOURCE_MEM, 1);
- mspi->pram = devm_ioremap_resource(dev, res);
+ pram = devm_ioremap_resource(dev, res);
+ if (IS_ERR(pram))
+ mspi->pram = NULL;
+ else
+ mspi->pram = pram;
} else {
unsigned long pram_ofs = fsl_spi_cpm_get_pram(mspi);