watchdog: Convert to use devm_platform_ioremap_resource
authorGuenter Roeck <linux@roeck-us.net>
Tue, 2 Apr 2019 19:01:53 +0000 (12:01 -0700)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sun, 5 May 2019 19:02:12 +0000 (21:02 +0200)
Use devm_platform_ioremap_resource to reduce source code size,
improve readability, and reduce the likelyhood of bugs.

The conversion was done automatically with coccinelle using the
following semantic patch.

@r@
identifier res, pdev;
expression a;
expression index;
expression e;
@@

<+...
- res = platform_get_resource(pdev, IORESOURCE_MEM, index);
- a = devm_ioremap_resource(e, res);
+ a = devm_platform_ioremap_resource(pdev, index);
...+>

@depends on r@
identifier r.res;
@@
- struct resource *res;
  ... when != res

@@
identifier res, pdev;
expression index;
expression a;
@@
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, index);
- a = devm_ioremap_resource(&pdev->dev, res);
+ a = devm_platform_ioremap_resource(pdev, index);

Cc: Joel Stanley <joel@jms.id.au>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Keguang Zhang <keguang.zhang@gmail.com>
Cc: Vladimir Zapolskiy <vz@mleia.com>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Avi Fishman <avifishman70@gmail.com>
Cc: Nancy Yuen <yuenn@google.com>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Sylvain Lemieux <slemieux.tyco@gmail.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Barry Song <baohua@kernel.org>
Cc: Orson Zhai <orsonzhai@gmail.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Tested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Acked-by: Michal Simek <michal.simek@xilinx.com> (cadence/xilinx wdts)
Acked-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
52 files changed:
drivers/watchdog/asm9260_wdt.c
drivers/watchdog/aspeed_wdt.c
drivers/watchdog/at91sam9_wdt.c
drivers/watchdog/ath79_wdt.c
drivers/watchdog/atlas7_wdt.c
drivers/watchdog/bcm7038_wdt.c
drivers/watchdog/bcm_kona_wdt.c
drivers/watchdog/cadence_wdt.c
drivers/watchdog/coh901327_wdt.c
drivers/watchdog/davinci_wdt.c
drivers/watchdog/digicolor_wdt.c
drivers/watchdog/dw_wdt.c
drivers/watchdog/ep93xx_wdt.c
drivers/watchdog/ftwdt010_wdt.c
drivers/watchdog/imgpdc_wdt.c
drivers/watchdog/jz4740_wdt.c
drivers/watchdog/lantiq_wdt.c
drivers/watchdog/loongson1_wdt.c
drivers/watchdog/lpc18xx_wdt.c
drivers/watchdog/max63xx_wdt.c
drivers/watchdog/meson_gxbb_wdt.c
drivers/watchdog/meson_wdt.c
drivers/watchdog/moxart_wdt.c
drivers/watchdog/mpc8xxx_wdt.c
drivers/watchdog/mt7621_wdt.c
drivers/watchdog/mtk_wdt.c
drivers/watchdog/npcm_wdt.c
drivers/watchdog/nuc900_wdt.c
drivers/watchdog/of_xilinx_wdt.c
drivers/watchdog/omap_wdt.c
drivers/watchdog/orion_wdt.c
drivers/watchdog/pic32-dmt.c
drivers/watchdog/pic32-wdt.c
drivers/watchdog/pnx4008_wdt.c
drivers/watchdog/renesas_wdt.c
drivers/watchdog/rt2880_wdt.c
drivers/watchdog/rtd119x_wdt.c
drivers/watchdog/rza_wdt.c
drivers/watchdog/s3c2410_wdt.c
drivers/watchdog/sama5d4_wdt.c
drivers/watchdog/sbsa_gwdt.c
drivers/watchdog/shwdt.c
drivers/watchdog/sirfsoc_wdt.c
drivers/watchdog/sprd_wdt.c
drivers/watchdog/st_lpc_wdt.c
drivers/watchdog/stm32_iwdg.c
drivers/watchdog/sunxi_wdt.c
drivers/watchdog/tangox_wdt.c
drivers/watchdog/tegra_wdt.c
drivers/watchdog/ts72xx_wdt.c
drivers/watchdog/txx9wdt.c
drivers/watchdog/zx2967_wdt.c

index 9768e44ffeb8a46d136e457bfc9e9e652540ee8d..1de272bb20701fc8dfaf8cbc4210bf21347ab0c1 100644 (file)
@@ -276,7 +276,6 @@ static int asm9260_wdt_probe(struct platform_device *pdev)
 {
        struct asm9260_wdt_priv *priv;
        struct watchdog_device *wdd;
-       struct resource *res;
        int ret;
        static const char * const mode_name[] = { "hw", "sw", "debug", };
 
@@ -287,8 +286,7 @@ static int asm9260_wdt_probe(struct platform_device *pdev)
 
        priv->dev = &pdev->dev;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       priv->iobase = devm_ioremap_resource(&pdev->dev, res);
+       priv->iobase = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(priv->iobase))
                return PTR_ERR(priv->iobase);
 
index 1abe4d021fd27171bae9fb7a289c72916f041486..f09333fd54b483b5273d9de142a793997058930f 100644 (file)
@@ -190,7 +190,6 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
        const struct aspeed_wdt_config *config;
        const struct of_device_id *ofdid;
        struct aspeed_wdt *wdt;
-       struct resource *res;
        struct device_node *np;
        const char *reset_type;
        u32 duration;
@@ -201,8 +200,7 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
        if (!wdt)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->base = devm_ioremap_resource(&pdev->dev, res);
+       wdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->base))
                return PTR_ERR(wdt->base);
 
index f4050a229eb5865574f3085be11d747d2ff020ee..292b5a1ca8318a50040957f68effe0685095530b 100644 (file)
@@ -327,7 +327,6 @@ static inline int of_at91wdt_init(struct device_node *np, struct at91wdt *wdt)
 
 static int __init at91wdt_probe(struct platform_device *pdev)
 {
-       struct resource *r;
        int err;
        struct at91wdt *wdt;
 
@@ -346,8 +345,7 @@ static int __init at91wdt_probe(struct platform_device *pdev)
        wdt->wdd.min_timeout = 1;
        wdt->wdd.max_timeout = 0xFFFF;
 
-       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->base = devm_ioremap_resource(&pdev->dev, r);
+       wdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->base))
                return PTR_ERR(wdt->base);
 
index e2209bf5fa8afabd3e8bc96c7767e5a545d384fb..5d66c8ec9a7db9d70372ea1216ec46997bab935b 100644 (file)
@@ -250,15 +250,13 @@ static struct miscdevice ath79_wdt_miscdev = {
 
 static int ath79_wdt_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        u32 ctrl;
        int err;
 
        if (wdt_base)
                return -EBUSY;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt_base = devm_ioremap_resource(&pdev->dev, res);
+       wdt_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt_base))
                return PTR_ERR(wdt_base);
 
index 4abdcabd8219e61ddc8adbbba23ac804f2f54f2c..e170933aa0a8f4841a5091655ad1ded104477c52 100644 (file)
@@ -129,15 +129,13 @@ static int atlas7_wdt_probe(struct platform_device *pdev)
 {
        struct device_node *np = pdev->dev.of_node;
        struct atlas7_wdog *wdt;
-       struct resource *res;
        struct clk *clk;
        int ret;
 
        wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
        if (!wdt)
                return -ENOMEM;
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->base = devm_ioremap_resource(&pdev->dev, res);
+       wdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->base))
                return PTR_ERR(wdt->base);
 
index ce3f646e80775d324b29e4c5d2c3db00327645d1..71fca45eab5dd74563bba4d4c52d53d0cbe52fe5 100644 (file)
@@ -111,7 +111,6 @@ static int bcm7038_wdt_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct bcm7038_watchdog *wdt;
-       struct resource *res;
        int err;
 
        wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
@@ -120,8 +119,7 @@ static int bcm7038_wdt_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, wdt);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->base = devm_ioremap_resource(dev, res);
+       wdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->base))
                return PTR_ERR(wdt->base);
 
index 4249b47902bd5321bf7955b3f86bb773b8c2a305..d52334ab080573631761900414358efc6901737e 100644 (file)
@@ -280,7 +280,6 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct bcm_kona_wdt *wdt;
-       struct resource *res;
        int ret;
 
        wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
@@ -289,8 +288,7 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev)
 
        spin_lock_init(&wdt->lock);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->base = devm_ioremap_resource(dev, res);
+       wdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->base))
                return -ENODEV;
 
index c3924356d1731153847b82147b58f70f76a5a382..5986f18f97e24f69545fea237f1a55c38b7c6e3f 100644 (file)
@@ -285,7 +285,6 @@ static const struct watchdog_ops cdns_wdt_ops = {
  */
 static int cdns_wdt_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        int ret, irq;
        unsigned long clock_f;
        struct cdns_wdt *wdt;
@@ -302,8 +301,7 @@ static int cdns_wdt_probe(struct platform_device *pdev)
        cdns_wdt_device->min_timeout = CDNS_WDT_MIN_TIMEOUT;
        cdns_wdt_device->max_timeout = CDNS_WDT_MAX_TIMEOUT;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->regs = devm_ioremap_resource(&pdev->dev, res);
+       wdt->regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->regs))
                return PTR_ERR(wdt->regs);
 
index f29d1edc5badef49f74950330b587d55eba40473..3c4eaa0d11781ae7e6e60bcb14f9ac37c072d593 100644 (file)
@@ -258,12 +258,10 @@ static int __init coh901327_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        int ret;
        u16 val;
-       struct resource *res;
 
        parent = dev;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       virtbase = devm_ioremap_resource(dev, res);
+       virtbase = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(virtbase))
                return PTR_ERR(virtbase);
 
index ebb85d60b6d5b8b77f62081eb0b7352167960b48..7daa15df74a5e2c9559c425a359f4b5c66fd34be 100644 (file)
@@ -195,7 +195,6 @@ static int davinci_wdt_probe(struct platform_device *pdev)
 {
        int ret = 0;
        struct device *dev = &pdev->dev;
-       struct resource  *wdt_mem;
        struct watchdog_device *wdd;
        struct davinci_wdt_device *davinci_wdt;
 
@@ -235,8 +234,7 @@ static int davinci_wdt_probe(struct platform_device *pdev)
        watchdog_set_nowayout(wdd, 1);
        watchdog_set_restart_priority(wdd, 128);
 
-       wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       davinci_wdt->base = devm_ioremap_resource(dev, wdt_mem);
+       davinci_wdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(davinci_wdt->base)) {
                ret = PTR_ERR(davinci_wdt->base);
                goto err_clk_disable;
index a9e11df155b8e44e5aac99fd02db4fb5e7d21038..8af6e9a67d0defefe8fc49fe6d2ed68b3c92115e 100644 (file)
@@ -116,7 +116,6 @@ static struct watchdog_device dc_wdt_wdd = {
 
 static int dc_wdt_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        struct device *dev = &pdev->dev;
        struct dc_wdt *wdt;
        int ret;
@@ -125,8 +124,7 @@ static int dc_wdt_probe(struct platform_device *pdev)
        if (!wdt)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->base = devm_ioremap_resource(dev, res);
+       wdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->base))
                return PTR_ERR(wdt->base);
 
index aa95f57cc1c316c64b3325259bcf12efcf3f1743..39e43750ab08da9a3c100930fc39f62f863066c3 100644 (file)
@@ -238,15 +238,13 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        struct watchdog_device *wdd;
        struct dw_wdt *dw_wdt;
-       struct resource *mem;
        int ret;
 
        dw_wdt = devm_kzalloc(dev, sizeof(*dw_wdt), GFP_KERNEL);
        if (!dw_wdt)
                return -ENOMEM;
 
-       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       dw_wdt->regs = devm_ioremap_resource(dev, mem);
+       dw_wdt->regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(dw_wdt->regs))
                return PTR_ERR(dw_wdt->regs);
 
index f9b14e6efd9ac226f56ca232812e61276266e090..1e721c2f9eac9eaf7dcbe74df2cb501ac279b98f 100644 (file)
@@ -91,7 +91,6 @@ static int ep93xx_wdt_probe(struct platform_device *pdev)
 {
        struct ep93xx_wdt_priv *priv;
        struct watchdog_device *wdd;
-       struct resource *res;
        unsigned long val;
        int ret;
 
@@ -99,8 +98,7 @@ static int ep93xx_wdt_probe(struct platform_device *pdev)
        if (!priv)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       priv->mmio = devm_ioremap_resource(&pdev->dev, res);
+       priv->mmio = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(priv->mmio))
                return PTR_ERR(priv->mmio);
 
index a9c2912ee28029192d1be1e8f525dc6adb250b1a..ecb32c42e83905e708a46add57a3ab466f3c285b 100644 (file)
@@ -124,7 +124,6 @@ static const struct watchdog_info ftwdt010_wdt_info = {
 static int ftwdt010_wdt_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       struct resource *res;
        struct ftwdt010_wdt *gwdt;
        unsigned int reg;
        int irq;
@@ -134,8 +133,7 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev)
        if (!gwdt)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       gwdt->base = devm_ioremap_resource(dev, res);
+       gwdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(gwdt->base))
                return PTR_ERR(gwdt->base);
 
index a3134ffa59f8db0c89f13b6aa477b4df52d7ec1e..84c9fb905072075077a7f7dc808bb06a5f90f421 100644 (file)
@@ -183,15 +183,13 @@ static int pdc_wdt_probe(struct platform_device *pdev)
        u64 div;
        int ret, val;
        unsigned long clk_rate;
-       struct resource *res;
        struct pdc_wdt_dev *pdc_wdt;
 
        pdc_wdt = devm_kzalloc(&pdev->dev, sizeof(*pdc_wdt), GFP_KERNEL);
        if (!pdc_wdt)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       pdc_wdt->base = devm_ioremap_resource(&pdev->dev, res);
+       pdc_wdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(pdc_wdt->base))
                return PTR_ERR(pdc_wdt->base);
 
index ec4d99a830ba61b53c3963afba9fddf749de70af..aa9d3523addd6e79963e4aa516ee767a19c20165 100644 (file)
@@ -165,7 +165,6 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
 {
        struct jz4740_wdt_drvdata *drvdata;
        struct watchdog_device *jz4740_wdt;
-       struct resource *res;
        int ret;
 
        drvdata = devm_kzalloc(&pdev->dev, sizeof(struct jz4740_wdt_drvdata),
@@ -186,8 +185,7 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
        watchdog_set_nowayout(jz4740_wdt, nowayout);
        watchdog_set_drvdata(jz4740_wdt, drvdata);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       drvdata->base = devm_ioremap_resource(&pdev->dev, res);
+       drvdata->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(drvdata->base))
                return PTR_ERR(drvdata->base);
 
index 83da84d6074b80ee5ff9d56c6a1106b17c106302..4caf02ba5d49b8b72482e29425395aa705886763 100644 (file)
@@ -203,7 +203,6 @@ static int ltq_wdt_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        struct ltq_wdt_priv *priv;
        struct watchdog_device *wdt;
-       struct resource *res;
        struct clk *clk;
        const struct ltq_wdt_hw *ltq_wdt_hw;
        int ret;
@@ -213,8 +212,7 @@ static int ltq_wdt_probe(struct platform_device *pdev)
        if (!priv)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       priv->membase = devm_ioremap_resource(dev, res);
+       priv->membase = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(priv->membase))
                return PTR_ERR(priv->membase);
 
index 3aee50c64a3660c7070a2fd047ff219c7cef3719..1119634b5c875620c78a35b7ebd2d642c3a606dd 100644 (file)
@@ -88,15 +88,13 @@ static int ls1x_wdt_probe(struct platform_device *pdev)
        struct ls1x_wdt_drvdata *drvdata;
        struct watchdog_device *ls1x_wdt;
        unsigned long clk_rate;
-       struct resource *res;
        int err;
 
        drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
        if (!drvdata)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       drvdata->base = devm_ioremap_resource(&pdev->dev, res);
+       drvdata->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(drvdata->base))
                return PTR_ERR(drvdata->base);
 
index 331cadb459ac5da03c6f4c5fb74d7266c337e446..f6f66634cedf6e45520928dfc75b1f8616a8ad99 100644 (file)
@@ -204,15 +204,13 @@ static int lpc18xx_wdt_probe(struct platform_device *pdev)
 {
        struct lpc18xx_wdt_dev *lpc18xx_wdt;
        struct device *dev = &pdev->dev;
-       struct resource *res;
        int ret;
 
        lpc18xx_wdt = devm_kzalloc(dev, sizeof(*lpc18xx_wdt), GFP_KERNEL);
        if (!lpc18xx_wdt)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       lpc18xx_wdt->base = devm_ioremap_resource(dev, res);
+       lpc18xx_wdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(lpc18xx_wdt->base))
                return PTR_ERR(lpc18xx_wdt->base);
 
index bf6a068245ba0513eae2a93c49ebc888faf2480d..5aaf13e5115ac578515d77de003b7cab27a5071c 100644 (file)
@@ -187,9 +187,7 @@ static void max63xx_mmap_set(struct max63xx_wdt *wdt, u8 set)
 
 static int max63xx_mmap_init(struct platform_device *p, struct max63xx_wdt *wdt)
 {
-       struct resource *mem = platform_get_resource(p, IORESOURCE_MEM, 0);
-
-       wdt->base = devm_ioremap_resource(&p->dev, mem);
+       wdt->base = devm_platform_ioremap_resource(p, 0);
        if (IS_ERR(wdt->base))
                return PTR_ERR(wdt->base);
 
index 69adeab3fde70fb9c692eca84d06f44da350491a..a8ed75cc9a6ebbe27816dd64c457f2c97965789c 100644 (file)
@@ -139,15 +139,13 @@ MODULE_DEVICE_TABLE(of, meson_gxbb_wdt_dt_ids);
 static int meson_gxbb_wdt_probe(struct platform_device *pdev)
 {
        struct meson_gxbb_wdt *data;
-       struct resource *res;
        int ret;
 
        data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
        if (!data)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       data->reg_base = devm_ioremap_resource(&pdev->dev, res);
+       data->reg_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(data->reg_base))
                return PTR_ERR(data->reg_base);
 
index cd0275a6cdac101e417e8912748e722417433bd8..7fc6acb33c7f51f6409e08392019494d59cb901a 100644 (file)
@@ -164,7 +164,6 @@ MODULE_DEVICE_TABLE(of, meson_wdt_dt_ids);
 
 static int meson_wdt_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        struct meson_wdt_dev *meson_wdt;
        const struct of_device_id *of_id;
        int err;
@@ -173,8 +172,7 @@ static int meson_wdt_probe(struct platform_device *pdev)
        if (!meson_wdt)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       meson_wdt->wdt_base = devm_ioremap_resource(&pdev->dev, res);
+       meson_wdt->wdt_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(meson_wdt->wdt_base))
                return PTR_ERR(meson_wdt->wdt_base);
 
index 430c3ab84c07c49b509c937dc5d9c2c2486ab8a4..740215a247fc77d59e795ee0e8527e977a105031 100644 (file)
@@ -92,7 +92,6 @@ static int moxart_wdt_probe(struct platform_device *pdev)
        struct moxart_wdt_dev *moxart_wdt;
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->of_node;
-       struct resource *res;
        struct clk *clk;
        int err;
        unsigned int max_timeout;
@@ -104,8 +103,7 @@ static int moxart_wdt_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, moxart_wdt);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       moxart_wdt->base = devm_ioremap_resource(dev, res);
+       moxart_wdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(moxart_wdt->base))
                return PTR_ERR(moxart_wdt->base);
 
index 069072e6747df321876e54c94410f2801bff0c7c..3b5b446b690c294bc2dac0d420133f0d1024759b 100644 (file)
@@ -149,8 +149,7 @@ static int mpc8xxx_wdt_probe(struct platform_device *ofdev)
        if (!ddata)
                return -ENOMEM;
 
-       res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
-       ddata->base = devm_ioremap_resource(dev, res);
+       ddata->base = devm_platform_ioremap_resource(ofdev, 0);
        if (IS_ERR(ddata->base))
                return PTR_ERR(ddata->base);
 
