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/rt2880_wdt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/watchdog/rt2880_wdt.c') diff --git a/drivers/watchdog/rt2880_wdt.c b/drivers/watchdog/rt2880_wdt.c index db7c57d82cfd..4adf5f39fdd9 100644 --- a/drivers/watchdog/rt2880_wdt.c +++ b/drivers/watchdog/rt2880_wdt.c @@ -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); -- cgit