linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code
@ 2019-09-04 12:29 YueHaibing
  2019-09-04 12:29 ` [PATCH -next 01/15] thermal: armada: " YueHaibing
                   ` (14 more replies)
  0 siblings, 15 replies; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

devm_platform_ioremap_resource() internally have platform_get_resource()
and devm_ioremap_resource() in it. So instead of calling them separately
use devm_platform_ioremap_resource() directly.

YueHaibing (15):
  thermal: armada: use devm_platform_ioremap_resource() to simplify code
  thermal: bcm2835: use devm_platform_ioremap_resource() to simplify
    code
  thermal: brcmstb: use devm_platform_ioremap_resource() to simplify
    code
  thermal: hisilicon: use devm_platform_ioremap_resource() to simplify
    code
  thermal: dove: use devm_platform_ioremap_resource() to simplify code
  thermal: mtk: use devm_platform_ioremap_resource() to simplify code
  thermal: kirkwood: use devm_platform_ioremap_resource() to simplify
    code
  thermal: tsens: use devm_platform_ioremap_resource() to simplify code
  thermal: rockchip: use devm_platform_ioremap_resource() to simplify
    code
  thermal: spear: use devm_platform_ioremap_resource() to simplify code
  thermal: stm32: use devm_platform_ioremap_resource() to simplify code
  thermal: tango: use devm_platform_ioremap_resource() to simplify code
  thermal: thermal_mmio: use devm_platform_ioremap_resource() to
    simplify code
  thermal: zx2967: use devm_platform_ioremap_resource() to simplify code
  thermal: rcar: use devm_platform_ioremap_resource() to simplify code

 drivers/thermal/armada_thermal.c           | 4 +---
 drivers/thermal/broadcom/bcm2835_thermal.c | 4 +---
 drivers/thermal/broadcom/brcmstb_thermal.c | 4 +---
 drivers/thermal/dove_thermal.c             | 7 ++-----
 drivers/thermal/hisi_thermal.c             | 4 +---
 drivers/thermal/kirkwood_thermal.c         | 4 +---
 drivers/thermal/mtk_thermal.c              | 4 +---
 drivers/thermal/qcom/tsens-common.c        | 7 ++-----
 drivers/thermal/rcar_thermal.c             | 5 ++---
 drivers/thermal/rockchip_thermal.c         | 4 +---
 drivers/thermal/spear_thermal.c            | 4 +---
 drivers/thermal/st/stm_thermal.c           | 4 +---
 drivers/thermal/tango_thermal.c            | 4 +---
 drivers/thermal/thermal_mmio.c             | 4 +---
 drivers/thermal/zx2967_thermal.c           | 4 +---
 15 files changed, 18 insertions(+), 49 deletions(-)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH -next 01/15] thermal: armada: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-04 12:43   ` Miquel Raynal
  2019-09-04 12:29 ` [PATCH -next 02/15] thermal: bcm2835: " YueHaibing
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/armada_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index 709a22f..70fe9c6 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -708,12 +708,10 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev,
 				       struct armada_thermal_priv *priv)
 {
 	struct armada_thermal_data *data = priv->data;
-	struct resource *res;
 	void __iomem *base;
 
 	/* First memory region points towards the status register */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 02/15] thermal: bcm2835: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
  2019-09-04 12:29 ` [PATCH -next 01/15] thermal: armada: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-05 18:41   ` Stefan Wahren
  2019-09-04 12:29 ` [PATCH -next 03/15] thermal: brcmstb: " YueHaibing
                   ` (12 subsequent siblings)
  14 siblings, 1 reply; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/broadcom/bcm2835_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
index 3199977..01eec8e 100644
--- a/drivers/thermal/broadcom/bcm2835_thermal.c
+++ b/drivers/thermal/broadcom/bcm2835_thermal.c
@@ -166,7 +166,6 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
 	const struct of_device_id *match;
 	struct thermal_zone_device *tz;
 	struct bcm2835_thermal_data *data;
-	struct resource *res;
 	int err = 0;
 	u32 val;
 	unsigned long rate;
