@@ -178,8 +178,6 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
return AE_NOT_FOUND;
}
- res->handle = handle;
-
/*
* On some Intel platforms, multiple children of the HDAS
* device can be found, but only one of them is the SoundWire
@@ -190,6 +188,9 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
if ((adr & GENMASK(31, 28)) >> 28 != SDW_LINK_TYPE)
return AE_OK; /* keep going */
+ /* found the correct SoundWire controller */
+ res->handle = handle;
+
/* device found, stop namespace walk */
return AE_CTRL_TERMINATE;
}