Commit 49104893 authored by Yangtao Li's avatar Yangtao Li Committed by Linus Walleij

pinctrl: ti: Convert to 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: default avatarYangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230704124742.9596-4-frank.li@vivo.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 885b129f
...@@ -849,19 +849,12 @@ static int ti_iodelay_probe(struct platform_device *pdev) ...@@ -849,19 +849,12 @@ static int ti_iodelay_probe(struct platform_device *pdev)
iod->reg_data = match->data; iod->reg_data = match->data;
/* So far We can assume there is only 1 bank of registers */ /* So far We can assume there is only 1 bank of registers */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); iod->reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (!res) {
dev_err(dev, "Missing MEM resource\n");
ret = -ENODEV;
goto exit_out;
}
iod->phys_base = res->start;
iod->reg_base = devm_ioremap_resource(dev, res);
if (IS_ERR(iod->reg_base)) { if (IS_ERR(iod->reg_base)) {
ret = PTR_ERR(iod->reg_base); ret = PTR_ERR(iod->reg_base);
goto exit_out; goto exit_out;
} }
iod->phys_base = res->start;
iod->regmap = devm_regmap_init_mmio(dev, iod->reg_base, iod->regmap = devm_regmap_init_mmio(dev, iod->reg_base,
iod->reg_data->regmap_config); iod->reg_data->regmap_config);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment