diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2017-03-20 06:25:16 -0400 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2017-03-21 13:19:43 -0400 |
commit | 0ca10b60ceeb5372da01798ca68c116ae45a6eb6 (patch) | |
tree | f287a4b83d49fffc1a7adcf50a941bf37907c776 /include/linux/reset.h | |
parent | c1ae3cfa0e89fa1a7ecc4c99031f5e9ae99d9201 (diff) |
reset: fix optional reset_control_get stubs to return NULL
When RESET_CONTROLLER is not enabled, the optional reset_control_get
stubs should now also return NULL.
Since it is now valid for reset_control_assert/deassert/reset/status/put
to be called unconditionally, with NULL as an argument for optional
resets, the stubs are not allowed to warn anymore.
Fixes: bb475230b8e5 ("reset: make optional functions really optional")
Reported-by: Andrzej Hajda <a.hajda@samsung.com>
Tested-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Cc: Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'include/linux/reset.h')
-rw-r--r-- | include/linux/reset.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/include/linux/reset.h b/include/linux/reset.h index 86b4ed75359e..96fb139bdd08 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h | |||
@@ -31,31 +31,26 @@ static inline int device_reset_optional(struct device *dev) | |||
31 | 31 | ||
32 | static inline int reset_control_reset(struct reset_control *rstc) | 32 | static inline int reset_control_reset(struct reset_control *rstc) |
33 | { | 33 | { |
34 | WARN_ON(1); | ||
35 | return 0; | 34 | return 0; |
36 | } | 35 | } |
37 | 36 | ||
38 | static inline int reset_control_assert(struct reset_control *rstc) | 37 | static inline int reset_control_assert(struct reset_control *rstc) |
39 | { | 38 | { |
40 | WARN_ON(1); | ||
41 | return 0; | 39 | return 0; |
42 | } | 40 | } |
43 | 41 | ||
44 | static inline int reset_control_deassert(struct reset_control *rstc) | 42 | static inline int reset_control_deassert(struct reset_control *rstc) |
45 | { | 43 | { |
46 | WARN_ON(1); | ||
47 | return 0; | 44 | return 0; |
48 | } | 45 | } |
49 | 46 | ||
50 | static inline int reset_control_status(struct reset_control *rstc) | 47 | static inline int reset_control_status(struct reset_control *rstc) |
51 | { | 48 | { |
52 | WARN_ON(1); | ||
53 | return 0; | 49 | return 0; |
54 | } | 50 | } |
55 | 51 | ||
56 | static inline void reset_control_put(struct reset_control *rstc) | 52 | static inline void reset_control_put(struct reset_control *rstc) |
57 | { | 53 | { |
58 | WARN_ON(1); | ||
59 | } | 54 | } |
60 | 55 | ||
61 | static inline int __must_check device_reset(struct device *dev) | 56 | static inline int __must_check device_reset(struct device *dev) |
@@ -74,14 +69,14 @@ static inline struct reset_control *__of_reset_control_get( | |||
74 | const char *id, int index, bool shared, | 69 | const char *id, int index, bool shared, |
75 | bool optional) | 70 | bool optional) |
76 | { | 71 | { |
77 | return ERR_PTR(-ENOTSUPP); | 72 | return optional ? NULL : ERR_PTR(-ENOTSUPP); |
78 | } | 73 | } |
79 | 74 | ||
80 | static inline struct reset_control *__devm_reset_control_get( | 75 | static inline struct reset_control *__devm_reset_control_get( |
81 | struct device *dev, const char *id, | 76 | struct device *dev, const char *id, |
82 | int index, bool shared, bool optional) | 77 | int index, bool shared, bool optional) |
83 | { | 78 | { |
84 | return ERR_PTR(-ENOTSUPP); | 79 | return optional ? NULL : ERR_PTR(-ENOTSUPP); |
85 | } | 80 | } |
86 | 81 | ||
87 | #endif /* CONFIG_RESET_CONTROLLER */ | 82 | #endif /* CONFIG_RESET_CONTROLLER */ |