summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/device/pci_device.c5
-rw-r--r--src/include/device/device.h2
-rw-r--r--src/include/device/pci.h9
3 files changed, 4 insertions, 12 deletions
diff --git a/src/device/pci_device.c b/src/device/pci_device.c
index 2c724aad50..9c47085152 100644
--- a/src/device/pci_device.c
+++ b/src/device/pci_device.c
@@ -592,11 +592,12 @@ void pci_dev_set_resources(struct device *dev)
void pci_dev_enable_resources(struct device *dev)
{
- const struct pci_operations *ops;
+ const struct pci_operations *ops = NULL;
u16 command;
/* Set the subsystem vendor and device ID for mainboard devices. */
- ops = ops_pci(dev);
+ if (dev->ops)
+ ops = dev->ops->ops_pci;
if (dev->on_mainboard && ops && ops->set_subsystem) {
if (CONFIG_SUBSYSTEM_VENDOR_ID)
dev->subsystem_vendor = CONFIG_SUBSYSTEM_VENDOR_ID;
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 007c51f629..676da65263 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -137,8 +137,8 @@ struct device {
*/
DEVTREE_CONST struct bus *link_list;
- struct device_operations *ops;
#if !DEVTREE_EARLY
+ struct device_operations *ops;
struct chip_operations *chip_ops;
const char *name;
#if CONFIG(GENERATE_SMBIOS_TABLES)
diff --git a/src/include/device/pci.h b/src/include/device/pci.h
index c08b30af6f..fa695d440f 100644
--- a/src/include/device/pci.h
+++ b/src/include/device/pci.h
@@ -109,15 +109,6 @@ struct msix_entry *pci_msix_get_table(struct device *dev);
#define PCI_IO_BRIDGE_ALIGN 4096
#define PCI_MEM_BRIDGE_ALIGN (1024*1024)
-static inline const struct pci_operations *ops_pci(struct device *dev)
-{
- const struct pci_operations *pops;
- pops = 0;
- if (dev && dev->ops)
- pops = dev->ops->ops_pci;
- return pops;
-}
-
#define PCI_ID(VENDOR_ID, DEVICE_ID) \
((((DEVICE_ID) & 0xFFFF) << 16) | ((VENDOR_ID) & 0xFFFF))