mfd: core: Fix ACPI child matching by _HID/_CID
authorIrina Tirdea <irina.tirdea@intel.com>
Sun, 13 Mar 2016 01:02:58 +0000 (03:02 +0200)
committerLee Jones <lee.jones@linaro.org>
Mon, 11 Apr 2016 12:31:40 +0000 (13:31 +0100)
If MDF child devices have separate ACPI nodes identified
by _HID/_CID, they will not be assigned the intended
ACPI companion.

acpi_match_device_ids will return 0 if a the child device
matches the _HID/_CID, so this patch changes the matching
condition to check for 0 on success.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Acked-by: Mika Westerberg <mika.westeberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/mfd-core.c

index 88bd1b1e47bedb650c83771de09d7a9e85316ee4..409da01effcd6119a34dff45040bf112dc091012 100644 (file)
@@ -107,7 +107,7 @@ static void mfd_acpi_add_device(const struct mfd_cell *cell,
 
                        strlcpy(ids[0].id, match->pnpid, sizeof(ids[0].id));
                        list_for_each_entry(child, &parent->children, node) {
-                               if (acpi_match_device_ids(child, ids)) {
+                               if (!acpi_match_device_ids(child, ids)) {
                                        adev = child;
                                        break;
                                }