diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2015-04-23 08:11:47 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-04-24 08:27:53 -0400 |
commit | 73ee39a4c944a11cfd6d43ba1f634da340bf5537 (patch) | |
tree | a3e0901686cbc8f4a8e326b81c3230b2f6e3747b /drivers/spi | |
parent | 575bec53181526ed01c0936ec008e1b70f8f5f31 (diff) |
spi: fsl-spi: fix devm_ioremap_resource() error case
devm_ioremap_resource() doesn't return NULL but an ERR_PTR on error.
Reported-by: Jonas Gorsky <jogo@openwrt.org>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-fsl-cpm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-cpm.c b/drivers/spi/spi-fsl-cpm.c index 6f466ab1201a..896add8cfd3b 100644 --- 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) | |||
310 | 310 | ||
311 | if (mspi->flags & SPI_CPM1) { | 311 | if (mspi->flags & SPI_CPM1) { |
312 | struct resource *res; | 312 | struct resource *res; |
313 | void *pram; | ||
313 | 314 | ||
314 | res = platform_get_resource(to_platform_device(dev), | 315 | res = platform_get_resource(to_platform_device(dev), |
315 | IORESOURCE_MEM, 1); | 316 | IORESOURCE_MEM, 1); |
316 | mspi->pram = devm_ioremap_resource(dev, res); | 317 | pram = devm_ioremap_resource(dev, res); |
318 | if (IS_ERR(pram)) | ||
319 | mspi->pram = NULL; | ||
320 | else | ||
321 | mspi->pram = pram; | ||
317 | } else { | 322 | } else { |
318 | unsigned long pram_ofs = fsl_spi_cpm_get_pram(mspi); | 323 | unsigned long pram_ofs = fsl_spi_cpm_get_pram(mspi); |
319 | 324 | ||