Commit 5542c7cf authored by Yangtao Li's avatar Yangtao Li Committed by Nishanth Menon

soc: ti: omap-prm: 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: default avatarYangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230705122644.32236-1-frank.li@vivo.comSigned-off-by: default avatarNishanth Menon <nm@ti.com>
parent bffd3a80
......@@ -943,10 +943,6 @@ static int omap_prm_probe(struct platform_device *pdev)
struct omap_prm *prm;
int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
data = of_device_get_match_data(&pdev->dev);
if (!data)
return -ENOTSUPP;
......@@ -955,6 +951,10 @@ static int omap_prm_probe(struct platform_device *pdev)
if (!prm)
return -ENOMEM;
prm->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(prm->base))
return PTR_ERR(prm->base);
while (data->base != res->start) {
if (!data->base)
return -EINVAL;
......@@ -963,10 +963,6 @@ static int omap_prm_probe(struct platform_device *pdev)
prm->data = data;
prm->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(prm->base))
return PTR_ERR(prm->base);
ret = omap_prm_domain_init(&pdev->dev, prm);
if (ret)
return ret;
......
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