Skip to content

Commit

Permalink
reset: Return -ENOTSUPP when not configured
Browse files Browse the repository at this point in the history
Prior to commit 6c96f05 ("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: 6c96f05 ("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>
  • Loading branch information
John Youn authored and Philipp Zabel committed Jun 1, 2016
1 parent 42fa905 commit 168d7c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/reset.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ static inline struct reset_control *__of_reset_control_get(
struct device_node *node,
const char *id, int index, int shared)
{
return ERR_PTR(-EINVAL);
return ERR_PTR(-ENOTSUPP);
}

static inline struct reset_control *__devm_reset_control_get(
struct device *dev,
const char *id, int index, int shared)
{
return ERR_PTR(-EINVAL);
return ERR_PTR(-ENOTSUPP);
}

#endif /* CONFIG_RESET_CONTROLLER */
Expand Down

0 comments on commit 168d7c4

Please sign in to comment.