diff options
Diffstat (limited to 'drivers/pci/bus.c')
-rw-r--r-- | drivers/pci/bus.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 251be4fffa..b6eab56d87 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #include <common.h> #include <init.h> #include <driver.h> @@ -49,7 +50,7 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, } EXPORT_SYMBOL(pci_match_id); -static int pci_match(struct device_d *dev, struct driver_d *drv) +static int pci_match(struct device *dev, struct driver *drv) { struct pci_dev *pdev = to_pci_dev(dev); struct pci_driver *pdrv = to_pci_driver(drv); @@ -64,7 +65,7 @@ static int pci_match(struct device_d *dev, struct driver_d *drv) return -1; } -static int pci_probe(struct device_d *dev) +static int pci_probe(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct pci_driver *pdrv = to_pci_driver(dev->driver); @@ -72,7 +73,7 @@ static int pci_probe(struct device_d *dev) return pdrv->probe(pdev, pdev->id); } -static void pci_remove(struct device_d *dev) +static void pci_remove(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct pci_driver *pdrv = to_pci_driver(dev->driver); @@ -96,7 +97,7 @@ pure_initcall(pci_bus_init); int pci_register_driver(struct pci_driver *pdrv) { - struct driver_d *drv = &pdrv->driver; + struct driver *drv = &pdrv->driver; if (!pdrv->id_table) return -EIO; @@ -110,9 +111,12 @@ int pci_register_driver(struct pci_driver *pdrv) int pci_register_device(struct pci_dev *pdev) { char str[6]; - struct device_d *dev = &pdev->dev; + struct device *dev = &pdev->dev; int ret; + if (!of_device_is_available(pdev->dev.of_node)) + return 0; + dev_set_name(dev, "pci-%04x:%04x.", pdev->vendor, pdev->device); dev->bus = &pci_bus; dev->id = DEVICE_ID_DYNAMIC; |