Skip to content

Commit f8887fd

Browse files
ye xingchendlezcano
authored andcommitted
thermal/drivers/spear: 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: ye xingchen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent 821e430 commit f8887fd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/thermal/spear_thermal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ static int spear_thermal_probe(struct platform_device *pdev)
9191
struct thermal_zone_device *spear_thermal = NULL;
9292
struct spear_thermal_dev *stdev;
9393
struct device_node *np = pdev->dev.of_node;
94-
struct resource *res;
9594
int ret = 0, val;
9695

9796
if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
@@ -104,8 +103,7 @@ static int spear_thermal_probe(struct platform_device *pdev)
104103
return -ENOMEM;
105104

106105
/* Enable thermal sensor */
107-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
108-
stdev->thermal_base = devm_ioremap_resource(&pdev->dev, res);
106+
stdev->thermal_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
109107
if (IS_ERR(stdev->thermal_base))
110108
return PTR_ERR(stdev->thermal_base);
111109

0 commit comments

Comments
 (0)