device: Remove device->ops from early stages

Change-Id: I7a361187570716df94a3fd441ae78c0f805b1dda
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33921
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Kyösti Mälkki 2019-06-30 08:40:04 +03:00 committed by Martin Roth
parent 96d8e43178
commit cac0231615
3 changed files with 4 additions and 12 deletions

View File

@ -592,11 +592,12 @@ void pci_dev_set_resources(struct device *dev)
void pci_dev_enable_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; u16 command;
/* Set the subsystem vendor and device ID for mainboard devices. */ /* 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 (dev->on_mainboard && ops && ops->set_subsystem) {
if (CONFIG_SUBSYSTEM_VENDOR_ID) if (CONFIG_SUBSYSTEM_VENDOR_ID)
dev->subsystem_vendor = CONFIG_SUBSYSTEM_VENDOR_ID; dev->subsystem_vendor = CONFIG_SUBSYSTEM_VENDOR_ID;

View File

@ -137,8 +137,8 @@ struct device {
*/ */
DEVTREE_CONST struct bus *link_list; DEVTREE_CONST struct bus *link_list;
struct device_operations *ops;
#if !DEVTREE_EARLY #if !DEVTREE_EARLY
struct device_operations *ops;
struct chip_operations *chip_ops; struct chip_operations *chip_ops;
const char *name; const char *name;
#if CONFIG(GENERATE_SMBIOS_TABLES) #if CONFIG(GENERATE_SMBIOS_TABLES)

View File

@ -109,15 +109,6 @@ struct msix_entry *pci_msix_get_table(struct device *dev);
#define PCI_IO_BRIDGE_ALIGN 4096 #define PCI_IO_BRIDGE_ALIGN 4096
#define PCI_MEM_BRIDGE_ALIGN (1024*1024) #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) \ #define PCI_ID(VENDOR_ID, DEVICE_ID) \
((((DEVICE_ID) & 0xFFFF) << 16) | ((VENDOR_ID) & 0xFFFF)) ((((DEVICE_ID) & 0xFFFF) << 16) | ((VENDOR_ID) & 0xFFFF))