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>

+2 -7
+2 -7
include/linux/reset.h
··· 31 32 static inline int reset_control_reset(struct reset_control *rstc) 33 { 34 - WARN_ON(1); 35 return 0; 36 } 37 38 static inline int reset_control_assert(struct reset_control *rstc) 39 { 40 - WARN_ON(1); 41 return 0; 42 } 43 44 static inline int reset_control_deassert(struct reset_control *rstc) 45 { 46 - WARN_ON(1); 47 return 0; 48 } 49 50 static inline int reset_control_status(struct reset_control *rstc) 51 { 52 - WARN_ON(1); 53 return 0; 54 } 55 56 static inline void reset_control_put(struct reset_control *rstc) 57 { 58 - WARN_ON(1); 59 } 60 61 static inline int __must_check device_reset(struct device *dev) ··· 69 const char *id, int index, bool shared, 70 bool optional) 71 { 72 - return ERR_PTR(-ENOTSUPP); 73 } 74 75 static inline struct reset_control *__devm_reset_control_get( 76 struct device *dev, const char *id, 77 int index, bool shared, bool optional) 78 { 79 - return ERR_PTR(-ENOTSUPP); 80 } 81 82 #endif /* CONFIG_RESET_CONTROLLER */
··· 31 32 static inline int reset_control_reset(struct reset_control *rstc) 33 { 34 return 0; 35 } 36 37 static inline int reset_control_assert(struct reset_control *rstc) 38 { 39 return 0; 40 } 41 42 static inline int reset_control_deassert(struct reset_control *rstc) 43 { 44 return 0; 45 } 46 47 static inline int reset_control_status(struct reset_control *rstc) 48 { 49 return 0; 50 } 51 52 static inline void reset_control_put(struct reset_control *rstc) 53 { 54 } 55 56 static inline int __must_check device_reset(struct device *dev) ··· 74 const char *id, int index, bool shared, 75 bool optional) 76 { 77 + return optional ? NULL : ERR_PTR(-ENOTSUPP); 78 } 79 80 static inline struct reset_control *__devm_reset_control_get( 81 struct device *dev, const char *id, 82 int index, bool shared, bool optional) 83 { 84 + return optional ? NULL : ERR_PTR(-ENOTSUPP); 85 } 86 87 #endif /* CONFIG_RESET_CONTROLLER */