diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-07-05 14:26:39 +0200 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2023-07-25 13:26:12 +0200 |
commit | 5542c7cfc1082608959b4317ab7c3867b5f4aa7c (patch) | |
tree | ce0da67d2e69c675eb140c80584d0f2a7be30612 /drivers/soc | |
parent | soc: ti: k3-ringacc: Fixup documentation errors (diff) | |
download | linux-5542c7cfc1082608959b4317ab7c3867b5f4aa7c.tar.xz linux-5542c7cfc1082608959b4317ab7c3867b5f4aa7c.zip |
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>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/ti/omap_prm.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c index ecd9a8bdd7c0..b2cf0a1810b9 100644 --- a/drivers/soc/ti/omap_prm.c +++ b/drivers/soc/ti/omap_prm.c @@ -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; |