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)
This commit is contained in:
landonf 2016-09-04 01:47:21 +00:00
parent ea428c80f2
commit f01dd47816

View File

@ -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)