[PATCH 3/7] ACPI / LPSS: Make hid_uid_match helper accept a NULL uid argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make hid_uid_match helper accept a NULL uid argument, so that we can also
check for matches against devices with are not expected to have a uid such
as the LNXVIDEO device.

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 drivers/acpi/acpi_lpss.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index b912cc93d783..fb6da2a2e83a 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -479,7 +479,13 @@ static bool hid_uid_match(struct acpi_device *adev,
 	const char *hid1 = acpi_device_hid(adev);
 	const char *uid1 = acpi_device_uid(adev);
 
-	return !strcmp(hid1, hid2) && uid1 && uid2 && !strcmp(uid1, uid2);
+	if (strcmp(hid1, hid2))
+		return false;
+
+	if (!uid2)
+		return true;
+
+	return uid1 && !strcmp(uid1, uid2);
 }
 
 static bool acpi_lpss_is_supplier(struct acpi_device *adev,
-- 
2.19.0.rc1




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux