1 Index: linux-3.13.7/drivers/reset/core.c
2 ===================================================================
3 --- linux-3.13.7.orig/drivers/reset/core.c
4 +++ linux-3.13.7/drivers/reset/core.c
5 @@ -127,15 +127,16 @@ int reset_control_deassert(struct reset_
6 EXPORT_SYMBOL_GPL(reset_control_deassert);
9 - * reset_control_get - Lookup and obtain a reference to a reset controller.
10 - * @dev: device to be reset by the controller
11 + * of_reset_control_get - Lookup and obtain a reference to a reset controller.
12 + * @node: device to be reset by the controller
13 * @id: reset line name
15 * Returns a struct reset_control or IS_ERR() condition containing errno.
17 * Use of id names is optional.
19 -struct reset_control *reset_control_get(struct device *dev, const char *id)
20 +struct reset_control *of_reset_control_get(struct device_node *node,
23 struct reset_control *rstc = ERR_PTR(-EPROBE_DEFER);
24 struct reset_controller_dev *r, *rcdev;
25 @@ -144,13 +145,10 @@ struct reset_control *reset_control_get(
30 - return ERR_PTR(-EINVAL);
33 - index = of_property_match_string(dev->of_node,
34 + index = of_property_match_string(node,
36 - ret = of_parse_phandle_with_args(dev->of_node, "resets", "#reset-cells",
37 + ret = of_parse_phandle_with_args(node, "resets", "#reset-cells",
41 @@ -185,12 +183,35 @@ struct reset_control *reset_control_get(
42 return ERR_PTR(-ENOMEM);
51 +EXPORT_SYMBOL_GPL(of_reset_control_get);
54 + * reset_control_get - Lookup and obtain a reference to a reset controller.
55 + * @dev: device to be reset by the controller
56 + * @id: reset line name
58 + * Returns a struct reset_control or IS_ERR() condition containing errno.
60 + * Use of id names is optional.
62 +struct reset_control *reset_control_get(struct device *dev, const char *id)
64 + struct reset_control *rstc;
67 + return ERR_PTR(-EINVAL);
69 + rstc = of_reset_control_get(dev->of_node, id);
75 EXPORT_SYMBOL_GPL(reset_control_get);
78 Index: linux-3.13.7/include/linux/reset.h
79 ===================================================================
80 --- linux-3.13.7.orig/include/linux/reset.h
81 +++ linux-3.13.7/include/linux/reset.h
83 #ifndef _LINUX_RESET_H_
84 #define _LINUX_RESET_H_
86 +#include <linux/of.h>
91 @@ -8,6 +10,8 @@ int reset_control_reset(struct reset_con
92 int reset_control_assert(struct reset_control *rstc);
93 int reset_control_deassert(struct reset_control *rstc);
95 +struct reset_control *of_reset_control_get(struct device_node *node,
97 struct reset_control *reset_control_get(struct device *dev, const char *id);
98 void reset_control_put(struct reset_control *rstc);
99 struct reset_control *devm_reset_control_get(struct device *dev, const char *id);