diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2009-01-15 23:14:59 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2009-01-15 23:14:59 +0000 |
commit | 7fc852ff0ae1d283a6bc38a0ca40c0c629ac1a88 (patch) | |
tree | df23f09314cc5995210e7ca898029c01d13df594 /sys/dev/iicbus/iic.c | |
parent | f1c7376075980a8a81f9f83e35d2cb6b1e93b992 (diff) | |
download | FreeBSD-src-7fc852ff0ae1d283a6bc38a0ca40c0c629ac1a88.zip FreeBSD-src-7fc852ff0ae1d283a6bc38a0ca40c0c629ac1a88.tar.gz |
Revert revision 186833 and try a different strategy to allow this device to
work when the bus attaches its own children. Instead of hardcoding a unit
number and returning BUS_PROBE_NOWILDCARD, which will break multiple iicbus
systems, check in the probe routine whether the device address is 0. Real
I2C devices will never have this address, but devices added with
BUS_ADD_CHILD() will.
Requested by: jhb
Reviewed by: jhb
Diffstat (limited to 'sys/dev/iicbus/iic.c')
-rw-r--r-- | sys/dev/iicbus/iic.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c index 685dfaf..ebc167d 100644 --- a/sys/dev/iicbus/iic.c +++ b/sys/dev/iicbus/iic.c @@ -110,14 +110,18 @@ iic_identify(driver_t *driver, device_t parent) { if (device_find_child(parent, "iic", -1) == NULL) - BUS_ADD_CHILD(parent, 0, "iic", 0); + BUS_ADD_CHILD(parent, 0, "iic", -1); } static int iic_probe(device_t dev) { + if (iicbus_get_addr(dev) > 0) + return (ENXIO); + device_set_desc(dev, "I2C generic I/O"); - return (BUS_PROBE_NOWILDCARD); + + return (0); } static int |