mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 02:15:57 +00:00
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>
This commit is contained in:
parent
42f291ebfd
commit
77d99a6a9d
@ -69,9 +69,9 @@ static int sirf_hwspinlock_probe(struct platform_device *pdev)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* retrieve io base */
|
/* retrieve io base */
|
||||||
hwspin->io_base = of_iomap(pdev->dev.of_node, 0);
|
hwspin->io_base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (!hwspin->io_base)
|
if (IS_ERR(hwspin->io_base))
|
||||||
return -ENOMEM;
|
return PTR_ERR(hwspin->io_base);
|
||||||
|
|
||||||
for (idx = 0; idx < HW_SPINLOCK_NUMBER; idx++) {
|
for (idx = 0; idx < HW_SPINLOCK_NUMBER; idx++) {
|
||||||
hwlock = &hwspin->bank.lock[idx];
|
hwlock = &hwspin->bank.lock[idx];
|
||||||
@ -92,7 +92,6 @@ static int sirf_hwspinlock_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
reg_failed:
|
reg_failed:
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
iounmap(hwspin->io_base);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -110,8 +109,6 @@ static int sirf_hwspinlock_remove(struct platform_device *pdev)
|
|||||||
|
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
|
|
||||||
iounmap(hwspin->io_base);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user