summaryrefslogtreecommitdiffstats
path: root/0011-driver-core-Do-not-overwrite-secondary-fwnode-with-N.patch
diff options
context:
space:
mode:
authorLaura Abbott <labbott@fedoraproject.org>2015-12-15 12:17:16 -0800
committerLaura Abbott <labbott@fedoraproject.org>2015-12-15 12:17:16 -0800
commitd2ede0b2227fc00e3c80bdd4043245332c3047a8 (patch)
treec7d1d9108030fdee96a2cef401d49b401278ca03 /0011-driver-core-Do-not-overwrite-secondary-fwnode-with-N.patch
parentc3ab74ee6c843b8938850b66b7fd17d215078c81 (diff)
downloadkernel-d2ede0b2227fc00e3c80bdd4043245332c3047a8.tar.gz
kernel-d2ede0b2227fc00e3c80bdd4043245332c3047a8.tar.xz
kernel-d2ede0b2227fc00e3c80bdd4043245332c3047a8.zip
Add support for Yoga touch input (rhbz 1275718)
Diffstat (limited to '0011-driver-core-Do-not-overwrite-secondary-fwnode-with-N.patch')
-rw-r--r--0011-driver-core-Do-not-overwrite-secondary-fwnode-with-N.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/0011-driver-core-Do-not-overwrite-secondary-fwnode-with-N.patch b/0011-driver-core-Do-not-overwrite-secondary-fwnode-with-N.patch
new file mode 100644
index 000000000..4d090acd9
--- /dev/null
+++ b/0011-driver-core-Do-not-overwrite-secondary-fwnode-with-N.patch
@@ -0,0 +1,47 @@
+From 55f89a8a4538803195395bdf347cbba51dcb1906 Mon Sep 17 00:00:00 2001
+From: Mika Westerberg <mika.westerberg@linux.intel.com>
+Date: Mon, 30 Nov 2015 17:11:39 +0200
+Subject: [PATCH 11/16] driver core: Do not overwrite secondary fwnode with
+ NULL if it is set
+
+If multiple devices share single firmware node like it is case with MFD
+devices, the same firmware node (ACPI) is assigned to all of them. The
+function also modifies the shared firmware node in order to preserve
+secondary firmware node of the device in question.
+
+If the new device which is sharing the firmware node does not have
+secondary node it will be NULL which will be assigned to the secondary node
+of the shared firmware node losing all built-in properties.
+
+Prevent this by setting the secondary firmware node only if the replacement
+is non-NULL.
+
+Print also warning if someone tries to overwrite secondary node that has
+already been assigned.
+
+Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
+Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+---
+ drivers/base/core.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/base/core.c b/drivers/base/core.c
+index b7d56c5..0a8bdad 100644
+--- a/drivers/base/core.c
++++ b/drivers/base/core.c
+@@ -2261,7 +2261,10 @@ void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode)
+ if (fwnode_is_primary(fn))
+ fn = fn->secondary;
+
+- fwnode->secondary = fn;
++ if (fn) {
++ WARN_ON(fwnode->secondary);
++ fwnode->secondary = fn;
++ }
+ dev->fwnode = fwnode;
+ } else {
+ dev->fwnode = fwnode_is_primary(dev->fwnode) ?
+--
+2.5.0
+