提交 2484b632 编写于 作者: Y ye xingchen 提交者: Daniel Lezcano

thermal/drivers/rockchip: 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: Nye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/202301181639300333679@zte.com.cnSigned-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
上级 f7f6d371
...@@ -1354,7 +1354,6 @@ static int rockchip_thermal_probe(struct platform_device *pdev) ...@@ -1354,7 +1354,6 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct rockchip_thermal_data *thermal; struct rockchip_thermal_data *thermal;
const struct of_device_id *match; const struct of_device_id *match;
struct resource *res;
int irq; int irq;
int i; int i;
int error; int error;
...@@ -1378,8 +1377,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev) ...@@ -1378,8 +1377,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
if (!thermal->chip) if (!thermal->chip)
return -EINVAL; return -EINVAL;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); thermal->regs = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
thermal->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(thermal->regs)) if (IS_ERR(thermal->regs))
return PTR_ERR(thermal->regs); return PTR_ERR(thermal->regs);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册