]> git.karo-electronics.de Git - linux-beck.git/commitdiff
MIPS: Convert to devm_ioremap_resource()
authorThierry Reding <thierry.reding@avionic-design.de>
Mon, 21 Jan 2013 10:08:56 +0000 (11:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Jan 2013 20:21:45 +0000 (12:21 -0800)
Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/lantiq/xway/dma.c
arch/mips/lantiq/xway/gptu.c
arch/mips/pci/pci-lantiq.c

index e44a1866653f10fa258df13b3656aa20750002f0..08f7ebd9c7746c5643c9335a4e25d3a19603146f 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 
 #include <lantiq_soc.h>
 #include <xway_dma.h>
@@ -223,8 +224,8 @@ ltq_dma_init(struct platform_device *pdev)
                panic("Failed to get dma resource");
 
        /* remap dma register range */
-       ltq_dma_membase = devm_request_and_ioremap(&pdev->dev, res);
-       if (!ltq_dma_membase)
+       ltq_dma_membase = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(ltq_dma_membase))
                panic("Failed to remap dma resource");
 
        /* power up and reset the dma engine */
index e30b1ed1b93633cfc2b63201f24d85a06c212cae..9861c8669fab4047da01ad6af587ef948817d169 100644 (file)
@@ -150,11 +150,9 @@ static int gptu_probe(struct platform_device *pdev)
        }
 
        /* remap gptu register range */
-       gptu_membase = devm_request_and_ioremap(&pdev->dev, res);
-       if (!gptu_membase) {
-               dev_err(&pdev->dev, "Failed to remap resource\n");
-               return -ENOMEM;
-       }
+       gptu_membase = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(gptu_membase))
+               return PTR_ERR(gptu_membase);
 
        /* enable our clock */
        clk = clk_get(&pdev->dev, NULL);
index 95681789b51e44978c5725701e889abf28da1b00..910fb4c20b9e788266077190d3475d47b6eeb450 100644 (file)
@@ -214,13 +214,13 @@ static int ltq_pci_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       ltq_pci_membase = devm_request_and_ioremap(&pdev->dev, res_bridge);
-       ltq_pci_mapped_cfg = devm_request_and_ioremap(&pdev->dev, res_cfg);
+       ltq_pci_membase = devm_ioremap_resource(&pdev->dev, res_bridge);
+       if (IS_ERR(ltq_pci_membase))
+               return PTR_ERR(ltq_pci_membase);
 
-       if (!ltq_pci_membase || !ltq_pci_mapped_cfg) {
-               dev_err(&pdev->dev, "failed to remap resources\n");
-               return -ENOMEM;
-       }
+       ltq_pci_mapped_cfg = devm_ioremap_resource(&pdev->dev, res_cfg);
+       if (IS_ERR(ltq_pci_mapped_cfg))
+               return PTR_ERR(ltq_pci_mapped_cfg);
 
        ltq_pci_startup(pdev);