Skip to content

Commit 5542c7c

Browse files
bbkzznmenon
authored andcommitted
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: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230705122644.32236-1-frank.li@vivo.com Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent bffd3a8 commit 5542c7c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/soc/ti/omap_prm.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -943,10 +943,6 @@ static int omap_prm_probe(struct platform_device *pdev)
943943
struct omap_prm *prm;
944944
int ret;
945945

946-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
947-
if (!res)
948-
return -ENODEV;
949-
950946
data = of_device_get_match_data(&pdev->dev);
951947
if (!data)
952948
return -ENOTSUPP;
@@ -955,6 +951,10 @@ static int omap_prm_probe(struct platform_device *pdev)
955951
if (!prm)
956952
return -ENOMEM;
957953

954+
prm->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
955+
if (IS_ERR(prm->base))
956+
return PTR_ERR(prm->base);
957+
958958
while (data->base != res->start) {
959959
if (!data->base)
960960
return -EINVAL;
@@ -963,10 +963,6 @@ static int omap_prm_probe(struct platform_device *pdev)
963963

964964
prm->data = data;
965965

966-
prm->base = devm_ioremap_resource(&pdev->dev, res);
967-
if (IS_ERR(prm->base))
968-
return PTR_ERR(prm->base);
969-
970966
ret = omap_prm_domain_init(&pdev->dev, prm);
971967
if (ret)
972968
return ret;

0 commit comments

Comments
 (0)