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 > 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 For sunxi_wdt Acked-by: Maxime Ripard Thanks! Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com