git: 69f8cc60aa1e - main - ofw_firmware: Only match if there is no compatible

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Sun, 13 Aug 2023 09:19:55 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=69f8cc60aa1e3140f41a75c859333a3d56c947fb

commit 69f8cc60aa1e3140f41a75c859333a3d56c947fb
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2023-08-13 06:28:13 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2023-08-13 09:19:44 +0000

    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:          fdfd3a90b6ce ("ofw: Add a ofw_firmware driver")
---
 sys/dev/ofw/ofw_firmware.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sys/dev/ofw/ofw_firmware.c b/sys/dev/ofw/ofw_firmware.c
index faba123c3e09..7d62fc317c1d 100644
--- a/sys/dev/ofw/ofw_firmware.c
+++ b/sys/dev/ofw/ofw_firmware.c
@@ -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);