diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-02-04 09:04:37 +0000 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-02-04 09:04:37 +0000 |
commit | 685097986b5ef8b8c4b19dbb6a1d6069c3626ba2 (patch) | |
tree | 3222af0faac431c264b9c6baf4cf59020b400e5e /drivers/hwspinlock/sirf_hwspinlock.c | |
parent | Merge branch 'akpm' (patches from Andrew) (diff) | |
parent | hwspinlock: sirf: Use devm_hwspin_lock_register() to register hwlock controller (diff) | |
download | linux-dev-685097986b5ef8b8c4b19dbb6a1d6069c3626ba2.tar.xz linux-dev-685097986b5ef8b8c4b19dbb6a1d6069c3626ba2.zip |
Merge tag 'hwlock-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc
Pull hwspinlock updates from Bjorn Andersson:
"This continues the transition of drivers to device managed resources
and removal of unnecessary PM runtime integration, with cleanups to
the SIRF, OMAP and Qualcomm hwspinlock drivers.
It also adds Baolin as reviewer in MAINTAINERS"
* tag 'hwlock-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc:
hwspinlock: sirf: Use devm_hwspin_lock_register() to register hwlock controller
hwspinlock: sirf: Remove redundant PM runtime functions
hwspinlock: sirf: Change to use devm_platform_ioremap_resource()
hwspinlock: omap: Use devm_kzalloc() to allocate memory
hwspinlock: omap: Change to use devm_platform_ioremap_resource()
hwspinlock: qcom: Use devm_hwspin_lock_register() to register hwlock controller
hwspinlock: qcom: Remove redundant PM runtime functions
hwspinlock: stm32: convert to devm_platform_ioremap_resource
MAINTAINERS: Add myself as reviewer for the hwspinlock subsystem
Diffstat (limited to 'drivers/hwspinlock/sirf_hwspinlock.c')
-rw-r--r-- | drivers/hwspinlock/sirf_hwspinlock.c | 46 |
1 files changed, 7 insertions, 39 deletions
diff --git a/drivers/hwspinlock/sirf_hwspinlock.c b/drivers/hwspinlock/sirf_hwspinlock.c index 1f625cd68c50..823d3c4f621e 100644 --- a/drivers/hwspinlock/sirf_hwspinlock.c +++ b/drivers/hwspinlock/sirf_hwspinlock.c @@ -9,7 +9,6 @@ #include <linux/module.h> #include <linux/device.h> #include <linux/io.h> -#include <linux/pm_runtime.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/hwspinlock.h> @@ -56,7 +55,7 @@ static int sirf_hwspinlock_probe(struct platform_device *pdev) { struct sirf_hwspinlock *hwspin; struct hwspinlock *hwlock; - int idx, ret; + int idx; if (!pdev->dev.of_node) return -ENODEV; @@ -69,9 +68,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]; @@ -80,39 +79,9 @@ static int sirf_hwspinlock_probe(struct platform_device *pdev) platform_set_drvdata(pdev, hwspin); - pm_runtime_enable(&pdev->dev); - - ret = hwspin_lock_register(&hwspin->bank, &pdev->dev, - &sirf_hwspinlock_ops, 0, - HW_SPINLOCK_NUMBER); - if (ret) - goto reg_failed; - - return 0; - -reg_failed: - pm_runtime_disable(&pdev->dev); - iounmap(hwspin->io_base); - - return ret; -} - -static int sirf_hwspinlock_remove(struct platform_device *pdev) -{ - struct sirf_hwspinlock *hwspin = platform_get_drvdata(pdev); - int ret; - - ret = hwspin_lock_unregister(&hwspin->bank); - if (ret) { - dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret); - return ret; - } - - pm_runtime_disable(&pdev->dev); - - iounmap(hwspin->io_base); - - return 0; + return devm_hwspin_lock_register(&pdev->dev, &hwspin->bank, + &sirf_hwspinlock_ops, 0, + HW_SPINLOCK_NUMBER); } static const struct of_device_id sirf_hwpinlock_ids[] = { @@ -123,7 +92,6 @@ MODULE_DEVICE_TABLE(of, sirf_hwpinlock_ids); static struct platform_driver sirf_hwspinlock_driver = { .probe = sirf_hwspinlock_probe, - .remove = sirf_hwspinlock_remove, .driver = { .name = "atlas7_hwspinlock", .of_match_table = of_match_ptr(sirf_hwpinlock_ids), |