git: 742d8a6a6059 - stable/12 - ds3231: allow configuration via hints on FDT systems

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Thu, 23 Dec 2021 08:47:15 UTC
The branch stable/12 has been updated by avg:

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

commit 742d8a6a6059c16f6f36341ee1aab82120357c3a
Author:     Andriy Gapon <avg@FreeBSD.org>
AuthorDate: 2021-12-13 07:21:08 +0000
Commit:     Andriy Gapon <avg@FreeBSD.org>
CommitDate: 2021-12-23 08:46:56 +0000

    ds3231: allow configuration via hints on FDT systems
    
    (cherry picked from commit 1256067c5c575474e626e5f119f50275ea2d975e)
    (cherry picked from commit b277ef3304fa97da041c191b02b2fcfb74378c75)
---
 sys/dev/iicbus/ds3231.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/sys/dev/iicbus/ds3231.c b/sys/dev/iicbus/ds3231.c
index bd4142c6291b..0e95379da500 100644
--- a/sys/dev/iicbus/ds3231.c
+++ b/sys/dev/iicbus/ds3231.c
@@ -356,16 +356,20 @@ ds3231_en32khz_sysctl(SYSCTL_HANDLER_ARGS)
 static int
 ds3231_probe(device_t dev)
 {
+	int rc;
 
 #ifdef FDT
 	if (!ofw_bus_status_okay(dev))
 		return (ENXIO);
-	if (!ofw_bus_is_compatible(dev, "maxim,ds3231"))
-		return (ENXIO);
+	if (ofw_bus_is_compatible(dev, "maxim,ds3231"))
+		rc = BUS_PROBE_DEFAULT;
+	else
 #endif
+		rc = BUS_PROBE_NOWILDCARD;
+
 	device_set_desc(dev, "Maxim DS3231 RTC");
 
-	return (BUS_PROBE_DEFAULT);
+	return (rc);
 }
 
 static int