Commit b674a30b authored by Baolin Wang's avatar Baolin Wang Committed by Bjorn Andersson

hwspinlock: sprd: Use devm_hwspin_lock_register() to register hwlock controller

Use devm_hwspin_lock_register() to register the hwlock controller instead of
unregistering the hwlock controller explicitly when removing the device.
Signed-off-by: default avatarBaolin Wang <baolin.wang@linaro.org>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent b4d64193
...@@ -135,8 +135,9 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev) ...@@ -135,8 +135,9 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, sprd_hwlock); platform_set_drvdata(pdev, sprd_hwlock);
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
ret = hwspin_lock_register(&sprd_hwlock->bank, &pdev->dev, ret = devm_hwspin_lock_register(&pdev->dev, &sprd_hwlock->bank,
&sprd_hwspinlock_ops, 0, SPRD_HWLOCKS_NUM); &sprd_hwspinlock_ops, 0,
SPRD_HWLOCKS_NUM);
if (ret) { if (ret) {
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
return ret; return ret;
...@@ -147,9 +148,6 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev) ...@@ -147,9 +148,6 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev)
static int sprd_hwspinlock_remove(struct platform_device *pdev) static int sprd_hwspinlock_remove(struct platform_device *pdev)
{ {
struct sprd_hwspinlock_dev *sprd_hwlock = platform_get_drvdata(pdev);
hwspin_lock_unregister(&sprd_hwlock->bank);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment