Re: [PATCH] watchdog: Convert to use devm_platform_ioremap_resource

From: Maxime Ripard
Date: Wed Apr 03 2019 - 02:08:22 EST


On Tue, Apr 02, 2019 at 12:01:53PM -0700, 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>

For sunxi_wdt

Acked-by: Maxime Ripard <maxime.ripard@xxxxxxxxxxx>

Thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Attachment: signature.asc
Description: PGP signature