提交 1538dc8c 编写于 作者: H Heikki Krogerus 提交者: Rafael J. Wysocki

usb: typec: intel_pmc_mux: Use the helper acpi_dev_get_memory_resources()

It removes the need to check the resource data type
separately.
Signed-off-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 e12dee37
...@@ -569,15 +569,6 @@ static int pmc_usb_register_port(struct pmc_usb *pmc, int index, ...@@ -569,15 +569,6 @@ static int pmc_usb_register_port(struct pmc_usb *pmc, int index,
return ret; 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 */ /* IOM ACPI IDs and IOM_PORT_STATUS_OFFSET */
static const struct acpi_device_id iom_acpi_ids[] = { static const struct acpi_device_id iom_acpi_ids[] = {
/* TigerLake */ /* TigerLake */
...@@ -611,7 +602,7 @@ static int pmc_usb_probe_iom(struct pmc_usb *pmc) ...@@ -611,7 +602,7 @@ static int pmc_usb_probe_iom(struct pmc_usb *pmc)
return -ENODEV; return -ENODEV;
INIT_LIST_HEAD(&resource_list); 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) if (ret < 0)
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册