Skip to content

Commit 7e70c8a

Browse files
andy-shevrafaeljw
authored andcommitted
ACPI / LPSS: Switch to use acpi_dev_hid_uid_match()
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 35009c8 commit 7e70c8a

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

drivers/acpi/acpi_lpss.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -478,31 +478,16 @@ static const struct lpss_device_links lpss_device_links[] = {
478478
{"80860F41", "5", "LNXVIDEO", NULL, DL_FLAG_PM_RUNTIME},
479479
};
480480

481-
static bool hid_uid_match(struct acpi_device *adev,
482-
const char *hid2, const char *uid2)
483-
{
484-
const char *hid1 = acpi_device_hid(adev);
485-
const char *uid1 = acpi_device_uid(adev);
486-
487-
if (strcmp(hid1, hid2))
488-
return false;
489-
490-
if (!uid2)
491-
return true;
492-
493-
return uid1 && !strcmp(uid1, uid2);
494-
}
495-
496481
static bool acpi_lpss_is_supplier(struct acpi_device *adev,
497482
const struct lpss_device_links *link)
498483
{
499-
return hid_uid_match(adev, link->supplier_hid, link->supplier_uid);
484+
return acpi_dev_hid_uid_match(adev, link->supplier_hid, link->supplier_uid);
500485
}
501486

502487
static bool acpi_lpss_is_consumer(struct acpi_device *adev,
503488
const struct lpss_device_links *link)
504489
{
505-
return hid_uid_match(adev, link->consumer_hid, link->consumer_uid);
490+
return acpi_dev_hid_uid_match(adev, link->consumer_hid, link->consumer_uid);
506491
}
507492

508493
struct hid_uid {
@@ -518,7 +503,7 @@ static int match_hid_uid(struct device *dev, const void *data)
518503
if (!adev)
519504
return 0;
520505

521-
return hid_uid_match(adev, id->hid, id->uid);
506+
return acpi_dev_hid_uid_match(adev, id->hid, id->uid);
522507
}
523508

524509
static struct device *acpi_lpss_find_device(const char *hid, const char *uid)

0 commit comments

Comments
 (0)