From 0f0a6a285ec0c7b0ac0b532f87a784605322f9ce Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Tue, 2 Apr 2019 12:01:53 -0700 Subject: watchdog: Convert to use devm_platform_ioremap_resource 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 Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Florian Fainelli Cc: Linus Walleij Cc: Baruch Siach Cc: Keguang Zhang Cc: Vladimir Zapolskiy Cc: Kevin Hilman Cc: Matthias Brugger Cc: Avi Fishman Cc: Nancy Yuen Cc: Brendan Higgins Cc: Wan ZongShun Cc: Michal Simek Cc: Sylvain Lemieux Cc: Kukjin Kim Cc: Barry Song Cc: Orson Zhai Cc: Patrice Chotard Cc: Maxime Coquelin Cc: Maxime Ripard Cc: Chen-Yu Tsai Cc: Marc Gonzalez Cc: Thierry Reding Cc: Shawn Guo Signed-off-by: Guenter Roeck Acked-by: Alexandre Belloni Tested-by: Alexandre Belloni Acked-by: Joel Stanley Reviewed-by: Linus Walleij Acked-by: Maxime Ripard Acked-by: Michal Simek (cadence/xilinx wdts) Acked-by: Thierry Reding Reviewed-by: Florian Fainelli Acked-by: Patrice Chotard Acked-by: Vladimir Zapolskiy Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- drivers/watchdog/ath79_wdt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/watchdog/ath79_wdt.c') diff --git a/drivers/watchdog/ath79_wdt.c b/drivers/watchdog/ath79_wdt.c index e2209bf5fa8a..5d66c8ec9a7d 100644 --- a/drivers/watchdog/ath79_wdt.c +++ b/drivers/watchdog/ath79_wdt.c @@ -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); -- cgit v1.2.3-58-ga151