mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
ofw_firmware: Return BUS_PROBE_GENERIC instead of 0
While here make it only probe if the node is directly under the root one. If it's not it's likely a device node named 'firmware' and not the firmware group we're interested in. Suggested by: jhb Sponsored by: Beckhoff Automation GmbH & Co. KG
This commit is contained in:
parent
797e480cba
commit
81b41b2ef5
|
@ -101,16 +101,21 @@ static int
|
|||
ofw_firmware_probe(device_t dev)
|
||||
{
|
||||
const char *name, *compat;
|
||||
phandle_t root, parent;
|
||||
|
||||
name = ofw_bus_get_name(dev);
|
||||
if (name == NULL || strcmp(name, "firmware") != 0)
|
||||
return (ENXIO);
|
||||
parent = OF_parent(ofw_bus_get_node(dev));
|
||||
root = OF_finddevice("/");
|
||||
if (parent != root)
|
||||
return (ENXIO);
|
||||
compat = ofw_bus_get_compat(dev);
|
||||
if (compat != NULL)
|
||||
return (ENXIO);
|
||||
|
||||
device_set_desc(dev, "OFW Firmware Group");
|
||||
return (0);
|
||||
return (BUS_PROBE_GENERIC);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in a new issue