[-next,15/15] thermal: rcar: use devm_platform_ioremap_resource() to simplify code
diff mbox series

Message ID 20190904122939.23780-16-yuehaibing@huawei.com
State New
Delegated to: Eduardo Valentin
Headers show
Series
  • use devm_platform_ioremap_resource() to simplify code
Related show

Commit Message

YueHaibing Sept. 4, 2019, 12:29 p.m. UTC
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/thermal/rcar_thermal.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Wolfram Sang Sept. 4, 2019, 5:25 p.m. UTC | #1
On Wed, Sep 04, 2019 at 08:29:39PM +0800, YueHaibing wrote:
> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

I think for such straightforward (and manifold) conversions, one patch
per subsystem is better than one patch per driver. But this is not my
subsystem, so I'll leave it to the thermal maintainers.

Patch
diff mbox series

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index d0873de..d7f6aab 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -523,9 +523,8 @@  static int rcar_thermal_probe(struct platform_device *pdev)
 			 * Then, driver uses common registers
 			 * rcar_has_irq_support() will be enabled
 			 */
-			res = platform_get_resource(pdev, IORESOURCE_MEM,
-						    mres++);
-			common->base = devm_ioremap_resource(dev, res);
+			common->base = devm_platform_ioremap_resource(pdev,
+								      mres++);
 			if (IS_ERR(common->base))
 				return PTR_ERR(common->base);