summaryrefslogtreecommitdiff
path: root/drivers/hwspinlock/sirf_hwspinlock.c
diff options
context:
space:
mode:
authorBaolin Wang <baolin.wang7@gmail.com>2020-01-08 11:23:44 +0800
committerBjorn Andersson <bjorn.andersson@linaro.org>2020-01-21 16:16:16 -0800
commit77d99a6a9df2ac3d1832b408123e48549d1e01fd (patch)
treefcba3092d79496dd6a88391be737ea56d8a8f012 /drivers/hwspinlock/sirf_hwspinlock.c
parent42f291ebfdd83a5bf04254f6bdc169f6e5a4152b (diff)
hwspinlock: sirf: Change to use devm_platform_ioremap_resource()
Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together, which can simpify the code. Signed-off-by: Baolin Wang <baolin.wang7@gmail.com> Link: https://lore.kernel.org/r/dfa043f317c609a6172468ac11598968dd751bce.1578453662.git.baolin.wang7@gmail.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/hwspinlock/sirf_hwspinlock.c')
-rw-r--r--drivers/hwspinlock/sirf_hwspinlock.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/hwspinlock/sirf_hwspinlock.c b/drivers/hwspinlock/sirf_hwspinlock.c
index 1f625cd68c50..8cb5fd41f236 100644
--- a/drivers/hwspinlock/sirf_hwspinlock.c
+++ b/drivers/hwspinlock/sirf_hwspinlock.c
@@ -69,9 +69,9 @@ static int sirf_hwspinlock_probe(struct platform_device *pdev)
return -ENOMEM;
/* retrieve io base */
- hwspin->io_base = of_iomap(pdev->dev.of_node, 0);
- if (!hwspin->io_base)
- return -ENOMEM;
+ hwspin->io_base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(hwspin->io_base))
+ return PTR_ERR(hwspin->io_base);
for (idx = 0; idx < HW_SPINLOCK_NUMBER; idx++) {
hwlock = &hwspin->bank.lock[idx];
@@ -92,7 +92,6 @@ static int sirf_hwspinlock_probe(struct platform_device *pdev)
reg_failed:
pm_runtime_disable(&pdev->dev);
- iounmap(hwspin->io_base);
return ret;
}
@@ -110,8 +109,6 @@ static int sirf_hwspinlock_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
- iounmap(hwspin->io_base);
-
return 0;
}