usb: musb: blackfin: delete unnecessary 'out of memory' messages
[linux-2.6/btrfs-unstable.git] / include / linux / reset.h
blob349f150ae12cb4f896eea2aafc73cfcb3fcfd26c
1 #ifndef _LINUX_RESET_H_
2 #define _LINUX_RESET_H_
4 struct device;
5 struct device_node;
6 struct reset_control;
8 #ifdef CONFIG_RESET_CONTROLLER
10 int reset_control_reset(struct reset_control *rstc);
11 int reset_control_assert(struct reset_control *rstc);
12 int reset_control_deassert(struct reset_control *rstc);
14 struct reset_control *reset_control_get(struct device *dev, const char *id);
15 void reset_control_put(struct reset_control *rstc);
16 struct reset_control *devm_reset_control_get(struct device *dev, const char *id);
18 int __must_check device_reset(struct device *dev);
20 static inline int device_reset_optional(struct device *dev)
22 return device_reset(dev);
25 static inline struct reset_control *reset_control_get_optional(
26 struct device *dev, const char *id)
28 return reset_control_get(dev, id);
31 static inline struct reset_control *devm_reset_control_get_optional(
32 struct device *dev, const char *id)
34 return devm_reset_control_get(dev, id);
37 struct reset_control *of_reset_control_get(struct device_node *node,
38 const char *id);
40 #else
42 static inline int reset_control_reset(struct reset_control *rstc)
44 WARN_ON(1);
45 return 0;
48 static inline int reset_control_assert(struct reset_control *rstc)
50 WARN_ON(1);
51 return 0;
54 static inline int reset_control_deassert(struct reset_control *rstc)
56 WARN_ON(1);
57 return 0;
60 static inline void reset_control_put(struct reset_control *rstc)
62 WARN_ON(1);
65 static inline int device_reset_optional(struct device *dev)
67 return -ENOSYS;
70 static inline struct reset_control *reset_control_get_optional(
71 struct device *dev, const char *id)
73 return ERR_PTR(-ENOSYS);
76 static inline struct reset_control *devm_reset_control_get_optional(
77 struct device *dev, const char *id)
79 return ERR_PTR(-ENOSYS);
82 static inline struct reset_control *of_reset_control_get(
83 struct device_node *node, const char *id)
85 return ERR_PTR(-ENOSYS);
88 #endif /* CONFIG_RESET_CONTROLLER */
90 #endif