Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

reset: Return -ENOTSUPP when not configured

Prior to commit 6c96f05c8bb8 ("reset: Make [of_]reset_control_get[_foo]
functions wrappers"), the "optional" functions returned -ENOTSUPP when
CONFIG_RESET_CONTROLLER was not set.

Revert back to the old behavior by changing the new
__devm_reset_control_get() and __of_reset_control_get() functions to
return ERR_PTR(-ENOTSUPP) when compiled without CONFIG_RESET_CONTROLLER.

Otherwise they will return -EINVAL causing users to think that an error
occurred when CONFIG_RESET_CONTROLLER is not set.

Fixes: 6c96f05c8bb8 ("reset: Make [of_]reset_control_get[_foo] functions wrappers")
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

authored by

John Youn and committed by
Philipp Zabel
168d7c4e 42fa905b

+2 -2
+2 -2
include/linux/reset.h
··· 71 71 struct device_node *node, 72 72 const char *id, int index, int shared) 73 73 { 74 - return ERR_PTR(-EINVAL); 74 + return ERR_PTR(-ENOTSUPP); 75 75 } 76 76 77 77 static inline struct reset_control *__devm_reset_control_get( 78 78 struct device *dev, 79 79 const char *id, int index, int shared) 80 80 { 81 - return ERR_PTR(-EINVAL); 81 + return ERR_PTR(-ENOTSUPP); 82 82 } 83 83 84 84 #endif /* CONFIG_RESET_CONTROLLER */