Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pci/pci_host_generic_fdt.c
| Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | generic_pcie_fdt_probe(device_t dev) | ||||
| if (ofw_bus_is_compatible(dev, "arm,gem5_pcie")) { | if (ofw_bus_is_compatible(dev, "arm,gem5_pcie")) { | ||||
| device_set_desc(dev, "GEM5 PCIe host controller"); | device_set_desc(dev, "GEM5 PCIe host controller"); | ||||
| return (BUS_PROBE_DEFAULT); | return (BUS_PROBE_DEFAULT); | ||||
| } | } | ||||
| return (ENXIO); | return (ENXIO); | ||||
| } | } | ||||
| void | |||||
| pci_host_generic_destroy_fdt(device_t dev) | |||||
imp: why the naming difference? | |||||
Done Inline ActionsMaybe silly, but destroy here to better parallel the setup verbiage and to match ofw_bus_gen_destroy_devinfo. I would've named it free if we had used alloc or nothing at all (i.e. just part of attach). kevans: Maybe silly, but `destroy` here to better parallel the `setup` verbiage and to match… | |||||
| { | |||||
| struct generic_pcie_fdt_softc *sc; | |||||
| struct pci_ofw_devinfo *di; | |||||
| sc = device_get_softc(dev); | |||||
| while (!STAILQ_EMPTY(&sc->pci_ofw_devlist)) { | |||||
| di = STAILQ_FIRST(&sc->pci_ofw_devlist); | |||||
| STAILQ_REMOVE_HEAD(&sc->pci_ofw_devlist, pci_ofw_link); | |||||
| ofw_bus_gen_destroy_devinfo(&di->di_dinfo); | |||||
| free(di, M_DEVBUF); | |||||
| } | |||||
| ofw_bus_destroy_iinfo(&sc->pci_iinfo); | |||||
| (void)pci_host_generic_core_free(dev); | |||||
| } | |||||
| int | int | ||||
| pci_host_generic_setup_fdt(device_t dev) | pci_host_generic_setup_fdt(device_t dev) | ||||
| { | { | ||||
| struct generic_pcie_fdt_softc *sc; | struct generic_pcie_fdt_softc *sc; | ||||
| phandle_t node; | phandle_t node; | ||||
| int error; | int error; | ||||
| sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
| ▲ Show 20 Lines • Show All 385 Lines • Show Last 20 Lines | |||||
why the naming difference?