ofw_firmware: Only match if there is no compatible

If there is a compatible string it likely means that the firmware needs
a dedicated driver (like on RPI*).

PR:	273087
Tested-by:	Mark Millard <marklmi26-fbsd@yahoo.com>
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Fixes:		fdfd3a90b6 ("ofw: Add a ofw_firmware driver")
This commit is contained in:
Emmanuel Vadot 2023-08-13 08:28:13 +02:00
parent a953ac19db
commit 69f8cc60aa

View File

@ -100,11 +100,14 @@ ofw_firmware_add_device(device_t dev, phandle_t node, u_int order,
static int
ofw_firmware_probe(device_t dev)
{
const char *name;
const char *name, *compat;
name = ofw_bus_get_name(dev);
if (name == NULL || strcmp(name, "firmware") != 0)
return (ENXIO);
compat = ofw_bus_get_compat(dev);
if (compat != NULL)
return (ENXIO);
device_set_desc(dev, "OFW Firmware Group");
return (0);