ds3231: allow configuration via hints on FDT systems

MFC after:	10 days
This commit is contained in:
Andriy Gapon 2021-12-13 09:21:08 +02:00
parent b416345d5b
commit 1256067c5c

View File

@ -356,16 +356,19 @@ 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
rc = BUS_PROBE_NOWILDCARD;
#endif
device_set_desc(dev, "Maxim DS3231 RTC");
return (BUS_PROBE_DEFAULT);
return (rc);
}
static int