Commit ae5e6c64 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Rafael J. Wysocki

iommu/amd: Switch to use acpi_dev_hid_uid_match()

Since we have a generic helper, drop custom implementation in the driver.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: default avatarJerry Snitselaar <jsnitsel@redhat.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 4f3cde3a
...@@ -124,30 +124,6 @@ static struct lock_class_key reserved_rbtree_key; ...@@ -124,30 +124,6 @@ static struct lock_class_key reserved_rbtree_key;
* *
****************************************************************************/ ****************************************************************************/
static inline int match_hid_uid(struct device *dev,
struct acpihid_map_entry *entry)
{
struct acpi_device *adev = ACPI_COMPANION(dev);
const char *hid, *uid;
if (!adev)
return -ENODEV;
hid = acpi_device_hid(adev);
uid = acpi_device_uid(adev);
if (!hid || !(*hid))
return -ENODEV;
if (!uid || !(*uid))
return strcmp(hid, entry->hid);
if (!(*entry->uid))
return strcmp(hid, entry->hid);
return (strcmp(hid, entry->hid) || strcmp(uid, entry->uid));
}
static inline u16 get_pci_device_id(struct device *dev) static inline u16 get_pci_device_id(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
...@@ -158,10 +134,14 @@ static inline u16 get_pci_device_id(struct device *dev) ...@@ -158,10 +134,14 @@ static inline u16 get_pci_device_id(struct device *dev)
static inline int get_acpihid_device_id(struct device *dev, static inline int get_acpihid_device_id(struct device *dev,
struct acpihid_map_entry **entry) struct acpihid_map_entry **entry)
{ {
struct acpi_device *adev = ACPI_COMPANION(dev);
struct acpihid_map_entry *p; struct acpihid_map_entry *p;
if (!adev)
return -ENODEV;
list_for_each_entry(p, &acpihid_map, list) { list_for_each_entry(p, &acpihid_map, list) {
if (!match_hid_uid(dev, p)) { if (acpi_dev_hid_uid_match(adev, p->hid, p->uid)) {
if (entry) if (entry)
*entry = p; *entry = p;
return p->devid; return p->devid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment