diff options
author | Hans de Goede <hdegoede@redhat.com> | 2018-09-23 16:58:07 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-09-30 23:38:24 +0300 |
commit | a92a5563e3f4189b363de72527efdfaf4789167f (patch) | |
tree | e69aa6d50b5d4a9c9c110d15f9e297998e7ac224 /drivers/acpi/acpi_lpss.c | |
parent | ea625ce133176d7eeccd692967dce5622cbb61ee (diff) | |
download | linux-a92a5563e3f4189b363de72527efdfaf4789167f.tar.xz |
ACPI / LPSS: Make hid_uid_match helper accept a NULL uid argument
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.
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpi_lpss.c')
-rw-r--r-- | drivers/acpi/acpi_lpss.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 125ef7db86ff..73ae43627d60 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, |