@@ -1213,8 +1213,9 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
regs_offset = pdata->regs_offset;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (r == NULL) {
- status = -ENODEV;
+ mcspi->base = devm_ioremap_resource(&pdev->dev, r);
+ if (IS_ERR(mcspi->base)) {
+ status = PTR_ERR(mcspi->base);
goto free_master;
}
@@ -1222,12 +1223,6 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
r->end += regs_offset;
mcspi->phys = r->start;
- mcspi->base = devm_ioremap_resource(&pdev->dev, r);
- if (IS_ERR(mcspi->base)) {
- status = PTR_ERR(mcspi->base);
- goto free_master;
- }
-
mcspi->dev = &pdev->dev;
INIT_LIST_HEAD(&mcspi->ctx.cs);
Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram <varkab@cdac.in> --- drivers/spi/spi-omap2-mcspi.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)