]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/hwspinlock/sirf_hwspinlock.c
net: thunderx: use proper interface type for RGMII
[linux.git] / drivers / hwspinlock / sirf_hwspinlock.c
index 8cb5fd41f236bc83b83c80622ab7a7987fbb6d66..823d3c4f621ed5ca83ce6d071a15413486d0a9aa 100644 (file)
@@ -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;
@@ -80,36 +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);
-
-       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);
-
-       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[] = {
@@ -120,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),