index 81208cd3f4ecba3edc2dc6334b360cdd98a7f935..9c943f1d57ecc6aca0acb280629a28f27ca5c273 100644 (file)
@@ -133,10 +133,7 @@ static struct watchdog_device mt7621_wdt_dev = {
 
 static int mt7621_wdt_probe(struct platform_device *pdev)
 {
-       struct resource *res;
-
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mt7621_wdt_base = devm_ioremap_resource(&pdev->dev, res);
+       mt7621_wdt_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(mt7621_wdt_base))
                return PTR_ERR(mt7621_wdt_base);
 
index 4baf64f21aa11f23e1b61d01703be9a56463934b..113a48d54058a544dbb22b9e35dfe7405f252192 100644 (file)
@@ -154,7 +154,6 @@ static const struct watchdog_ops mtk_wdt_ops = {
 static int mtk_wdt_probe(struct platform_device *pdev)
 {
        struct mtk_wdt_dev *mtk_wdt;
-       struct resource *res;
        int err;
 
        mtk_wdt = devm_kzalloc(&pdev->dev, sizeof(*mtk_wdt), GFP_KERNEL);
@@ -163,8 +162,7 @@ static int mtk_wdt_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, mtk_wdt);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mtk_wdt->wdt_base = devm_ioremap_resource(&pdev->dev, res);
+       mtk_wdt->wdt_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(mtk_wdt->wdt_base))
                return PTR_ERR(mtk_wdt->wdt_base);
 
index 0d4213652ecc917029d65c1c2f8d519374ef0470..4fce10c145c24ee4b0a909e391607113c9faeece 100644 (file)
@@ -181,7 +181,6 @@ static int npcm_wdt_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct npcm_wdt *wdt;
-       struct resource *res;
        int irq;
        int ret;
 
@@ -189,8 +188,7 @@ static int npcm_wdt_probe(struct platform_device *pdev)
        if (!wdt)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->reg = devm_ioremap_resource(dev, res);
+       wdt->reg = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->reg))
                return PTR_ERR(wdt->reg);
 
index 830bd04ff911f4f6ebd00bdadd9ff727405a5eeb..74e99eac90b94ecaa89c23c82a700c04ac52c978 100644 (file)
@@ -242,7 +242,6 @@ static struct miscdevice nuc900wdt_miscdev = {
 
 static int nuc900wdt_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        int ret = 0;
 
        nuc900_wdt = devm_kzalloc(&pdev->dev, sizeof(*nuc900_wdt),
@@ -254,8 +253,7 @@ static int nuc900wdt_probe(struct platform_device *pdev)
 
        spin_lock_init(&nuc900_wdt->wdt_lock);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       nuc900_wdt->wdt_base = devm_ioremap_resource(&pdev->dev, res);
+       nuc900_wdt->wdt_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(nuc900_wdt->wdt_base))
                return PTR_ERR(nuc900_wdt->wdt_base);
 
index d3f7eb0466782f4b386895cf509c54213a31819d..5c977164b3e5e6faa60f01b7067f45a4b2ec3092 100644 (file)
@@ -155,7 +155,6 @@ static int xwdt_probe(struct platform_device *pdev)
 {
        int rc;
        u32 pfreq = 0, enable_once = 0;
-       struct resource *res;
        struct xwdt_device *xdev;
        struct watchdog_device *xilinx_wdt_wdd;
 
@@ -168,8 +167,7 @@ static int xwdt_probe(struct platform_device *pdev)
        xilinx_wdt_wdd->ops = &xilinx_wdt_ops;
        xilinx_wdt_wdd->parent = &pdev->dev;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       xdev->base = devm_ioremap_resource(&pdev->dev, res);
+       xdev->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(xdev->base))
                return PTR_ERR(xdev->base);
 
index cbd752f9ac56375e9daf4b76b07704e79ee66a21..d49688d93f6ae156ab3db095f85bdd0261603813 100644 (file)
@@ -231,7 +231,6 @@ static const struct watchdog_ops omap_wdt_ops = {
 static int omap_wdt_probe(struct platform_device *pdev)
 {
        struct omap_wd_timer_platform_data *pdata = dev_get_platdata(&pdev->dev);
-       struct resource *res;
        struct omap_wdt_dev *wdev;
        int ret;
 
@@ -245,8 +244,7 @@ static int omap_wdt_probe(struct platform_device *pdev)
        mutex_init(&wdev->lock);
 
        /* reserve static register mappings */
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdev->base = devm_ioremap_resource(&pdev->dev, res);
+       wdev->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdev->base))
                return PTR_ERR(wdev->base);
 
index 8b259c712c52e728414e202d07584acf6a492f70..cdb0d174c5e2de3572369f41cef2c1c92d590a40 100644 (file)
@@ -494,8 +494,7 @@ static int orion_wdt_get_regs(struct platform_device *pdev,
                   of_device_is_compatible(node, "marvell,armada-xp-wdt")) {
 
                /* Dedicated RSTOUT register, can be requested. */
-               res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-               dev->rstout = devm_ioremap_resource(&pdev->dev, res);
+               dev->rstout = devm_platform_ioremap_resource(pdev, 1);
                if (IS_ERR(dev->rstout))
                        return PTR_ERR(dev->rstout);
 
@@ -503,8 +502,7 @@ static int orion_wdt_get_regs(struct platform_device *pdev,
                   of_device_is_compatible(node, "marvell,armada-380-wdt")) {
 
                /* Dedicated RSTOUT register, can be requested. */
-               res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-               dev->rstout = devm_ioremap_resource(&pdev->dev, res);
+               dev->rstout = devm_platform_ioremap_resource(pdev, 1);
                if (IS_ERR(dev->rstout))
                        return PTR_ERR(dev->rstout);
 
index c797305f8338cb4ed61e64fecf71b3698994a36a..052751c224fd0c282ba9a87390c1c79602313650 100644 (file)
@@ -172,15 +172,13 @@ static int pic32_dmt_probe(struct platform_device *pdev)
 {
        int ret;
        struct pic32_dmt *dmt;
-       struct resource *mem;
        struct watchdog_device *wdd = &pic32_dmt_wdd;
 
        dmt = devm_kzalloc(&pdev->dev, sizeof(*dmt), GFP_KERNEL);
        if (!dmt)
                return -ENOMEM;
 
-       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       dmt->regs = devm_ioremap_resource(&pdev->dev, mem);
+       dmt->regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(dmt->regs))
                return PTR_ERR(dmt->regs);
 
index e2761068dc6f9c07dbdbbb4df17ebc3fe6442ee2..455ec38363a6d15b201f4d1e6b6095e8addee5b7 100644 (file)
@@ -171,14 +171,12 @@ static int pic32_wdt_drv_probe(struct platform_device *pdev)
        int ret;
        struct watchdog_device *wdd = &pic32_wdd;
        struct pic32_wdt *wdt;
-       struct resource *mem;
 
        wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
        if (!wdt)
                return -ENOMEM;
 
-       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->regs = devm_ioremap_resource(&pdev->dev, mem);
+       wdt->regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->regs))
                return PTR_ERR(wdt->regs);
 
index 8e261799c84e356b9597f0996237875b11fe339c..24c266a9e1dcaf4db330de63f0b5c5fcfadfea09 100644 (file)
@@ -185,13 +185,11 @@ static struct watchdog_device pnx4008_wdd = {
 
 static int pnx4008_wdt_probe(struct platform_device *pdev)
 {
-       struct resource *r;
        int ret = 0;
 
        watchdog_init_timeout(&pnx4008_wdd, heartbeat, &pdev->dev);
 
-       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt_base = devm_ioremap_resource(&pdev->dev, r);
+       wdt_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt_base))
                return PTR_ERR(wdt_base);
 
index 622ede529912f47011c42c8e30cf508fcc5a502d..5b3186492087fbfff622651b4324bd04e168061b 100644 (file)
@@ -177,7 +177,6 @@ static inline bool rwdt_blacklisted(struct device *dev) { return false; }
 static int rwdt_probe(struct platform_device *pdev)
 {
        struct rwdt_priv *priv;
-       struct resource *res;
        struct clk *clk;
        unsigned long clks_per_sec;
        int ret, i;
@@ -189,8 +188,7 @@ static int rwdt_probe(struct platform_device *pdev)
        if (!priv)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       priv->base = devm_ioremap_resource(&pdev->dev, res);
+       priv->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(priv->base))
                return PTR_ERR(priv->base);
 
index db7c57d82cfdc0201b9a49272c3dbb44db5961a7..4adf5f39fdd9dddc2da052112bf6adbcb979f386 100644 (file)
@@ -141,11 +141,9 @@ static struct watchdog_device rt288x_wdt_dev = {
 
 static int rt288x_wdt_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        int ret;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       rt288x_wdt_base = devm_ioremap_resource(&pdev->dev, res);
+       rt288x_wdt_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(rt288x_wdt_base))
                return PTR_ERR(rt288x_wdt_base);
 
index d001c17ddfdeeea843e208682dbe8ca7fc57c441..d823c9def36fb53dee1268e0a202456e7c843453 100644 (file)
@@ -98,15 +98,13 @@ static const struct of_device_id rtd119x_wdt_dt_ids[] = {
 static int rtd119x_wdt_probe(struct platform_device *pdev)
 {
        struct rtd119x_watchdog_device *data;
-       struct resource *res;
        int ret;
 
        data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
        if (!data)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       data->base = devm_ioremap_resource(&pdev->dev, res);
+       data->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(data->base))
                return PTR_ERR(data->base);
 
index 781bb572e6af3de3f2d4caa3120df8d24a1090f1..b854f0aeb3ef476888950fe5a632ac6a1d35628d 100644 (file)
@@ -167,7 +167,6 @@ static const struct watchdog_ops rza_wdt_ops = {
 static int rza_wdt_probe(struct platform_device *pdev)
 {
        struct rza_wdt *priv;
-       struct resource *res;
        unsigned long rate;
        int ret;
 
@@ -175,8 +174,7 @@ static int rza_wdt_probe(struct platform_device *pdev)
        if (!priv)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       priv->base = devm_ioremap_resource(&pdev->dev, res);
+       priv->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(priv->base))
                return PTR_ERR(priv->base);
 
index adaa43543f0a7c2591ea0bf472926aa367567fa0..4267b9e8734b497cacb233d08f5ae4e8688889e4 100644 (file)
@@ -522,7 +522,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct s3c2410_wdt *wdt;
-       struct resource *wdt_mem;
        struct resource *wdt_irq;
        unsigned int wtcon;
        int started = 0;
@@ -554,8 +553,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
        }
 
        /* get the memory region for the watchdog timer */
-       wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->reg_base = devm_ioremap_resource(dev, wdt_mem);
+       wdt->reg_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->reg_base)) {
                ret = PTR_ERR(wdt->reg_base);
                goto err;
index 1e93c1b0e3cfc224f039c47407a54b6fd7dda7da..ea72fa0aa3ec3cff9bcad7ae59649e7501fa4cc6 100644 (file)
@@ -201,7 +201,6 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)
 {
        struct watchdog_device *wdd;
        struct sama5d4_wdt *wdt;
-       struct resource *res;
        void __iomem *regs;
        u32 irq = 0;
        u32 timeout;
@@ -221,8 +220,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)
 
        watchdog_set_drvdata(wdd, wdt);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       regs = devm_ioremap_resource(&pdev->dev, res);
+       regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(regs))
                return PTR_ERR(regs);
 
index e8bd9887c56638aaf81659c45d7505c424266b55..68aff828bf7e08e5d2bba5a79dd4de8d2812450b 100644 (file)
@@ -231,7 +231,6 @@ static int sbsa_gwdt_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        struct watchdog_device *wdd;
        struct sbsa_gwdt *gwdt;
-       struct resource *res;
        int ret, irq;
        u32 status;
 
@@ -240,13 +239,11 @@ static int sbsa_gwdt_probe(struct platform_device *pdev)
                return -ENOMEM;
        platform_set_drvdata(pdev, gwdt);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       cf_base = devm_ioremap_resource(dev, res);
+       cf_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(cf_base))
                return PTR_ERR(cf_base);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-       rf_base = devm_ioremap_resource(dev, res);
+       rf_base = devm_platform_ioremap_resource(pdev, 1);
        if (IS_ERR(rf_base))
                return PTR_ERR(rf_base);
 
index a7d6425db807ff9d95c91aa24be73bbdfa15a9bd..e7617b7df70b3e4c3538a5d68fb1120c1e96a5e9 100644 (file)
@@ -220,7 +220,6 @@ static struct watchdog_device sh_wdt_dev = {
 static int sh_wdt_probe(struct platform_device *pdev)
 {
        struct sh_wdt *wdt;
-       struct resource *res;
        int rc;
 
        /*
@@ -245,8 +244,7 @@ static int sh_wdt_probe(struct platform_device *pdev)
                wdt->clk = NULL;
        }
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->base = devm_ioremap_resource(wdt->dev, res);
+       wdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->base))
                return PTR_ERR(wdt->base);
 
index ac0c9d2c4aee4ff8f14b92fd5b7a8c7e74fc0248..2559062d35da7aea5cb61bf8105dc4805b3458eb 100644 (file)
@@ -146,12 +146,10 @@ static struct watchdog_device sirfsoc_wdd = {
 
 static int sirfsoc_wdt_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        int ret;
        void __iomem *base;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = devm_ioremap_resource(&pdev->dev, res);
+       base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(base))
                return PTR_ERR(base);
 
index ff9397d9638a7b4a7745084ddd2654f98c8e8c06..a63163a9377735815ea261296fe778b2c6f15e46 100644 (file)
@@ -269,7 +269,6 @@ static const struct watchdog_info sprd_wdt_info = {
 
 static int sprd_wdt_probe(struct platform_device *pdev)
 {
-       struct resource *wdt_res;
        struct sprd_wdt *wdt;
        int ret;
 
@@ -277,8 +276,7 @@ static int sprd_wdt_probe(struct platform_device *pdev)
        if (!wdt)
                return -ENOMEM;
 
-       wdt_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->base = devm_ioremap_resource(&pdev->dev, wdt_res);
+       wdt->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->base))
                return PTR_ERR(wdt->base);
 
index 177829b379da0f74e637dcc5ce6f47d517e53362..196fb4b72c5dc940311e63991e34529093c64547 100644 (file)
@@ -148,7 +148,6 @@ static int st_wdog_probe(struct platform_device *pdev)
        struct device_node *np = pdev->dev.of_node;
        struct st_wdog *st_wdog;
        struct regmap *regmap;
-       struct resource *res;
        struct clk *clk;
        void __iomem *base;
        uint32_t mode;
@@ -175,8 +174,7 @@ static int st_wdog_probe(struct platform_device *pdev)
        }
        st_wdog->syscfg = (struct st_wdog_syscfg *)match->data;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = devm_ioremap_resource(&pdev->dev, res);
+       base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(base))
                return PTR_ERR(base);
 
index e00e3b3526c6e73220849553f8b0680c90811100..309563e002b8aef7aceed4a13cb7e3299ba87166 100644 (file)
@@ -202,7 +202,6 @@ static int stm32_iwdg_probe(struct platform_device *pdev)
        struct watchdog_device *wdd;
        const struct of_device_id *match;
        struct stm32_iwdg *wdt;
-       struct resource *res;
        int ret;
 
        match = of_match_device(stm32_iwdg_of_match, &pdev->dev);
@@ -216,8 +215,7 @@ static int stm32_iwdg_probe(struct platform_device *pdev)
        wdt->has_pclk = match->data;
 
        /* This is the timer base. */
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->regs = devm_ioremap_resource(&pdev->dev, res);
+       wdt->regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->regs)) {
                dev_err(&pdev->dev, "Could not get resource\n");
                return PTR_ERR(wdt->regs);
index c6c73656997efa933aaabb83ac23c7024b8b75ea..f0e7ef40b1e431987d04dd2d7fa38ec66f7e503f 100644 (file)
@@ -234,7 +234,6 @@ MODULE_DEVICE_TABLE(of, sunxi_wdt_dt_ids);
 static int sunxi_wdt_probe(struct platform_device *pdev)
 {
        struct sunxi_wdt_dev *sunxi_wdt;
-       struct resource *res;
        int err;
 
        sunxi_wdt = devm_kzalloc(&pdev->dev, sizeof(*sunxi_wdt), GFP_KERNEL);
@@ -245,8 +244,7 @@ static int sunxi_wdt_probe(struct platform_device *pdev)
        if (!sunxi_wdt->wdt_regs)
                return -ENODEV;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       sunxi_wdt->wdt_base = devm_ioremap_resource(&pdev->dev, res);
+       sunxi_wdt->wdt_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(sunxi_wdt->wdt_base))
                return PTR_ERR(sunxi_wdt->wdt_base);
 
index d0b53f3c0d171ebaf8d796d371c31f36aa04a837..16611fe0d9d10535ed4c855b087b78f1d8dc6a31 100644 (file)
@@ -111,7 +111,6 @@ static const struct watchdog_ops tangox_wdt_ops = {
 static int tangox_wdt_probe(struct platform_device *pdev)
 {
        struct tangox_wdt_device *dev;
-       struct resource *res;
        u32 config;
        int err;
 
@@ -119,8 +118,7 @@ static int tangox_wdt_probe(struct platform_device *pdev)
        if (!dev)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       dev->base = devm_ioremap_resource(&pdev->dev, res);
+       dev->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(dev->base))
                return PTR_ERR(dev->base);
 
index 877dd39bd41fc96ad26dcceb987597a453fff980..fc3cf5edf6c76ca47f3c54b1ac03ac351de1e21b 100644 (file)
@@ -183,13 +183,11 @@ static int tegra_wdt_probe(struct platform_device *pdev)
 {
        struct watchdog_device *wdd;
        struct tegra_wdt *wdt;
-       struct resource *res;
        void __iomem *regs;
        int ret;
 
        /* This is the timer base. */
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       regs = devm_ioremap_resource(&pdev->dev, res);
+       regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(regs))
                return PTR_ERR(regs);
 
index 811e43c39ec4e0322f4b98db7175c8ce1a3538de..3aa11c84dea9a7a3144937d885d056ebdc103571 100644 (file)
@@ -124,20 +124,17 @@ static int ts72xx_wdt_probe(struct platform_device *pdev)
 {
        struct ts72xx_wdt_priv *priv;
        struct watchdog_device *wdd;
-       struct resource *res;
        int ret;
 
        priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       priv->control_reg = devm_ioremap_resource(&pdev->dev, res);
+       priv->control_reg = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(priv->control_reg))
                return PTR_ERR(priv->control_reg);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-       priv->feed_reg = devm_ioremap_resource(&pdev->dev, res);
+       priv->feed_reg = devm_platform_ioremap_resource(pdev, 1);
        if (IS_ERR(priv->feed_reg))
                return PTR_ERR(priv->feed_reg);
 
index 6f7a9deb27d05d25d9a261d9c69460c2dccb9528..fcb4da5b1f4c55558ba77fceb643761e8cc6bf40 100644 (file)
@@ -103,7 +103,6 @@ static struct watchdog_device txx9wdt = {
 
 static int __init txx9wdt_probe(struct platform_device *dev)
 {
-       struct resource *res;
        int ret;
 
        txx9_imclk = clk_get(NULL, "imbus_clk");
@@ -119,8 +118,7 @@ static int __init txx9wdt_probe(struct platform_device *dev)
                goto exit;
        }
 
-       res = platform_get_resource(dev, IORESOURCE_MEM, 0);
-       txx9wdt_reg = devm_ioremap_resource(&dev->dev, res);
+       txx9wdt_reg = devm_platform_ioremap_resource(dev, 0);
        if (IS_ERR(txx9wdt_reg)) {
                ret = PTR_ERR(txx9wdt_reg);
                goto exit;
index 9261f7c77f6de111006fe2f373f51dead5b50df1..9ccc83f526f3bda8ae10193d4a578ac6a34f4d23 100644 (file)
@@ -192,7 +192,6 @@ static int zx2967_wdt_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct zx2967_wdt *wdt;
-       struct resource *base;
        int ret;
        struct reset_control *rstc;
 
@@ -209,8 +208,7 @@ static int zx2967_wdt_probe(struct platform_device *pdev)
        wdt->wdt_device.min_timeout = ZX2967_WDT_MIN_TIMEOUT;
        wdt->wdt_device.parent = &pdev->dev;
 
-       base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       wdt->reg_base = devm_ioremap_resource(dev, base);
+       wdt->reg_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(wdt->reg_base))
                return PTR_ERR(wdt->reg_base);