@@ -180,8 +179,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
 	if (!match)
 		return -EINVAL;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	data->regs = devm_ioremap_resource(&pdev->dev, res);
+	data->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(data->regs)) {
 		err = PTR_ERR(data->regs);
 		dev_err(&pdev->dev, "Could not get registers: %d\n", err);
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 03/15] thermal: brcmstb: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
  2019-09-04 12:29 ` [PATCH -next 01/15] thermal: armada: " YueHaibing
  2019-09-04 12:29 ` [PATCH -next 02/15] thermal: bcm2835: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-04 17:00   ` Florian Fainelli
  2019-09-04 12:29 ` [PATCH -next 04/15] thermal: hisilicon: " YueHaibing
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/broadcom/brcmstb_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c
index 5825ac5..de43c3e 100644
--- a/drivers/thermal/broadcom/brcmstb_thermal.c
+++ b/drivers/thermal/broadcom/brcmstb_thermal.c
@@ -305,15 +305,13 @@ static int brcmstb_thermal_probe(struct platform_device *pdev)
 {
 	struct thermal_zone_device *thermal;
 	struct brcmstb_thermal_priv *priv;
-	struct resource *res;
 	int irq, ret;
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->tmon_base = devm_ioremap_resource(&pdev->dev, res);
+	priv->tmon_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->tmon_base))
 		return PTR_ERR(priv->tmon_base);
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 04/15] thermal: hisilicon: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
                   ` (2 preceding siblings ...)
  2019-09-04 12:29 ` [PATCH -next 03/15] thermal: brcmstb: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-04 12:29 ` [PATCH -next 05/15] thermal: dove: " YueHaibing
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/hisi_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c
index 2d26ae8..8c0e002 100644
--- a/drivers/thermal/hisi_thermal.c
+++ b/drivers/thermal/hisi_thermal.c
@@ -557,7 +557,6 @@ static int hisi_thermal_probe(struct platform_device *pdev)
 {
 	struct hisi_thermal_data *data;
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	int i, ret;
 
 	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
@@ -568,8 +567,7 @@ static int hisi_thermal_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, data);
 	data->ops = of_device_get_match_data(dev);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	data->regs = devm_ioremap_resource(dev, res);
+	data->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(data->regs)) {
 		dev_err(dev, "failed to get io address\n");
 		return PTR_ERR(data->regs);
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 05/15] thermal: dove: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
                   ` (3 preceding siblings ...)
  2019-09-04 12:29 ` [PATCH -next 04/15] thermal: hisilicon: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-04 12:29 ` [PATCH -next 06/15] thermal: mtk: " YueHaibing
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/dove_thermal.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
index 75901ce..e53ac71 100644
--- a/drivers/thermal/dove_thermal.c
+++ b/drivers/thermal/dove_thermal.c
@@ -122,20 +122,17 @@ static int dove_thermal_probe(struct platform_device *pdev)
 {
 	struct thermal_zone_device *thermal = NULL;
 	struct dove_thermal_priv *priv;
-	struct resource *res;
 	int ret;
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->sensor = devm_ioremap_resource(&pdev->dev, res);
+	priv->sensor = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->sensor))
 		return PTR_ERR(priv->sensor);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	priv->control = devm_ioremap_resource(&pdev->dev, res);
+	priv->control = devm_platform_ioremap_resource(pdev, 1);
 	if (IS_ERR(priv->control))
 		return PTR_ERR(priv->control);
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 06/15] thermal: mtk: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
                   ` (4 preceding siblings ...)
  2019-09-04 12:29 ` [PATCH -next 05/15] thermal: dove: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-04 12:29 ` [PATCH -next 07/15] thermal: kirkwood: " YueHaibing
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/mtk_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c
index acf4854..da36271 100644
--- a/drivers/thermal/mtk_thermal.c
+++ b/drivers/thermal/mtk_thermal.c
@@ -867,7 +867,6 @@ static int mtk_thermal_probe(struct platform_device *pdev)
 	int ret, i, ctrl_id;
 	struct device_node *auxadc, *apmixedsys, *np = pdev->dev.of_node;
 	struct mtk_thermal *mt;
-	struct resource *res;
 	u64 auxadc_phys_base, apmixed_phys_base;
 	struct thermal_zone_device *tzdev;
 
@@ -885,8 +884,7 @@ static int mtk_thermal_probe(struct platform_device *pdev)
 	if (IS_ERR(mt->clk_auxadc))
 		return PTR_ERR(mt->clk_auxadc);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mt->thermal_base = devm_ioremap_resource(&pdev->dev, res);
+	mt->thermal_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mt->thermal_base))
 		return PTR_ERR(mt->thermal_base);
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 07/15] thermal: kirkwood: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
                   ` (5 preceding siblings ...)
  2019-09-04 12:29 ` [PATCH -next 06/15] thermal: mtk: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-04 12:29 ` [PATCH -next 08/15] thermal: tsens: " YueHaibing
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/kirkwood_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
index 189b675..762ef12 100644
--- a/drivers/thermal/kirkwood_thermal.c
+++ b/drivers/thermal/kirkwood_thermal.c
@@ -64,14 +64,12 @@ static int kirkwood_thermal_probe(struct platform_device *pdev)
 {
 	struct thermal_zone_device *thermal = NULL;
 	struct kirkwood_thermal_priv *priv;
-	struct resource *res;
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->sensor = devm_ioremap_resource(&pdev->dev, res);
+	priv->sensor = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->sensor))
 		return PTR_ERR(priv->sensor);
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 08/15] thermal: tsens: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
                   ` (6 preceding siblings ...)
  2019-09-04 12:29 ` [PATCH -next 07/15] thermal: kirkwood: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-04 21:50   ` Bjorn Andersson
  2019-09-05  6:15   ` Amit Kucheria
  2019-09-04 12:29 ` [PATCH -next 09/15] thermal: rockchip: " YueHaibing
                   ` (6 subsequent siblings)
  14 siblings, 2 replies; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/qcom/tsens-common.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c
