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

[ Upstream commit 1538dc8c15 ]

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>
Stable-dep-of: c3194949ae ("usb: typec: intel_pmc_mux: Don't leak the ACPI device reference count")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Heikki Krogerus 2022-09-07 13:30:07 +03:00 коммит произвёл Greg Kroah-Hartman
Родитель 2dc1dba1d8
Коммит 2a023b47d9
1 изменённых файлов: 1 добавлений и 10 удалений

Просмотреть файл

@ -563,15 +563,6 @@ err_unregister_switch:
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 */
@ -605,7 +596,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;