Skip to content

Commit 33dc955

Browse files
Minghao ChiDaniel Lezcano
authored andcommitted
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 <[email protected]> Signed-off-by: ye xingchen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent bf438ed commit 33dc955

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/thermal/st/stm_thermal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,6 @@ MODULE_DEVICE_TABLE(of, stm_thermal_of_match);
488488
static int stm_thermal_probe(struct platform_device *pdev)
489489
{
490490
struct stm_thermal_sensor *sensor;
491-
struct resource *res;
492491
void __iomem *base;
493492
int ret;
494493

@@ -506,8 +505,7 @@ static int stm_thermal_probe(struct platform_device *pdev)
506505

507506
sensor->dev = &pdev->dev;
508507

509-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
510-
base = devm_ioremap_resource(&pdev->dev, res);
508+
base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
511509
if (IS_ERR(base))
512510
return PTR_ERR(base);
513511

0 commit comments

Comments
 (0)