aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch
diff options
context:
space:
mode:
authorZoltan HERPAI <wigyori@uid0.hu>2016-01-09 16:20:39 +0000
committerZoltan HERPAI <wigyori@uid0.hu>2016-01-09 16:20:39 +0000
commite055d9d9674666645b2cd08b8f3129c80dcf3f15 (patch)
tree7a0d14b3e0dbfc2ec6af7231959e5414dc8f41b2 /target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch
parent221a67a90a5d278033f896a7170291d70260cf3b (diff)
downloadmaster-187ad058-e055d9d9674666645b2cd08b8f3129c80dcf3f15.tar.gz
master-187ad058-e055d9d9674666645b2cd08b8f3129c80dcf3f15.tar.bz2
master-187ad058-e055d9d9674666645b2cd08b8f3129c80dcf3f15.zip
sunxi: initial 4.4 support
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48161 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch')
-rw-r--r--target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch b/target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch
new file mode 100644
index 0000000000..62891b4e8c
--- /dev/null
+++ b/target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch
@@ -0,0 +1,41 @@
+From 7fd7a26b60090a7df15f30ba10b0d39cbbd6a94e Mon Sep 17 00:00:00 2001
+From: Alban Bedel <albeu@free.fr>
+Date: Tue, 1 Sep 2015 17:28:31 +0200
+Subject: [PATCH] reset: Fix of_reset_control_get() for consistent return
+ values
+
+When of_reset_control_get() is called without connection ID it returns
+-ENOENT when the 'resets' property doesn't exists or is an empty entry.
+However when a connection ID is given it returns -EINVAL when the 'resets'
+property doesn't exists or the requested name can't be found. This is
+because the error code returned by of_property_match_string() is just
+passed down as an index to of_parse_phandle_with_args(), which then
+returns -EINVAL.
+
+To get a consistent return value with both code paths we must return
+-ENOENT when of_property_match_string() fails.
+
+Signed-off-by: Alban Bedel <albeu@free.fr>
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ drivers/reset/core.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/reset/core.c b/drivers/reset/core.c
+index 81ae17d..77cfc49 100644
+--- a/drivers/reset/core.c
++++ b/drivers/reset/core.c
+@@ -215,9 +215,12 @@ struct reset_control *of_reset_control_get(struct device_node *node,
+ {
+ int index = 0;
+
+- if (id)
++ if (id) {
+ index = of_property_match_string(node,
+ "reset-names", id);
++ if (index < 0)
++ return ERR_PTR(-ENOENT);
++ }
+ return of_reset_control_get_by_index(node, index);
+ }
+ EXPORT_SYMBOL_GPL(of_reset_control_get);