git: 27645265c4e4 - main - ds1307: allow configuration via hints on FDT-based systems

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Sat, 13 Nov 2021 09:23:41 UTC
The branch main has been updated by avg:

URL: https://cgit.FreeBSD.org/src/commit/?id=27645265c4e49ad7eaa25847a280307acb138da8

commit 27645265c4e49ad7eaa25847a280307acb138da8
Author:     Andriy Gapon <avg@FreeBSD.org>
AuthorDate: 2021-11-04 11:55:35 +0000
Commit:     Andriy Gapon <avg@FreeBSD.org>
CommitDate: 2021-11-13 09:23:10 +0000

    ds1307: allow configuration via hints on FDT-based systems
    
    On-board devices should be configured via the FDT and overlays.
    Hints are primarily useful for external and temporarily attached devices.
    Adding hints is much easier and faster than writing and compiling
    an overlay.
    
    MFC after:      2 weeks
---
 sys/dev/iicbus/ds1307.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/sys/dev/iicbus/ds1307.c b/sys/dev/iicbus/ds1307.c
index 7bab7e78c0d8..47f47bb07f5e 100644
--- a/sys/dev/iicbus/ds1307.c
+++ b/sys/dev/iicbus/ds1307.c
@@ -216,18 +216,13 @@ ds1307_probe(device_t dev)
 		return (ENXIO);
 
 	compat = ofw_bus_search_compatible(dev, ds1307_compat_data);
-
-	if (compat->ocd_str == NULL)
-		return (ENXIO);
-
-	device_set_desc(dev, (const char *)compat->ocd_data);
-
-	return (BUS_PROBE_DEFAULT);
-#else
+	if (compat->ocd_str != NULL) {
+		device_set_desc(dev, (const char *)compat->ocd_data);
+		return (BUS_PROBE_DEFAULT);
+	}
+#endif
 	device_set_desc(dev, "Maxim DS1307 RTC");
-
 	return (BUS_PROBE_NOWILDCARD);
-#endif
 }
 
 static int