From 9d017d2d29603ae23d24ba34eef5444761397097 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Fri, 10 Jul 2020 14:09:03 -0600 Subject: drivers/usb/pci_xhci: Switch to using xhci_for_each_supported_usb_cap This removes some boilerplate code. BUG=b:154756391 TEST=Dump ACPI table for trembyle and verify it didn't change. Signed-off-by: Raul E Rangel Change-Id: Idcda4356f4e6cb7f6066c67e8fabe0299a1a75b4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/43353 Reviewed-by: Furquan Shaikh Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/drivers/usb/pci_xhci/pci_xhci.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/drivers/usb/pci_xhci/pci_xhci.c b/src/drivers/usb/pci_xhci/pci_xhci.c index 695cd09c4d..edee03afa7 100644 --- a/src/drivers/usb/pci_xhci/pci_xhci.c +++ b/src/drivers/usb/pci_xhci/pci_xhci.c @@ -7,7 +7,6 @@ #include #include #include -#include #define PCI_XHCI_CLASSCODE 0x0c0330 /* USB3.0 xHCI controller */ @@ -57,27 +56,15 @@ static const char *xhci_acpi_name(const struct device *dev) return NULL; } -static void handle_xhci_ext_cap(void *context, const struct xhci_ext_cap *cap) +static void xhci_generate_port_acpi(void *context, const struct xhci_supported_protocol *data) { - const struct xhci_supported_protocol *data; const char *format; char buf[16]; struct port_counts *counts = context; unsigned int *dev_num; - if (cap->cap_id != XHCI_ECP_CAP_ID_SUPP) - return; - - data = &cap->supported_protocol; - xhci_print_supported_protocol(data); - if (memcmp(data->name, "USB ", 4)) { - printk(BIOS_INFO, "%s: Unknown Protocol: %.*s\n", __func__, - (int)sizeof(data->name), data->name); - return; - } - if (data->major_rev == 3) { format = "SS%02d"; dev_num = &counts->super_speed; @@ -105,7 +92,7 @@ static void xhci_add_devices(const struct device *dev) acpigen_write_device("RHUB"); acpigen_write_name_integer("_ADR", 0x00000000); - xhci_for_each_ext_cap(dev, &counts, handle_xhci_ext_cap); + xhci_for_each_supported_usb_cap(dev, &counts, xhci_generate_port_acpi); acpigen_pop_len(); } -- cgit v1.2.3