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:
Emmanuel Vadot 2023-08-15 07:59:09 +02:00
parent 797e480cba
commit 81b41b2ef5

View file

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