1 --- a/drivers/reset/core.c
2 +++ b/drivers/reset/core.c
3 @@ -127,15 +127,16 @@ int reset_control_deassert(struct reset_
4 EXPORT_SYMBOL_GPL(reset_control_deassert);
7 - * reset_control_get - Lookup and obtain a reference to a reset controller.
8 - * @dev: device to be reset by the controller
9 + * of_reset_control_get - Lookup and obtain a reference to a reset controller.
10 + * @node: device to be reset by the controller
11 * @id: reset line name
13 * Returns a struct reset_control or IS_ERR() condition containing errno.
15 * Use of id names is optional.
17 -struct reset_control *reset_control_get(struct device *dev, const char *id)
18 +struct reset_control *of_reset_control_get(struct device_node *node,
21 struct reset_control *rstc = ERR_PTR(-EPROBE_DEFER);
22 struct reset_controller_dev *r, *rcdev;
23 @@ -144,13 +145,10 @@ struct reset_control *reset_control_get(
28 - return ERR_PTR(-EINVAL);
31 - index = of_property_match_string(dev->of_node,
32 + index = of_property_match_string(node,
34 - ret = of_parse_phandle_with_args(dev->of_node, "resets", "#reset-cells",
35 + ret = of_parse_phandle_with_args(node, "resets", "#reset-cells",
39 @@ -185,12 +183,35 @@ struct reset_control *reset_control_get(
40 return ERR_PTR(-ENOMEM);
49 +EXPORT_SYMBOL_GPL(of_reset_control_get);
52 + * reset_control_get - Lookup and obtain a reference to a reset controller.
53 + * @dev: device to be reset by the controller
54 + * @id: reset line name
56 + * Returns a struct reset_control or IS_ERR() condition containing errno.
58 + * Use of id names is optional.
60 +struct reset_control *reset_control_get(struct device *dev, const char *id)
62 + struct reset_control *rstc;
65 + return ERR_PTR(-EINVAL);
67 + rstc = of_reset_control_get(dev->of_node, id);
73 EXPORT_SYMBOL_GPL(reset_control_get);
76 --- a/include/linux/reset.h
77 +++ b/include/linux/reset.h
79 #ifndef _LINUX_RESET_H_
80 #define _LINUX_RESET_H_
82 +#include <linux/of.h>
87 @@ -8,6 +10,8 @@ int reset_control_reset(struct reset_con
88 int reset_control_assert(struct reset_control *rstc);
89 int reset_control_deassert(struct reset_control *rstc);
91 +struct reset_control *of_reset_control_get(struct device_node *node,
93 struct reset_control *reset_control_get(struct device *dev, const char *id);
94 void reset_control_put(struct reset_control *rstc);
95 struct reset_control *devm_reset_control_get(struct device *dev, const char *id);