From eb83f2e1ea87f059f7ec24bde00a7ef80d7ab594 Mon Sep 17 00:00:00 2001 From: "Landon J. Fuller" Date: Sun, 4 Sep 2016 01:47:21 +0000 Subject: [PATCH] bhndb(4): Fix probing of bhndb-attached bhnd_nvram devices. This fixes bhnd(4) nvram handling on devices that map SPROM CSRs via PCI configuration space. The probe method previously required that a bhnd(4) device be attached to the parent bridge; now that the bhnd_nvram device is always attached first, this unnecessary sanity check always failed. Approved by: adrian (mentor, implicit) --- sys/dev/bhnd/bhndb/bhndb_pci_sprom.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/dev/bhnd/bhndb/bhndb_pci_sprom.c b/sys/dev/bhnd/bhndb/bhndb_pci_sprom.c index a6c99d0bf57..d3c4b302670 100644 --- a/sys/dev/bhnd/bhndb/bhndb_pci_sprom.c +++ b/sys/dev/bhnd/bhndb/bhndb_pci_sprom.c @@ -60,17 +60,13 @@ __FBSDID("$FreeBSD$"); static int bhndb_pci_sprom_probe(device_t dev) { - device_t bridge, bus; + device_t bridge; int error; - /* Our parent must be a PCI-BHND bridge with an attached bhnd bus */ + /* Our parent must be a PCI-BHND bridge */ bridge = device_get_parent(dev); if (device_get_driver(bridge) != &bhndb_pci_driver) return (ENXIO); - - bus = device_find_child(bridge, devclass_get_name(bhnd_devclass), 0); - if (bus == NULL) - return (ENXIO); /* Defer to default driver implementation */ if ((error = bhnd_sprom_probe(dev)) > 0)