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

hwspinlock: sirf: 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.wang7@gmail.com>
Link: https://lore.kernel.org/r/8f94e67b5f9af20a93418a2fc9cc71b194f1285c.1578453662.git.baolin.wang7@gmail.comSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 8f2a0dc8
...@@ -79,25 +79,11 @@ static int sirf_hwspinlock_probe(struct platform_device *pdev) ...@@ -79,25 +79,11 @@ static int sirf_hwspinlock_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, hwspin); platform_set_drvdata(pdev, hwspin);
return hwspin_lock_register(&hwspin->bank, &pdev->dev, return devm_hwspin_lock_register(&pdev->dev, &hwspin->bank,
&sirf_hwspinlock_ops, 0, &sirf_hwspinlock_ops, 0,
HW_SPINLOCK_NUMBER); HW_SPINLOCK_NUMBER);
} }
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;
}
return 0;
}
static const struct of_device_id sirf_hwpinlock_ids[] = { static const struct of_device_id sirf_hwpinlock_ids[] = {
{ .compatible = "sirf,hwspinlock", }, { .compatible = "sirf,hwspinlock", },
{}, {},
...@@ -106,7 +92,6 @@ MODULE_DEVICE_TABLE(of, sirf_hwpinlock_ids); ...@@ -106,7 +92,6 @@ MODULE_DEVICE_TABLE(of, sirf_hwpinlock_ids);
static struct platform_driver sirf_hwspinlock_driver = { static struct platform_driver sirf_hwspinlock_driver = {
.probe = sirf_hwspinlock_probe, .probe = sirf_hwspinlock_probe,
.remove = sirf_hwspinlock_remove,
.driver = { .driver = {
.name = "atlas7_hwspinlock", .name = "atlas7_hwspinlock",
.of_match_table = of_match_ptr(sirf_hwpinlock_ids), .of_match_table = of_match_ptr(sirf_hwpinlock_ids),
......
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