git: ac918f4354e0 - stable/13 - ds1307: restore hints-based configuration on FDT systems

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Sat, 17 Feb 2024 19:22:29 UTC
The branch stable/13 has been updated by avg:

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

commit ac918f4354e0dd6cfcf895d395f4c03918a72eed
Author:     Andriy Gapon <avg@FreeBSD.org>
AuthorDate: 2023-05-02 20:46:39 +0000
Commit:     Andriy Gapon <avg@FreeBSD.org>
CommitDate: 2024-02-17 19:22:07 +0000

    ds1307: restore hints-based configuration on FDT systems
    
    Fall-through to non-FDT probe code if no matching device node is found.
    While here, fix indentation of the switch statement.
    Also, make the device description for the hints-based attachment the
    same as for FDT attachment.
    
    Fixes:  2486b446db ds1307: add support for the EPSON RX-8035SA I2C RTC
    (cherry picked from commit 34694f3da7f9537c34b1878206c65a8cda16c6c0)
---
 sys/dev/iicbus/ds1307.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/sys/dev/iicbus/ds1307.c b/sys/dev/iicbus/ds1307.c
index f7a01e652390..8fe425f40a4a 100644
--- a/sys/dev/iicbus/ds1307.c
+++ b/sys/dev/iicbus/ds1307.c
@@ -225,10 +225,8 @@ ds1307_probe(device_t dev)
 		return (ENXIO);
 
 	compat = ofw_bus_search_compatible(dev, ds1307_compat_data);
-	if (compat->ocd_str == NULL)
-		return (ENXIO);
-
-	switch(compat->ocd_data) {
+	if (compat->ocd_str != NULL) {
+		switch(compat->ocd_data) {
 		case TYPE_DS1307:
 			device_set_desc(dev, "Dallas DS1307");
 			break;
@@ -244,11 +242,12 @@ ds1307_probe(device_t dev)
 		default:
 			device_set_desc(dev, "Unknown DS1307-like device");
 			break;
+		}
+		return (BUS_PROBE_DEFAULT);
 	}
-	return (BUS_PROBE_DEFAULT);
 #endif
 
-	device_set_desc(dev, "Maxim DS1307 RTC");
+	device_set_desc(dev, "Maxim DS1307");
 	return (BUS_PROBE_NOWILDCARD);
 }