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>
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;
}
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;
}