]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/reset.h
mm/hotplug: invalid PFNs from pfn_to_online_page()
[mirror_ubuntu-bionic-kernel.git] / include / linux / reset.h
index 4c7871ddf3c65365bb0609ab42a71a18edcf65a7..ed6fb029079778322b6d44c4fa43fc82bfe9b3d8 100644 (file)
@@ -20,22 +20,16 @@ struct reset_control *__reset_control_get(struct device *dev, const char *id,
                                          int index, bool shared,
                                          bool optional);
 void reset_control_put(struct reset_control *rstc);
+int __device_reset(struct device *dev, bool optional);
 struct reset_control *__devm_reset_control_get(struct device *dev,
                                     const char *id, int index, bool shared,
                                     bool optional);
 
-int __must_check device_reset(struct device *dev);
-
 struct reset_control *devm_reset_control_array_get(struct device *dev,
                                                   bool shared, bool optional);
 struct reset_control *of_reset_control_array_get(struct device_node *np,
                                                 bool shared, bool optional);
 
-static inline int device_reset_optional(struct device *dev)
-{
-       return device_reset(dev);
-}
-
 #else
 
 static inline int reset_control_reset(struct reset_control *rstc)
@@ -62,15 +56,9 @@ static inline void reset_control_put(struct reset_control *rstc)
 {
 }
 
-static inline int __must_check device_reset(struct device *dev)
-{
-       WARN_ON(1);
-       return -ENOTSUPP;
-}
-
-static inline int device_reset_optional(struct device *dev)
+static inline int __device_reset(struct device *dev, bool optional)
 {
-       return -ENOTSUPP;
+       return optional ? 0 : -ENOTSUPP;
 }
 
 static inline struct reset_control *__of_reset_control_get(
@@ -109,6 +97,16 @@ of_reset_control_array_get(struct device_node *np, bool shared, bool optional)
 
 #endif /* CONFIG_RESET_CONTROLLER */
 
+static inline int __must_check device_reset(struct device *dev)
+{
+       return __device_reset(dev, false);
+}
+
+static inline int device_reset_optional(struct device *dev)
+{
+       return __device_reset(dev, true);
+}
+
 /**
  * reset_control_get_exclusive - Lookup and obtain an exclusive reference
  *                               to a reset controller.
@@ -127,9 +125,6 @@ of_reset_control_array_get(struct device_node *np, bool shared, bool optional)
 static inline struct reset_control *
 __must_check reset_control_get_exclusive(struct device *dev, const char *id)
 {
-#ifndef CONFIG_RESET_CONTROLLER
-       WARN_ON(1);
-#endif
        return __reset_control_get(dev, id, 0, false, false);
 }
 
@@ -275,9 +270,6 @@ static inline struct reset_control *
 __must_check devm_reset_control_get_exclusive(struct device *dev,
                                              const char *id)
 {
-#ifndef CONFIG_RESET_CONTROLLER
-       WARN_ON(1);
-#endif
        return __devm_reset_control_get(dev, id, 0, false, false);
 }