From 7cb103461ad68e2fe1b4d3b3f71e1e140f5507f8 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Sat, 3 Oct 2020 14:49:09 -0700 Subject: [PATCH] drivers/wifi/generic: Use pci_dev_* operations for device ops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WiFi devices supported by the generic WiFi driver are PCIe devices which need to be managed using the standard pci_dev_* operations to read, set and enable resources. This change updates the device_operations structure `wifi_generic_ops` to use the standard pci_dev_* operations for these devices. BUG=b:169802515 BRANCH=zork Change-Id: I8b306259e205ecb963c0563000bd96ec6b978b8b Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/c/coreboot/+/46028 Tested-by: build bot (Jenkins) Reviewed-by: Rob Barnes Reviewed-by: Duncan Laurie Reviewed-by: Michael Niewöhner Reviewed-by: Karthik Ramasubramanian --- src/drivers/wifi/generic/generic.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/drivers/wifi/generic/generic.c b/src/drivers/wifi/generic/generic.c index dd53da3b66..b175f2363c 100644 --- a/src/drivers/wifi/generic/generic.c +++ b/src/drivers/wifi/generic/generic.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -236,9 +237,11 @@ static void wifi_generic_fill_ssdt_generator(const struct device *dev) wifi_generic_fill_ssdt(dev, dev->chip_info); } -static struct device_operations wifi_generic_ops = { - .read_resources = noop_read_resources, - .set_resources = noop_set_resources, +struct device_operations wifi_generic_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .ops_pci = &pci_dev_ops_pci, .acpi_name = wifi_generic_acpi_name, .acpi_fill_ssdt = wifi_generic_fill_ssdt_generator, };