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

Message ID 20190904122939.23780-13-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/tango_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Mans Rullgard Sept. 5, 2019, 11:06 a.m. UTC | #1
YueHaibing <yuehaibing@huawei.com> writes:

> 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>

Acked-by: Mans Rullgard <mans@mansr.com>

> ---
>  drivers/thermal/tango_thermal.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/thermal/tango_thermal.c b/drivers/thermal/tango_thermal.c
> index 304b461..f44441b 100644
> --- a/drivers/thermal/tango_thermal.c
> +++ b/drivers/thermal/tango_thermal.c
> @@ -73,7 +73,6 @@ static void tango_thermal_init(struct tango_thermal_priv *priv)
>
>  static int tango_thermal_probe(struct platform_device *pdev)
>  {
> -	struct resource *res;
>  	struct tango_thermal_priv *priv;
>  	struct thermal_zone_device *tzdev;
>
> @@ -81,8 +80,7 @@ static int tango_thermal_probe(struct platform_device *pdev)
>  	if (!priv)
>  		return -ENOMEM;
>
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	priv->base = devm_ioremap_resource(&pdev->dev, res);
> +	priv->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(priv->base))
>  		return PTR_ERR(priv->base);
>
> -- 
> 2.7.4
>

Patch
diff mbox series

diff --git a/drivers/thermal/tango_thermal.c b/drivers/thermal/tango_thermal.c
index 304b461..f44441b 100644
--- a/drivers/thermal/tango_thermal.c
+++ b/drivers/thermal/tango_thermal.c
@@ -73,7 +73,6 @@  static void tango_thermal_init(struct tango_thermal_priv *priv)
 
 static int tango_thermal_probe(struct platform_device *pdev)
 {
-	struct resource *res;
 	struct tango_thermal_priv *priv;
 	struct thermal_zone_device *tzdev;
 
@@ -81,8 +80,7 @@  static int tango_thermal_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->base = devm_ioremap_resource(&pdev->dev, res);
+	priv->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->base))
 		return PTR_ERR(priv->base);