Re: [PATCH] watchdog: Convert to use devm_platform_ioremap_resource
From: Michal Simek
Date: Wed Apr 03 2019 - 03:10:11 EST
On 02. 04. 19 21:01, Guenter Roeck wrote:
> 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@xxxxxxxxx>
> Cc: Nicolas Ferre <nicolas.ferre@xxxxxxxxxxxxx>
> Cc: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
> Cc: Florian Fainelli <f.fainelli@xxxxxxxxx>
> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>
> Cc: Baruch Siach <baruch@xxxxxxxxxx>
> Cc: Keguang Zhang <keguang.zhang@xxxxxxxxx>
> Cc: Vladimir Zapolskiy <vz@xxxxxxxxx>
> Cc: Kevin Hilman <khilman@xxxxxxxxxxxx>
> Cc: Matthias Brugger <matthias.bgg@xxxxxxxxx>
> Cc: Avi Fishman <avifishman70@xxxxxxxxx>
> Cc: Nancy Yuen <yuenn@xxxxxxxxxx>
> Cc: Brendan Higgins <brendanhiggins@xxxxxxxxxx>
> Cc: Wan ZongShun <mcuos.com@xxxxxxxxx>
> Cc: Michal Simek <michal.simek@xxxxxxxxxx>
> Cc: Sylvain Lemieux <slemieux.tyco@xxxxxxxxx>
> Cc: Kukjin Kim <kgene@xxxxxxxxxx>
> Cc: Barry Song <baohua@xxxxxxxxxx>
> Cc: Orson Zhai <orsonzhai@xxxxxxxxx>
> Cc: Patrice Chotard <patrice.chotard@xxxxxx>
> Cc: Maxime Coquelin <mcoquelin.stm32@xxxxxxxxx>
> Cc: Maxime Ripard <maxime.ripard@xxxxxxxxxxx>
> Cc: Chen-Yu Tsai <wens@xxxxxxxx>
> Cc: Marc Gonzalez <marc.w.gonzalez@xxxxxxx>
> Cc: Thierry Reding <thierry.reding@xxxxxxxxx>
> Cc: Shawn Guo <shawnguo@xxxxxxxxxx>
> Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
> ---
> drivers/watchdog/asm9260_wdt.c | 4 +---
> drivers/watchdog/aspeed_wdt.c | 4 +---
> drivers/watchdog/at91sam9_wdt.c | 4 +---
> drivers/watchdog/ath79_wdt.c | 4 +---
> drivers/watchdog/atlas7_wdt.c | 4 +---
> drivers/watchdog/bcm7038_wdt.c | 4 +---
> drivers/watchdog/bcm_kona_wdt.c | 4 +---
> drivers/watchdog/cadence_wdt.c | 4 +---
...
> drivers/watchdog/of_xilinx_wdt.c | 4 +---
Acked-by: Michal Simek <michal.simek@xxxxxxxxxx> (cadence/xilinx wdts)
Thanks,
Michal