index 528df88..43ce4fb 100644
--- a/drivers/thermal/qcom/tsens-common.c
+++ b/drivers/thermal/qcom/tsens-common.c
@@ -155,7 +155,6 @@ int __init init_common(struct tsens_priv *priv)
 {
 	void __iomem *tm_base, *srot_base;
 	struct device *dev = priv->dev;
-	struct resource *res;
 	u32 enabled;
 	int ret, i, j;
 	struct platform_device *op = of_find_device_by_node(priv->dev->of_node);
@@ -166,8 +165,7 @@ int __init init_common(struct tsens_priv *priv)
 	if (op->num_resources > 1) {
 		/* DT with separate SROT and TM address space */
 		priv->tm_offset = 0;
-		res = platform_get_resource(op, IORESOURCE_MEM, 1);
-		srot_base = devm_ioremap_resource(&op->dev, res);
+		srot_base = devm_platform_ioremap_resource(op, 1);
 		if (IS_ERR(srot_base)) {
 			ret = PTR_ERR(srot_base);
 			goto err_put_device;
@@ -184,8 +182,7 @@ int __init init_common(struct tsens_priv *priv)
 		priv->tm_offset = 0x1000;
 	}
 
-	res = platform_get_resource(op, IORESOURCE_MEM, 0);
-	tm_base = devm_ioremap_resource(&op->dev, res);
+	tm_base = devm_platform_ioremap_resource(op, 0);
 	if (IS_ERR(tm_base)) {
 		ret = PTR_ERR(tm_base);
 		goto err_put_device;
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 09/15] thermal: rockchip: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
                   ` (7 preceding siblings ...)
  2019-09-04 12:29 ` [PATCH -next 08/15] thermal: tsens: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-10-04 21:49   ` Heiko Stuebner
  2019-09-04 12:29 ` [PATCH -next 10/15] thermal: spear: " YueHaibing
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/rockchip_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index 343c2f5..044e6eb 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -1219,7 +1219,6 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	struct rockchip_thermal_data *thermal;
 	const struct of_device_id *match;
-	struct resource *res;
 	int irq;
 	int i;
 	int error;
@@ -1245,8 +1244,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
 	if (!thermal->chip)
 		return -EINVAL;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	thermal->regs = devm_ioremap_resource(&pdev->dev, res);
+	thermal->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(thermal->regs))
 		return PTR_ERR(thermal->regs);
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 10/15] thermal: spear: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
                   ` (8 preceding siblings ...)
  2019-09-04 12:29 ` [PATCH -next 09/15] thermal: rockchip: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-04 12:29 ` [PATCH -next 11/15] thermal: stm32: " YueHaibing
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/spear_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
index f68f581..19c690f 100644
--- a/drivers/thermal/spear_thermal.c
+++ b/drivers/thermal/spear_thermal.c
@@ -91,7 +91,6 @@ static int spear_thermal_probe(struct platform_device *pdev)
 	struct thermal_zone_device *spear_thermal = NULL;
 	struct spear_thermal_dev *stdev;
 	struct device_node *np = pdev->dev.of_node;
-	struct resource *res;
 	int ret = 0, val;
 
 	if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
@@ -104,8 +103,7 @@ static int spear_thermal_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	/* Enable thermal sensor */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	stdev->thermal_base = devm_ioremap_resource(&pdev->dev, res);
+	stdev->thermal_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(stdev->thermal_base))
 		return PTR_ERR(stdev->thermal_base);
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 11/15] thermal: stm32: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
                   ` (9 preceding siblings ...)
  2019-09-04 12:29 ` [PATCH -next 10/15] thermal: spear: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-04 12:29 ` [PATCH -next 12/15] thermal: tango: " YueHaibing
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/st/stm_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c
index cf9ddc5..a5d85f5 100644
--- a/drivers/thermal/st/stm_thermal.c
+++ b/drivers/thermal/st/stm_thermal.c
@@ -611,7 +611,6 @@ MODULE_DEVICE_TABLE(of, stm_thermal_of_match);
 static int stm_thermal_probe(struct platform_device *pdev)
 {
 	struct stm_thermal_sensor *sensor;
-	struct resource *res;
 	const struct thermal_trip *trip;
 	void __iomem *base;
 	int ret, i;
@@ -630,8 +629,7 @@ static int stm_thermal_probe(struct platform_device *pdev)
 
 	sensor->dev = &pdev->dev;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 12/15] thermal: tango: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
                   ` (10 preceding siblings ...)
  2019-09-04 12:29 ` [PATCH -next 11/15] thermal: stm32: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-05 11:06   ` Måns Rullgård
  2019-09-04 12:29 ` [PATCH -next 13/15] thermal: thermal_mmio: " YueHaibing
                   ` (2 subsequent siblings)
  14 siblings, 1 reply; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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

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



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 13/15] thermal: thermal_mmio: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
                   ` (11 preceding siblings ...)
  2019-09-04 12:29 ` [PATCH -next 12/15] thermal: tango: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-04 13:15   ` Talel Shenhar
  2019-09-04 12:29 ` [PATCH -next 14/15] thermal: zx2967: " YueHaibing
  2019-09-04 12:29 ` [PATCH -next 15/15] thermal: rcar: " YueHaibing
  14 siblings, 1 reply; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/thermal_mmio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/thermal_mmio.c b/drivers/thermal/thermal_mmio.c
index 40524fa..1663152 100644
--- a/drivers/thermal/thermal_mmio.c
+++ b/drivers/thermal/thermal_mmio.c
@@ -40,7 +40,6 @@ static struct thermal_zone_of_device_ops thermal_mmio_ops = {
 
 static int thermal_mmio_probe(struct platform_device *pdev)
 {
-	struct resource *resource;
 	struct thermal_mmio *sensor;
 	int (*sensor_init_func)(struct platform_device *pdev,
 				struct thermal_mmio *sensor);
@@ -52,8 +51,7 @@ static int thermal_mmio_probe(struct platform_device *pdev)
 	if (!sensor)
 		return -ENOMEM;
 
-	resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	sensor->mmio_base = devm_ioremap_resource(&pdev->dev, resource);
+	sensor->mmio_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(sensor->mmio_base)) {
 		dev_err(&pdev->dev, "failed to ioremap memory (%ld)\n",
 			PTR_ERR(sensor->mmio_base));
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 14/15] thermal: zx2967: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
                   ` (12 preceding siblings ...)
  2019-09-04 12:29 ` [PATCH -next 13/15] thermal: thermal_mmio: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-04 12:29 ` [PATCH -next 15/15] thermal: rcar: " YueHaibing
  14 siblings, 0 replies; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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/zx2967_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/zx2967_thermal.c b/drivers/thermal/zx2967_thermal.c
index 7c8a82c..b67e776 100644
--- a/drivers/thermal/zx2967_thermal.c
+++ b/drivers/thermal/zx2967_thermal.c
@@ -117,15 +117,13 @@ static const struct thermal_zone_of_device_ops zx2967_of_thermal_ops = {
 static int zx2967_thermal_probe(struct platform_device *pdev)
 {
 	struct zx2967_thermal_priv *priv;
-	struct resource *res;
 	int ret;
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->regs = devm_ioremap_resource(&pdev->dev, res);
+	priv->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->regs))
 		return PTR_ERR(priv->regs);
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH -next 15/15] thermal: rcar: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
                   ` (13 preceding siblings ...)
  2019-09-04 12:29 ` [PATCH -next 14/15] thermal: zx2967: " YueHaibing
@ 2019-09-04 12:29 ` YueHaibing
  2019-09-04 17:25   ` Wolfram Sang
  14 siblings, 1 reply; 25+ messages in thread
From: YueHaibing @ 2019-09-04 12:29 UTC (permalink / raw)
  To: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, yuehaibing, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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

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);
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH -next 01/15] thermal: armada: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 ` [PATCH -next 01/15] thermal: armada: " YueHaibing
@ 2019-09-04 12:43   ` Miquel Raynal
  0 siblings, 0 replies; 25+ messages in thread
From: Miquel Raynal @ 2019-09-04 12:43 UTC (permalink / raw)
  To: YueHaibing
  Cc: rui.zhang, edubezval, daniel.lezcano, amit.kucheria, eric,
	wahrenst, f.fainelli, rjui, sbranden, mmayer, computersforpeace,
	gregory.0xf0, matthias.bgg, agross, heiko, mcoquelin.stm32,
	alexandre.torgue, marc.w.gonzalez, mans, talel, jun.nie,
	shawnguo, phil, gregkh, david.hernandezsanchez, horms+renesas,
	wsa+renesas, bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

Hi Yue,

YueHaibing <yuehaibing@huawei.com> wrote on Wed, 4 Sep 2019 20:29:25
+0800:

> 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/armada_thermal.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
> index 709a22f..70fe9c6 100644
> --- a/drivers/thermal/armada_thermal.c
> +++ b/drivers/thermal/armada_thermal.c
> @@ -708,12 +708,10 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev,
>  				       struct armada_thermal_priv *priv)
>  {
>  	struct armada_thermal_data *data = priv->data;
> -	struct resource *res;
>  	void __iomem *base;
>  
>  	/* First memory region points towards the status register */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	base = devm_ioremap_resource(&pdev->dev, res);
> +	base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(base))
>  		return PTR_ERR(base);
>  

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next 13/15] thermal: thermal_mmio: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 ` [PATCH -next 13/15] thermal: thermal_mmio: " YueHaibing
@ 2019-09-04 13:15   ` Talel Shenhar
  0 siblings, 0 replies; 25+ messages in thread
From: Talel Shenhar @ 2019-09-04 13:15 UTC (permalink / raw)
  To: YueHaibing, miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	jun.nie, shawnguo, phil, gregkh, david.hernandezsanchez,
	horms+renesas, wsa+renesas, linux-pm
  Cc: bcm-kernel-feedback-list, linux-kernel, linux-rpi-kernel,
	linux-arm-kernel, linux-mediatek, linux-arm-msm, linux-rockchip,
	linux-stm32, talel, ronenk

Thanks.

Talel.

On 9/4/19 2:29 PM, 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>
Reviewed-By: Talel Shenhar <talel@amazon.com>
> ---
>   drivers/thermal/thermal_mmio.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next 03/15] thermal: brcmstb: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 ` [PATCH -next 03/15] thermal: brcmstb: " YueHaibing
@ 2019-09-04 17:00   ` Florian Fainelli
  0 siblings, 0 replies; 25+ messages in thread
From: Florian Fainelli @ 2019-09-04 17:00 UTC (permalink / raw)
  To: YueHaibing, miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, gregkh, david.hernandezsanchez,
	horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

On 9/4/19 5:29 AM, 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>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next 15/15] thermal: rcar: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 ` [PATCH -next 15/15] thermal: rcar: " YueHaibing
@ 2019-09-04 17:25   ` Wolfram Sang
  0 siblings, 0 replies; 25+ messages in thread
From: Wolfram Sang @ 2019-09-04 17:25 UTC (permalink / raw)
  To: YueHaibing
  Cc: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, gregkh, david.hernandezsanchez,
	horms+renesas, wsa+renesas, bcm-kernel-feedback-list, linux-pm,
	linux-kernel, linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

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.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next 08/15] thermal: tsens: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 ` [PATCH -next 08/15] thermal: tsens: " YueHaibing
@ 2019-09-04 21:50   ` Bjorn Andersson
  2019-09-05  6:15   ` Amit Kucheria
  1 sibling, 0 replies; 25+ messages in thread
From: Bjorn Andersson @ 2019-09-04 21:50 UTC (permalink / raw)
  To: YueHaibing
  Cc: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans,
	talel, jun.nie, shawnguo, phil, gregkh, david.hernandezsanchez,
	horms+renesas, wsa+renesas, bcm-kernel-feedback-list, linux-pm,
	linux-kernel, linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

On Wed 04 Sep 05:29 PDT 2019, YueHaibing wrote:

> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.
> 

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/thermal/qcom/tsens-common.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c
> index 528df88..43ce4fb 100644
> --- a/drivers/thermal/qcom/tsens-common.c
> +++ b/drivers/thermal/qcom/tsens-common.c
> @@ -155,7 +155,6 @@ int __init init_common(struct tsens_priv *priv)
>  {
>  	void __iomem *tm_base, *srot_base;
>  	struct device *dev = priv->dev;
> -	struct resource *res;
>  	u32 enabled;
>  	int ret, i, j;
>  	struct platform_device *op = of_find_device_by_node(priv->dev->of_node);
> @@ -166,8 +165,7 @@ int __init init_common(struct tsens_priv *priv)
>  	if (op->num_resources > 1) {
>  		/* DT with separate SROT and TM address space */
>  		priv->tm_offset = 0;
> -		res = platform_get_resource(op, IORESOURCE_MEM, 1);
> -		srot_base = devm_ioremap_resource(&op->dev, res);
> +		srot_base = devm_platform_ioremap_resource(op, 1);
>  		if (IS_ERR(srot_base)) {
>  			ret = PTR_ERR(srot_base);
>  			goto err_put_device;
> @@ -184,8 +182,7 @@ int __init init_common(struct tsens_priv *priv)
>  		priv->tm_offset = 0x1000;
>  	}
>  
> -	res = platform_get_resource(op, IORESOURCE_MEM, 0);
> -	tm_base = devm_ioremap_resource(&op->dev, res);
> +	tm_base = devm_platform_ioremap_resource(op, 0);
>  	if (IS_ERR(tm_base)) {
>  		ret = PTR_ERR(tm_base);
>  		goto err_put_device;
> -- 
> 2.7.4
> 
> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next 08/15] thermal: tsens: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 ` [PATCH -next 08/15] thermal: tsens: " YueHaibing
  2019-09-04 21:50   ` Bjorn Andersson
@ 2019-09-05  6:15   ` Amit Kucheria
  1 sibling, 0 replies; 25+ messages in thread
From: Amit Kucheria @ 2019-09-05  6:15 UTC (permalink / raw)
  To: YueHaibing
  Cc: miquel.raynal, Zhang Rui, Eduardo Valentin, Daniel Lezcano,
	Eric Anholt, wahrenst, f.fainelli, rjui, sbranden, Markus Mayer,
	computersforpeace, gregory.0xf0, Matthias Brugger, Andy Gross,
	Heiko Stuebner, mcoquelin.stm32, alexandre.torgue, Marc Gonzalez,
	mans, talel, Jun Nie, Shawn Guo, phil, gregkh,
	david.hernandezsanchez, horms+renesas, wsa+renesas,
	bcm-kernel-feedback-list, Linux PM list, LKML, linux-rpi-kernel,
	lakml, linux-mediatek, linux-arm-msm, linux-rockchip,
	linux-stm32

On Wed, Sep 4, 2019 at 6:05 PM YueHaibing <yuehaibing@huawei.com> 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>

Acked-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  drivers/thermal/qcom/tsens-common.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c
> index 528df88..43ce4fb 100644
> --- a/drivers/thermal/qcom/tsens-common.c
> +++ b/drivers/thermal/qcom/tsens-common.c
> @@ -155,7 +155,6 @@ int __init init_common(struct tsens_priv *priv)
>  {
>         void __iomem *tm_base, *srot_base;
>         struct device *dev = priv->dev;
> -       struct resource *res;
>         u32 enabled;
>         int ret, i, j;
>         struct platform_device *op = of_find_device_by_node(priv->dev->of_node);
> @@ -166,8 +165,7 @@ int __init init_common(struct tsens_priv *priv)
>         if (op->num_resources > 1) {
>                 /* DT with separate SROT and TM address space */
>                 priv->tm_offset = 0;
> -               res = platform_get_resource(op, IORESOURCE_MEM, 1);
> -               srot_base = devm_ioremap_resource(&op->dev, res);
> +               srot_base = devm_platform_ioremap_resource(op, 1);
>                 if (IS_ERR(srot_base)) {
>                         ret = PTR_ERR(srot_base);
>                         goto err_put_device;
> @@ -184,8 +182,7 @@ int __init init_common(struct tsens_priv *priv)
>                 priv->tm_offset = 0x1000;
>         }
>
> -       res = platform_get_resource(op, IORESOURCE_MEM, 0);
> -       tm_base = devm_ioremap_resource(&op->dev, res);
> +       tm_base = devm_platform_ioremap_resource(op, 0);
>         if (IS_ERR(tm_base)) {
>                 ret = PTR_ERR(tm_base);
>                 goto err_put_device;
> --
> 2.7.4
>
>

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next 12/15] thermal: tango: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 ` [PATCH -next 12/15] thermal: tango: " YueHaibing
@ 2019-09-05 11:06   ` Måns Rullgård
  0 siblings, 0 replies; 25+ messages in thread
From: Måns Rullgård @ 2019-09-05 11:06 UTC (permalink / raw)
  To: YueHaibing
  Cc: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	heiko, mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, talel,
	jun.nie, shawnguo, phil, gregkh, david.hernandezsanchez,
	horms+renesas, wsa+renesas, bcm-kernel-feedback-list, linux-pm,
	linux-kernel, linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

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
>

-- 
Måns Rullgård

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next 02/15] thermal: bcm2835: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 ` [PATCH -next 02/15] thermal: bcm2835: " YueHaibing
@ 2019-09-05 18:41   ` Stefan Wahren
  0 siblings, 0 replies; 25+ messages in thread
From: Stefan Wahren @ 2019-09-05 18:41 UTC (permalink / raw)
  To: YueHaibing, miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, f.fainelli, rjui, sbranden, mmayer,
	computersforpeace, gregory.0xf0, matthias.bgg, agross, heiko,
	mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans, talel,
	jun.nie, shawnguo, phil, gregkh, david.hernandezsanchez,
	horms+renesas, wsa+renesas
  Cc: bcm-kernel-feedback-list, linux-pm, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

Am 04.09.19 um 14:29 schrieb YueHaibing:
> 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: Stefan Wahren <wahrenst@gmx.net>

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH -next 09/15] thermal: rockchip: use devm_platform_ioremap_resource() to simplify code
  2019-09-04 12:29 ` [PATCH -next 09/15] thermal: rockchip: " YueHaibing
@ 2019-10-04 21:49   ` Heiko Stuebner
  0 siblings, 0 replies; 25+ messages in thread
From: Heiko Stuebner @ 2019-10-04 21:49 UTC (permalink / raw)
  To: YueHaibing
  Cc: miquel.raynal, rui.zhang, edubezval, daniel.lezcano,
	amit.kucheria, eric, wahrenst, f.fainelli, rjui, sbranden,
	mmayer, computersforpeace, gregory.0xf0, matthias.bgg, agross,
	mcoquelin.stm32, alexandre.torgue, marc.w.gonzalez, mans, talel,
	jun.nie, shawnguo, phil, gregkh, david.hernandezsanchez,
	horms+renesas, wsa+renesas, bcm-kernel-feedback-list, linux-pm,
	linux-kernel, linux-rpi-kernel, linux-arm-kernel, linux-mediatek,
	linux-arm-msm, linux-rockchip, linux-stm32

Am Mittwoch, 4. September 2019, 14:29:33 CEST schrieb YueHaibing:
> 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>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

> ---
>  drivers/thermal/rockchip_thermal.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
> index 343c2f5..044e6eb 100644
> --- a/drivers/thermal/rockchip_thermal.c
> +++ b/drivers/thermal/rockchip_thermal.c
> @@ -1219,7 +1219,6 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
>  	struct device_node *np = pdev->dev.of_node;
>  	struct rockchip_thermal_data *thermal;
>  	const struct of_device_id *match;
> -	struct resource *res;
>  	int irq;
>  	int i;
>  	int error;
> @@ -1245,8 +1244,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
>  	if (!thermal->chip)
>  		return -EINVAL;
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	thermal->regs = devm_ioremap_resource(&pdev->dev, res);
> +	thermal->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(thermal->regs))
>  		return PTR_ERR(thermal->regs);
>  
> 





^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2019-10-04 21:50 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 12:29 [PATCH -next 00/15] use devm_platform_ioremap_resource() to simplify code YueHaibing
2019-09-04 12:29 ` [PATCH -next 01/15] thermal: armada: " YueHaibing
2019-09-04 12:43   ` Miquel Raynal
2019-09-04 12:29 ` [PATCH -next 02/15] thermal: bcm2835: " YueHaibing
2019-09-05 18:41   ` Stefan Wahren
2019-09-04 12:29 ` [PATCH -next 03/15] thermal: brcmstb: " YueHaibing
2019-09-04 17:00   ` Florian Fainelli
2019-09-04 12:29 ` [PATCH -next 04/15] thermal: hisilicon: " YueHaibing
2019-09-04 12:29 ` [PATCH -next 05/15] thermal: dove: " YueHaibing
2019-09-04 12:29 ` [PATCH -next 06/15] thermal: mtk: " YueHaibing
2019-09-04 12:29 ` [PATCH -next 07/15] thermal: kirkwood: " YueHaibing
2019-09-04 12:29 ` [PATCH -next 08/15] thermal: tsens: " YueHaibing
2019-09-04 21:50   ` Bjorn Andersson
2019-09-05  6:15   ` Amit Kucheria
2019-09-04 12:29 ` [PATCH -next 09/15] thermal: rockchip: " YueHaibing
2019-10-04 21:49   ` Heiko Stuebner
2019-09-04 12:29 ` [PATCH -next 10/15] thermal: spear: " YueHaibing
2019-09-04 12:29 ` [PATCH -next 11/15] thermal: stm32: " YueHaibing
2019-09-04 12:29 ` [PATCH -next 12/15] thermal: tango: " YueHaibing
2019-09-05 11:06   ` Måns Rullgård
2019-09-04 12:29 ` [PATCH -next 13/15] thermal: thermal_mmio: " YueHaibing
2019-09-04 13:15   ` Talel Shenhar
2019-09-04 12:29 ` [PATCH -next 14/15] thermal: zx2967: " YueHaibing
2019-09-04 12:29 ` [PATCH -next 15/15] thermal: rcar: " YueHaibing
2019-09-04 17:25   ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).