OSDN Git Service

base: make device_{online,offline} no op
authorwloot <wlootlxt123@gmail.com>
Sat, 29 Jun 2019 15:34:40 +0000 (23:34 +0800)
committer0ranko0P <ranko0p@outlook.com>
Wed, 4 Dec 2019 17:16:45 +0000 (01:16 +0800)
drivers/base/core.c

index 146d8c0..e9ccae7 100644 (file)
@@ -1576,6 +1576,7 @@ int __init devices_init(void)
        return -ENOMEM;
 }
 
+#if 0
 static int device_check_offline(struct device *dev, void *not_used)
 {
        int ret;
@@ -1586,6 +1587,7 @@ static int device_check_offline(struct device *dev, void *not_used)
 
        return device_supports_offline(dev) && !dev->offline ? -EBUSY : 0;
 }
+#endif
 
 /**
  * device_offline - Prepare the device for hot-removal.
@@ -1600,8 +1602,9 @@ static int device_check_offline(struct device *dev, void *not_used)
  */
 int device_offline(struct device *dev)
 {
-       int ret;
+       int ret = 0;
 
+#if 0
        if (dev->offline_disabled)
                return -EPERM;
 
@@ -1622,6 +1625,7 @@ int device_offline(struct device *dev)
                }
        }
        device_unlock(dev);
+#endif
 
        return ret;
 }
@@ -1640,6 +1644,7 @@ int device_online(struct device *dev)
 {
        int ret = 0;
 
+#if 0
        device_lock(dev);
        if (device_supports_offline(dev)) {
                if (dev->offline) {
@@ -1653,6 +1658,7 @@ int device_online(struct device *dev)
                }
        }
        device_unlock(dev);
+#endif
 
        return ret;
 }