spi: fsl-(e)spi: Fix checking return value of devm_ioremap_resource
authorAxel Lin <axel.lin@ingics.com>
Sun, 30 Aug 2015 10:35:51 +0000 (18:35 +0800)
committerMark Brown <broonie@kernel.org>
Sun, 30 Aug 2015 11:14:36 +0000 (12:14 +0100)
devm_ioremap_resource() returns ERR_PTR on error.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-espi.c
drivers/spi/spi-fsl-spi.c

index db82c872c0f9b9ff6f952b5c6e54919f5697ef35..c27124a5ec8ee02264df2feaf283fdbb92991cf3 100644 (file)
@@ -674,8 +674,8 @@ static struct spi_master * fsl_espi_probe(struct device *dev,
        mpc8xxx_spi = spi_master_get_devdata(master);
 
        mpc8xxx_spi->reg_base = devm_ioremap_resource(dev, mem);
-       if (!mpc8xxx_spi->reg_base) {
-               ret = -ENOMEM;
+       if (IS_ERR(mpc8xxx_spi->reg_base)) {
+               ret = PTR_ERR(mpc8xxx_spi->reg_base);
                goto err_probe;
        }
 
index 17a9a879dcce5480a642763e35d442e2ff8bfa65..8b290d9d7935044640da36688e82fd01e90bf114 100644 (file)
@@ -633,8 +633,8 @@ static struct spi_master * fsl_spi_probe(struct device *dev,
                goto err_cpm_init;
 
        mpc8xxx_spi->reg_base = devm_ioremap_resource(dev, mem);
-       if (mpc8xxx_spi->reg_base == NULL) {
-               ret = -ENOMEM;
+       if (IS_ERR(mpc8xxx_spi->reg_base)) {
+               ret = PTR_ERR(mpc8xxx_spi->reg_base);
                goto err_probe;
        }