Skip to content

Commit

Permalink
usb: typec: intel_pmc_mux: Use the helper acpi_dev_get_memory_resourc…
Browse files Browse the repository at this point in the history
…es()

It removes the need to check the resource data type
separately.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Heikki Krogerus authored and Rafael J. Wysocki committed Sep 10, 2022
1 parent e12dee3 commit 1538dc8
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/usb/typec/mux/intel_pmc_mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,15 +569,6 @@ static int pmc_usb_register_port(struct pmc_usb *pmc, int index,
return ret;
}

static int is_memory(struct acpi_resource *res, void *data)
{
struct resource_win win = {};
struct resource *r = &win.res;

return !(acpi_dev_resource_memory(res, r) ||
acpi_dev_resource_address_space(res, &win));
}

/* IOM ACPI IDs and IOM_PORT_STATUS_OFFSET */
static const struct acpi_device_id iom_acpi_ids[] = {
/* TigerLake */
Expand Down Expand Up @@ -611,7 +602,7 @@ static int pmc_usb_probe_iom(struct pmc_usb *pmc)
return -ENODEV;

INIT_LIST_HEAD(&resource_list);
ret = acpi_dev_get_resources(adev, &resource_list, is_memory, NULL);
ret = acpi_dev_get_memory_resources(adev, &resource_list);
if (ret < 0)
return ret;

Expand Down

0 comments on commit 1538dc8

Please sign in to comment.