All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2] thermal: st: Use devm_platform_get_and_ioremap_resource()
@ 2021-06-05 12:02 Yang Yingliang
  2021-06-21  9:46 ` [thermal: thermal/next] thermal/drivers/st: " thermal-bot for Yang Yingliang
  0 siblings, 1 reply; 3+ messages in thread
From: Yang Yingliang @ 2021-06-05 12:02 UTC (permalink / raw)
  To: linux-kernel, linux-pm; +Cc: rui.zhang, daniel.lezcano, amitk

Use devm_platform_get_and_ioremap_resource() to simplify
code and remove error message which within
devm_platform_get_and_ioremap_resource() already.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
v2:
 remove 'res'
---
 drivers/thermal/st/st_thermal_memmap.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/thermal/st/st_thermal_memmap.c b/drivers/thermal/st/st_thermal_memmap.c
index a0114452d11f..d68596c40be9 100644
--- a/drivers/thermal/st/st_thermal_memmap.c
+++ b/drivers/thermal/st/st_thermal_memmap.c
@@ -119,19 +119,10 @@ static int st_mmap_regmap_init(struct st_thermal_sensor *sensor)
 {
 	struct device *dev = sensor->dev;
 	struct platform_device *pdev = to_platform_device(dev);
-	struct resource *res;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "no memory resources defined\n");
-		return -ENODEV;
-	}
-
-	sensor->mmio_base = devm_ioremap_resource(dev, res);
-	if (IS_ERR(sensor->mmio_base)) {
-		dev_err(dev, "failed to remap IO\n");
+	sensor->mmio_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
+	if (IS_ERR(sensor->mmio_base))
 		return PTR_ERR(sensor->mmio_base);
-	}
 
 	sensor->regmap = devm_regmap_init_mmio(dev, sensor->mmio_base,
 				&st_416mpe_regmap_config);
-- 
2.25.1


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

* [thermal: thermal/next] thermal/drivers/st: Use devm_platform_get_and_ioremap_resource()
  2021-06-05 12:02 [PATCH net-next v2] thermal: st: Use devm_platform_get_and_ioremap_resource() Yang Yingliang
@ 2021-06-21  9:46 ` thermal-bot for Yang Yingliang
  0 siblings, 0 replies; 3+ messages in thread
From: thermal-bot for Yang Yingliang @ 2021-06-21  9:46 UTC (permalink / raw)
  To: linux-pm; +Cc: Yang Yingliang, Daniel Lezcano, rui.zhang, amitk

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     d7539260cd9ad9c18eaf2a1ff71401abdbdfb5cb
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//d7539260cd9ad9c18eaf2a1ff71401abdbdfb5cb
Author:        Yang Yingliang <yangyingliang@huawei.com>
AuthorDate:    Sat, 05 Jun 2021 20:02:05 +08:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Mon, 14 Jun 2021 19:01:15 +02:00

thermal/drivers/st: Use devm_platform_get_and_ioremap_resource()

Use devm_platform_get_and_ioremap_resource() to simplify
code and remove error message which within
devm_platform_get_and_ioremap_resource() already.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210605120205.2459578-1-yangyingliang@huawei.com
---
 drivers/thermal/st/st_thermal_memmap.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/thermal/st/st_thermal_memmap.c b/drivers/thermal/st/st_thermal_memmap.c
index a011445..d68596c 100644
--- a/drivers/thermal/st/st_thermal_memmap.c
+++ b/drivers/thermal/st/st_thermal_memmap.c
@@ -119,19 +119,10 @@ static int st_mmap_regmap_init(struct st_thermal_sensor *sensor)
 {
 	struct device *dev = sensor->dev;
 	struct platform_device *pdev = to_platform_device(dev);
-	struct resource *res;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "no memory resources defined\n");
-		return -ENODEV;
-	}
-
-	sensor->mmio_base = devm_ioremap_resource(dev, res);
-	if (IS_ERR(sensor->mmio_base)) {
-		dev_err(dev, "failed to remap IO\n");
+	sensor->mmio_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
+	if (IS_ERR(sensor->mmio_base))
 		return PTR_ERR(sensor->mmio_base);
-	}
 
 	sensor->regmap = devm_regmap_init_mmio(dev, sensor->mmio_base,
 				&st_416mpe_regmap_config);

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

* [thermal: thermal/next] thermal/drivers/st: Use devm_platform_get_and_ioremap_resource()
  2022-11-17  6:09 [PATCH] thermal: use devm_platform_get_and_ioremap_resource() ye.xingchen
@ 2022-12-09 15:26 ` thermal-bot for Minghao Chi
  0 siblings, 0 replies; 3+ messages in thread
From: thermal-bot for Minghao Chi @ 2022-12-09 15:26 UTC (permalink / raw)
  To: linux-pm
  Cc: Minghao Chi, ye xingchen, Daniel Lezcano, rui.zhang,
	daniel.lezcano, amitk

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     ca756c11c40f8309b50114ed637dc14904ddcfa3
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//ca756c11c40f8309b50114ed637dc14904ddcfa3
Author:        Minghao Chi <chi.minghao@zte.com.cn>
AuthorDate:    Thu, 17 Nov 2022 14:09:52 +08:00
Committer:     Daniel Lezcano <daniel.lezcano@kernel.org>
CommitterDate: Thu, 08 Dec 2022 14:30:45 +01:00

thermal/drivers/st: Use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/202211171409524332954@zte.com.cn
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
---
 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 78feb80..e7834cc 100644
--- a/drivers/thermal/st/stm_thermal.c
+++ b/drivers/thermal/st/stm_thermal.c
@@ -488,7 +488,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;
 	void __iomem *base;
 	int ret;
 
@@ -506,8 +505,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_get_and_ioremap_resource(pdev, 0, NULL);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 

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

end of thread, other threads:[~2022-12-09 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-05 12:02 [PATCH net-next v2] thermal: st: Use devm_platform_get_and_ioremap_resource() Yang Yingliang
2021-06-21  9:46 ` [thermal: thermal/next] thermal/drivers/st: " thermal-bot for Yang Yingliang
2022-11-17  6:09 [PATCH] thermal: use devm_platform_get_and_ioremap_resource() ye.xingchen
2022-12-09 15:26 ` [thermal: thermal/next] thermal/drivers/st: Use devm_platform_get_and_ioremap_resource() thermal-bot for Minghao Chi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.