svn commit: r306288 - head/sys/dev/iicbus
Justin Hibbits
jhibbits at FreeBSD.org
Sat Sep 24 05:27:14 UTC 2016
Author: jhibbits
Date: Sat Sep 24 05:27:12 2016
New Revision: 306288
URL: https://svnweb.freebsd.org/changeset/base/306288
Log:
Fix ds1307 probing
'compat' can never be NULL, because the compatible check loop ends when
compat->ocd_str is NULL. This causes ds1307 to attach to any unclaimed i2c
device.
Modified:
head/sys/dev/iicbus/ds1307.c
Modified: head/sys/dev/iicbus/ds1307.c
==============================================================================
--- head/sys/dev/iicbus/ds1307.c Sat Sep 24 04:08:16 2016 (r306287)
+++ head/sys/dev/iicbus/ds1307.c Sat Sep 24 05:27:12 2016 (r306288)
@@ -274,7 +274,7 @@ ds1307_probe(device_t dev)
compat = ofw_bus_search_compatible(dev, ds1307_compat_data);
- if (compat == NULL)
+ if (compat->ocd_str == NULL)
return (ENXIO);
device_set_desc(dev, (const char *)compat->ocd_data);
More information about the svn-src-all
mailing list