spi/bcm63xx: use devm_ioremap_resource()
authorJonas Gorski <jogo@openwrt.org>
Mon, 11 Mar 2013 23:13:47 +0000 (00:13 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 12 Mar 2013 19:14:48 +0000 (19:14 +0000)
Use devm_ioremap_resource() which provides its own error messages.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/spi/spi-bcm63xx.c

index 2d64db4ac6a2aaac16991e2a3f112dd1dd43999e..973099bd760da108cd8c98780ab8db81719d3c41 100644 (file)
@@ -412,18 +412,9 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, master);
        bs->pdev = pdev;
 
-       if (!devm_request_mem_region(&pdev->dev, r->start,
-                                       resource_size(r), PFX)) {
-               dev_err(dev, "iomem request failed\n");
-               ret = -ENXIO;
-               goto out_err;
-       }
-
-       bs->regs = devm_ioremap_nocache(&pdev->dev, r->start,
-                                                       resource_size(r));
-       if (!bs->regs) {
-               dev_err(dev, "unable to ioremap regs\n");
-               ret = -ENOMEM;
+       bs->regs = devm_ioremap_resource(&pdev->dev, r);
+       if (IS_ERR(bs->regs)) {
+               ret = PTR_ERR(bs->regs);
                goto out_err;
        }