svn commit: r355824 - in head/sys/dev: exca pccbb
Warner Losh
imp at FreeBSD.org
Mon Dec 16 21:35:03 UTC 2019
Author: imp
Date: Mon Dec 16 21:35:02 2019
New Revision: 355824
URL: https://svnweb.freebsd.org/changeset/base/355824
Log:
Move attachment of pccard children into exca library. Attach the
cardbus and pccard children before the sysctls are added rather than
after.
Modified:
head/sys/dev/exca/exca.c
head/sys/dev/pccbb/pccbb_pci.c
Modified: head/sys/dev/exca/exca.c
==============================================================================
--- head/sys/dev/exca/exca.c Mon Dec 16 21:34:57 2019 (r355823)
+++ head/sys/dev/exca/exca.c Mon Dec 16 21:35:02 2019 (r355824)
@@ -646,6 +646,11 @@ exca_init(struct exca_softc *sc, device_t dev,
sc->flags = 0;
sc->getb = exca_mem_getb;
sc->putb = exca_mem_putb;
+ sc->pccarddev = device_add_child(dev, "pccard", -1);
+ if (sc->pccarddev == NULL)
+ DEVPRINTF(brdev, "WARNING: cannot add pccard bus.\n");
+ else if (device_probe_and_attach(sc->pccarddev) != 0)
+ DEVPRINTF(brdev, "WARNING: cannot attach pccard bus.\n");
}
/*
@@ -742,6 +747,8 @@ exca_valid_slot(struct exca_softc *exca)
* Intel i82365sl-DF step or maybe a vlsi 82c146
* we detected the vlsi case earlier, so if the controller
* isn't set, we know it is a i82365sl step D.
+ * XXXX Except we didn't -- this is a regression but VLSI
+ * controllers are super hard to find these days for testing.
*/
exca->chipset = EXCA_I82365SL_DF;
break;
Modified: head/sys/dev/pccbb/pccbb_pci.c
==============================================================================
--- head/sys/dev/pccbb/pccbb_pci.c Mon Dec 16 21:34:57 2019 (r355823)
+++ head/sys/dev/pccbb/pccbb_pci.c Mon Dec 16 21:35:02 2019 (r355824)
@@ -317,6 +317,13 @@ cbb_pci_attach(device_t brdev)
rman_get_start(sc->base_res)));
}
+ /* attach children */
+ sc->cbdev = device_add_child(brdev, "cardbus", -1);
+ if (sc->cbdev == NULL)
+ DEVPRINTF((brdev, "WARNING: cannot add cardbus bus.\n"));
+ else if (device_probe_and_attach(sc->cbdev) != 0)
+ DEVPRINTF((brdev, "WARNING: cannot attach cardbus bus!\n"));
+
sc->bst = rman_get_bustag(sc->base_res);
sc->bsh = rman_get_bushandle(sc->base_res);
exca_init(&sc->exca, brdev, sc->bst, sc->bsh, CBB_EXCA_OFFSET);
@@ -372,19 +379,6 @@ cbb_pci_attach(device_t brdev)
pci_write_config(brdev, PCIR_SUBBUS_2, sc->bus.sub, 1);
}
#endif
-
- /* attach children */
- sc->cbdev = device_add_child(brdev, "cardbus", -1);
- if (sc->cbdev == NULL)
- DEVPRINTF((brdev, "WARNING: cannot add cardbus bus.\n"));
- else if (device_probe_and_attach(sc->cbdev) != 0)
- DEVPRINTF((brdev, "WARNING: cannot attach cardbus bus!\n"));
-
- sc->exca.pccarddev = device_add_child(brdev, "pccard", -1);
- if (sc->exca.pccarddev == NULL)
- DEVPRINTF((brdev, "WARNING: cannot add pccard bus.\n"));
- else if (device_probe_and_attach(sc->exca.pccarddev) != 0)
- DEVPRINTF((brdev, "WARNING: cannot attach pccard bus.\n"));
/* Map and establish the interrupt. */
rid = 0;
More information about the svn-src-head
mailing list