aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/oxnas/patches-3.14/100-obtain-reset-controller-from-device-tree.patch
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-12-05 00:20:41 +0000
committerJohn Crispin <john@openwrt.org>2014-12-05 00:20:41 +0000
commite553dfc356b7087e362f0daa283239ee01ae81f5 (patch)
treef91fac0c53ff97a1c3ceabce64fb9dd62933a3d2 /target/linux/oxnas/patches-3.14/100-obtain-reset-controller-from-device-tree.patch
parentdcc8a8ca9eac90b3e70104c893464c27e62daed5 (diff)
downloadupstream-e553dfc356b7087e362f0daa283239ee01ae81f5.tar.gz
upstream-e553dfc356b7087e362f0daa283239ee01ae81f5.tar.bz2
upstream-e553dfc356b7087e362f0daa283239ee01ae81f5.zip
oxnas: re-add support for kernel 3.14
This reverts commit c81ddddde5fd193802d511b42eb7b108aac17136 on https://gitorious.org/openwrt-oxnas/openwrt-oxnas.git which removed patches and config for 3.14. [arm_introduce-dma-fiq-irq-broadcast patch was renamed to match 3.18] Signed-off-by: Daniel Golle <daniel@makrotopia.org> SVN-Revision: 43520
Diffstat (limited to 'target/linux/oxnas/patches-3.14/100-obtain-reset-controller-from-device-tree.patch')
-rw-r--r--target/linux/oxnas/patches-3.14/100-obtain-reset-controller-from-device-tree.patch99
1 files changed, 99 insertions, 0 deletions
diff --git a/target/linux/oxnas/patches-3.14/100-obtain-reset-controller-from-device-tree.patch b/target/linux/oxnas/patches-3.14/100-obtain-reset-controller-from-device-tree.patch
new file mode 100644
index 0000000000..3b3947c6bf
--- /dev/null
+++ b/target/linux/oxnas/patches-3.14/100-obtain-reset-controller-from-device-tree.patch
@@ -0,0 +1,99 @@
+Index: linux-3.13.7/drivers/reset/core.c
+===================================================================
+--- linux-3.13.7.orig/drivers/reset/core.c
++++ linux-3.13.7/drivers/reset/core.c
+@@ -127,15 +127,16 @@ int reset_control_deassert(struct reset_
+ EXPORT_SYMBOL_GPL(reset_control_deassert);
+
+ /**
+- * reset_control_get - Lookup and obtain a reference to a reset controller.
+- * @dev: device to be reset by the controller
++ * of_reset_control_get - Lookup and obtain a reference to a reset controller.
++ * @node: device to be reset by the controller
+ * @id: reset line name
+ *
+ * Returns a struct reset_control or IS_ERR() condition containing errno.
+ *
+ * Use of id names is optional.
+ */
+-struct reset_control *reset_control_get(struct device *dev, const char *id)
++struct reset_control *of_reset_control_get(struct device_node *node,
++ const char *id)
+ {
+ struct reset_control *rstc = ERR_PTR(-EPROBE_DEFER);
+ struct reset_controller_dev *r, *rcdev;
+@@ -144,13 +145,10 @@ struct reset_control *reset_control_get(
+ int rstc_id;
+ int ret;
+
+- if (!dev)
+- return ERR_PTR(-EINVAL);
+-
+ if (id)
+- index = of_property_match_string(dev->of_node,
++ index = of_property_match_string(node,
+ "reset-names", id);
+- ret = of_parse_phandle_with_args(dev->of_node, "resets", "#reset-cells",
++ ret = of_parse_phandle_with_args(node, "resets", "#reset-cells",
+ index, &args);
+ if (ret)
+ return ERR_PTR(ret);
+@@ -185,12 +183,35 @@ struct reset_control *reset_control_get(
+ return ERR_PTR(-ENOMEM);
+ }
+
+- rstc->dev = dev;
+ rstc->rcdev = rcdev;
+ rstc->id = rstc_id;
+
+ return rstc;
+ }
++EXPORT_SYMBOL_GPL(of_reset_control_get);
++
++/**
++ * reset_control_get - Lookup and obtain a reference to a reset controller.
++ * @dev: device to be reset by the controller
++ * @id: reset line name
++ *
++ * Returns a struct reset_control or IS_ERR() condition containing errno.
++ *
++ * Use of id names is optional.
++ */
++struct reset_control *reset_control_get(struct device *dev, const char *id)
++{
++ struct reset_control *rstc;
++
++ if (!dev)
++ return ERR_PTR(-EINVAL);
++
++ rstc = of_reset_control_get(dev->of_node, id);
++ if (!IS_ERR(rstc))
++ rstc->dev = dev;
++
++ return rstc;
++}
+ EXPORT_SYMBOL_GPL(reset_control_get);
+
+ /**
+Index: linux-3.13.7/include/linux/reset.h
+===================================================================
+--- linux-3.13.7.orig/include/linux/reset.h
++++ linux-3.13.7/include/linux/reset.h
+@@ -1,6 +1,8 @@
+ #ifndef _LINUX_RESET_H_
+ #define _LINUX_RESET_H_
+
++#include <linux/of.h>
++
+ struct device;
+ struct reset_control;
+
+@@ -8,6 +10,8 @@ int reset_control_reset(struct reset_con
+ int reset_control_assert(struct reset_control *rstc);
+ int reset_control_deassert(struct reset_control *rstc);
+
++struct reset_control *of_reset_control_get(struct device_node *node,
++ const char *id);
+ struct reset_control *reset_control_get(struct device *dev, const char *id);
+ void reset_control_put(struct reset_control *rstc);
+ struct reset_control *devm_reset_control_get(struct device *dev, const char *id);