Skip to content

Commit c818c6d

Browse files
ye xingchendlezcano
authored andcommitted
thermal/drivers/thermal_mmio: 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 2484b63 commit c818c6d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/thermal/thermal_mmio.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ static const struct thermal_zone_device_ops thermal_mmio_ops = {
3939

4040
static int thermal_mmio_probe(struct platform_device *pdev)
4141
{
42-
struct resource *resource;
4342
struct thermal_mmio *sensor;
4443
int (*sensor_init_func)(struct platform_device *pdev,
4544
struct thermal_mmio *sensor);
@@ -51,8 +50,7 @@ static int thermal_mmio_probe(struct platform_device *pdev)
5150
if (!sensor)
5251
return -ENOMEM;
5352

54-
resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
55-
sensor->mmio_base = devm_ioremap_resource(&pdev->dev, resource);
53+
sensor->mmio_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
5654
if (IS_ERR(sensor->mmio_base))
5755
return PTR_ERR(sensor->mmio_base);
5856

0 commit comments

Comments
 (0)