summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2017-03-20 06:25:16 -0400
committerPhilipp Zabel <p.zabel@pengutronix.de>2017-03-21 13:19:43 -0400
commit0ca10b60ceeb5372da01798ca68c116ae45a6eb6 (patch)
treef287a4b83d49fffc1a7adcf50a941bf37907c776 /include/linux
parentc1ae3cfa0e89fa1a7ecc4c99031f5e9ae99d9201 (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')
-rw-r--r--include/linux/reset.h9
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
32static inline int reset_control_reset(struct reset_control *rstc) 32static 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
38static inline int reset_control_assert(struct reset_control *rstc) 37static 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
44static inline int reset_control_deassert(struct reset_control *rstc) 42static 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
50static inline int reset_control_status(struct reset_control *rstc) 47static 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
56static inline void reset_control_put(struct reset_control *rstc) 52static inline void reset_control_put(struct reset_control *rstc)
57{ 53{
58 WARN_ON(1);
59} 54}
60 55
61static inline int __must_check device_reset(struct device *dev) 56static 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
80static inline struct reset_control *__devm_reset_control_get( 75static 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 */