Skip to content

Commit b5d6ec4

Browse files
ye xingchendlezcano
authored andcommitted
thermal/drivers/dove: 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 142887e commit b5d6ec4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/thermal/dove_thermal.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,17 @@ static int dove_thermal_probe(struct platform_device *pdev)
122122
{
123123
struct thermal_zone_device *thermal = NULL;
124124
struct dove_thermal_priv *priv;
125-
struct resource *res;
126125
int ret;
127126

128127
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
129128
if (!priv)
130129
return -ENOMEM;
131130

132-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
133-
priv->sensor = devm_ioremap_resource(&pdev->dev, res);
131+
priv->sensor = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
134132
if (IS_ERR(priv->sensor))
135133
return PTR_ERR(priv->sensor);
136134

137-
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
138-
priv->control = devm_ioremap_resource(&pdev->dev, res);
135+
priv->control = devm_platform_get_and_ioremap_resource(pdev, 1, NULL);
139136
if (IS_ERR(priv->control))
140137
return PTR_ERR(priv->control);
141138

0 commit comments

Comments
 (0)