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