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
This commit is contained in:
Andriy Gapon 2021-11-04 13:55:35 +02:00
parent 53b356f17a
commit 27645265c4

View file

@ -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
device_set_desc(dev, "Maxim DS1307 RTC");
return (BUS_PROBE_NOWILDCARD);
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);
}
static int