ACPI / LPSS: Make hid_uid_match helper take an acpi_device as first argument
The hid_uid_match() helper is only used to check if a given acpi_device matches a certain hid + uid combination. Make the first argument the acpi_device to check to make this more clear. 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>
This commit is contained in:
parent
86b62e5cd8
commit
ea625ce133
|
@ -473,24 +473,25 @@ static const struct lpss_device_links lpss_device_links[] = {
|
|||
{"808622C1", "7", "80860F14", "3", DL_FLAG_PM_RUNTIME},
|
||||
};
|
||||
|
||||
static bool hid_uid_match(const char *hid1, const char *uid1,
|
||||
static bool hid_uid_match(struct acpi_device *adev,
|
||||
const char *hid2, const char *uid2)
|
||||
{
|
||||
const char *hid1 = acpi_device_hid(adev);
|
||||
const char *uid1 = acpi_device_uid(adev);
|
||||
|
||||
return !strcmp(hid1, hid2) && uid1 && uid2 && !strcmp(uid1, uid2);
|
||||
}
|
||||
|
||||
static bool acpi_lpss_is_supplier(struct acpi_device *adev,
|
||||
const struct lpss_device_links *link)
|
||||
{
|
||||
return hid_uid_match(acpi_device_hid(adev), acpi_device_uid(adev),
|
||||
link->supplier_hid, link->supplier_uid);
|
||||
return hid_uid_match(adev, link->supplier_hid, link->supplier_uid);
|
||||
}
|
||||
|
||||
static bool acpi_lpss_is_consumer(struct acpi_device *adev,
|
||||
const struct lpss_device_links *link)
|
||||
{
|
||||
return hid_uid_match(acpi_device_hid(adev), acpi_device_uid(adev),
|
||||
link->consumer_hid, link->consumer_uid);
|
||||
return hid_uid_match(adev, link->consumer_hid, link->consumer_uid);
|
||||
}
|
||||
|
||||
struct hid_uid {
|
||||
|
@ -506,8 +507,7 @@ static int match_hid_uid(struct device *dev, void *data)
|
|||
if (!adev)
|
||||
return 0;
|
||||
|
||||
return hid_uid_match(acpi_device_hid(adev), acpi_device_uid(adev),
|
||||
id->hid, id->uid);
|
||||
return hid_uid_match(adev, id->hid, id->uid);
|
||||
}
|
||||
|
||||
static struct device *acpi_lpss_find_device(const char *hid, const char *uid)
|
||||
|
|
Loading…
Reference in New Issue