Skip to contentSkip to conversation

mfd: core: fix ACPI child matching by _HID/_CID

PATCH In review Irina Tirdea 3 participants 3 messages Mar 13, 2016 – Mar 21, 2016 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: core: fix ACPI child matching by _HID/_CID

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.

---
 drivers/mfd/mfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/mfd-core.c +1 -1
index 88bd1b1..409da01 100644
@@ -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;
 				}
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Irina Tirdea

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.

Good catch!

#2 lore raw
In reply to Irina Tirdea
Quoted 4 lines · Irina Tirdea

If MDF child devices have separate ACPI nodes identified by _HID/_CID, they will not be assigned the intended ACPI companion.

Quoted 8 lines

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.

---
 drivers/mfd/mfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I've fixed the $SUBJECT line to be more consistent with the subsystem style for you this time. Please pay more attention to that in the future.

git log --oneline -- $SUBSYSTEM helps with this.

Patch applied, thanks.

Quoted 13 lines
drivers/mfd/mfd-core.c +1 -1
index 88bd1b1..409da01 100644
@@ -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;
 				}
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog