summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2004-05-12 13:43:41 +0000
committerjoerg <joerg@FreeBSD.org>2004-05-12 13:43:41 +0000
commit03790daf0ef18da07a62c9461c2f4e9690fdb479 (patch)
tree4920aab848f39647945a943fed425445d6b64098
parent96d8fd862ebeda912a31b75f3e11ebfd941c1e63 (diff)
downloadFreeBSD-src-03790daf0ef18da07a62c9461c2f4e9690fdb479.zip
FreeBSD-src-03790daf0ef18da07a62c9461c2f4e9690fdb479.tar.gz
Convert the #if 0 magic to #if SCAN_IICBUS, and make it actually compile
again. While it's not generally recommended anymore, it might still prove useful for debugging purposes.
-rw-r--r--sys/dev/iicbus/iicbus.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/iicbus/iicbus.c b/sys/dev/iicbus/iicbus.c
index 746ed1d..7d2070a 100644
--- a/sys/dev/iicbus/iicbus.c
+++ b/sys/dev/iicbus/iicbus.c
@@ -47,6 +47,9 @@ __FBSDID("$FreeBSD$");
static devclass_t iicbus_devclass;
+/* See comments below for why auto-scanning is a bad idea. */
+#define SCAN_IICBUS 0
+
/*
* Device methods
*/
@@ -83,7 +86,7 @@ iicbus_probe(device_t dev)
return (0);
}
-#if 0
+#if SCAN_IICBUS
static int
iic_probe_device(device_t dev, u_char addr)
{
@@ -113,6 +116,10 @@ iic_probe_device(device_t dev, u_char addr)
static int
iicbus_attach(device_t dev)
{
+#if SCAN_IICBUS
+ unsigned char addr;
+#endif
+
iicbus_reset(dev, IIC_FASTEST, 0, NULL);
/* device probing is meaningless since the bus is supposed to be
@@ -120,11 +127,11 @@ iicbus_attach(device_t dev)
* accesses like stop after start to fast, reads for less than
* x bytes...
*/
-#if 0
+#if SCAN_IICBUS
printf("Probing for devices on iicbus%d:", device_get_unit(dev));
/* probe any devices */
- for (addr = FIRST_SLAVE_ADDR; addr <= LAST_SLAVE_ADDR; addr++) {
+ for (addr = 16; addr < 240; addr++) {
if (iic_probe_device(dev, (u_char)addr)) {
printf(" <%x>", addr);
}
OpenPOWER on IntegriCloud