Skip to contentSkip to conversation

thermal: use devm_platform_get_and_ioremap_resource()

PATCH Applied [email protected] 3 participants 3 messages Nov 17, 2022 – Dec 9, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: use devm_platform_get_and_ioremap_resource()

From: Minghao Chi <[email protected]>

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.

---
 drivers/thermal/st/stm_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/thermal/st/stm_thermal.c +1 -3
index 78feb802a87d..e7834ccc7976 100644
@@ -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);
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 9 lines · On 17/11/2022 07:09, [email protected] wrote:

From: Minghao Chi <[email protected]>

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.

---

Applied, thanks

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
merge bot Applied
#2 lore raw

[thermal: thermal/next] thermal/drivers/st: Use devm_platform_get_and_ioremap_resource()

In reply to [email protected]
The following commit has been merged into the thermal/next branch of thermal:

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 <[email protected]>
AuthorDate:    Thu, 17 Nov 2022 14:09:52 +08:00
Committer:     Daniel Lezcano <[email protected]>
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.

---
 drivers/thermal/st/stm_thermal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/thermal/st/stm_thermal.c +1 -3
index 78feb80..e7834cc 100644
@@ -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);