devicetree: Fix improper use of chip_operations

Auto-discoverable PCI devices do not require field .enable_dev
of chip_operations to be set. They are matched with PCI drivers
by the use of PCI vendor and device ID fields.

The name given for the chip_operations struct must match the
pathname the way it is present in the devicetree.cb files. If
there was no match, util/sconfig would currently choose to
use the empty weak declaration it creates in static.c file.

Change-Id: I684a087a1f8ee4e1a5fd83450cd371fcfdbb6847
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35096
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
This commit is contained in:
Kyösti Mälkki 2019-08-25 13:05:46 +03:00 committed by Patrick Georgi
parent f2e1d0ae9a
commit 08c76e1f7d
6 changed files with 13 additions and 23 deletions

View File

@ -82,12 +82,6 @@ static const struct pci_driver bayhub_bh720 __pci_driver = {
.devices = pci_device_ids,
};
static void bh720_enable(struct device *dev)
{
dev->ops = &bh720_ops;
}
struct chip_operations bayhub_bh720_ops = {
struct chip_operations drivers_generic_bayhub_ops = {
CHIP_NAME("BayHub Technology BH720 PCI to eMMC 5.0 HS200 bridge")
.enable_dev = bh720_enable,
};

View File

@ -71,3 +71,7 @@ static const struct pci_driver rce822 __pci_driver = {
.vendor = PCI_VENDOR_ID_RICOH,
.devices = pci_device_ids,
};
struct chip_operations drivers_ricoh_rce822_ops = {
CHIP_NAME("RICOH RCE822")
};

View File

@ -38,3 +38,7 @@ static const struct pci_driver soc_cavium_uart __pci_driver = {
.vendor = PCI_VENDOR_CAVIUM,
.device = PCI_DEVICE_ID_CAVIUM_THUNDERX_UART,
};
struct chip_operations soc_cavium_common_pci_ops = {
CHIP_NAME("Cavium ThunderX UART")
};

View File

@ -47,3 +47,7 @@ static const struct pci_driver pcix_driver __pci_driver = {
.vendor = PCI_VENDOR_ID_INTEL,
.device = PCI_DEVICE_ID_INTEL_82870_1F0,
};
struct chip_operations southbridge_intel_i82870_ops = {
CHIP_NAME("Intel 82870")
};

View File

@ -111,12 +111,6 @@ static const struct pci_driver ti_pci7620_driver __pci_driver = {
.device = 0xac8d,
};
static void ti_pci7420_enable_dev(struct device *dev)
{
/* Nothing here yet */
}
struct chip_operations southbridge_ti_pci7420_ops = {
CHIP_NAME("Texas Instruments PCI7420/7620 Cardbus Controller")
.enable_dev = ti_pci7420_enable_dev,
};

View File

@ -48,13 +48,3 @@ static const struct pci_driver ti_pci7420_driver __pci_driver = {
.vendor = 0x104c,
.device = 0x802e,
};
static void ti_pci7420_firewire_enable_dev(struct device *dev)
{
/* Nothing here yet */
}
struct chip_operations southbridge_ti_pci7420_firewire_ops = {
CHIP_NAME("Texas Instruments PCI7420/7620 FireWire (IEEE 1394)")
.enable_dev = ti_pci7420_firewire_enable_dev,
};