Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Baolin Wang <baolin.wang7@gmail.com>
Link: https://lore.kernel.org/r/8f94e67b5f9af20a93418a2fc9cc71b194f1285c.1578453662.git.baolin.wang7@gmail.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

authored by

Baolin Wang and committed by
Bjorn Andersson
cb36017a 8f2a0dc8

+3 -18
+3 -18
drivers/hwspinlock/sirf_hwspinlock.c
··· 79 79 80 80 platform_set_drvdata(pdev, hwspin); 81 81 82 - return hwspin_lock_register(&hwspin->bank, &pdev->dev, 83 - &sirf_hwspinlock_ops, 0, 84 - HW_SPINLOCK_NUMBER); 85 - } 86 - 87 - static int sirf_hwspinlock_remove(struct platform_device *pdev) 88 - { 89 - struct sirf_hwspinlock *hwspin = platform_get_drvdata(pdev); 90 - int ret; 91 - 92 - ret = hwspin_lock_unregister(&hwspin->bank); 93 - if (ret) { 94 - dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret); 95 - return ret; 96 - } 97 - 98 - return 0; 82 + return devm_hwspin_lock_register(&pdev->dev, &hwspin->bank, 83 + &sirf_hwspinlock_ops, 0, 84 + HW_SPINLOCK_NUMBER); 99 85 } 100 86 101 87 static const struct of_device_id sirf_hwpinlock_ids[] = { ··· 92 106 93 107 static struct platform_driver sirf_hwspinlock_driver = { 94 108 .probe = sirf_hwspinlock_probe, 95 - .remove = sirf_hwspinlock_remove, 96 109 .driver = { 97 110 .name = "atlas7_hwspinlock", 98 111 .of_match_table = of_match_ptr(sirf_hwpinlock_ids),