summaryrefslogtreecommitdiffstats
path: root/sys/dev/bktr/bktr_i2c.c
diff options
context:
space:
mode:
authornsouch <nsouch@FreeBSD.org>2002-03-25 21:22:35 +0000
committernsouch <nsouch@FreeBSD.org>2002-03-25 21:22:35 +0000
commitecc9a88e1e406c82e64264d9aafa86c93bcaae30 (patch)
tree3dbb588ab3543711e9177c2a2fffd8362296c79e /sys/dev/bktr/bktr_i2c.c
parent66959139ebfb7094360b983d6364fea2f4967f42 (diff)
downloadFreeBSD-src-ecc9a88e1e406c82e64264d9aafa86c93bcaae30.zip
FreeBSD-src-ecc9a88e1e406c82e64264d9aafa86c93bcaae30.tar.gz
Fix bktr and pcf compilation with LINT
Diffstat (limited to 'sys/dev/bktr/bktr_i2c.c')
-rw-r--r--sys/dev/bktr/bktr_i2c.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/dev/bktr/bktr_i2c.c b/sys/dev/bktr/bktr_i2c.c
index 20342d1..19e8cfb 100644
--- a/sys/dev/bktr/bktr_i2c.c
+++ b/sys/dev/bktr/bktr_i2c.c
@@ -74,6 +74,12 @@
#define I2C_DELAY 40
+/* Compilation is void if BKTR_USE_FREEBSD_SMBUS is not
+ * defined. This allows bktr owners to have smbus active for there
+ * motherboard and still use their bktr without smbus.
+ */
+#if defined(BKTR_USE_FREEBSD_SMBUS)
+
#define BTI2C_DEBUG(x) if (bti2c_debug) (x)
static int bti2c_debug = 0;
@@ -86,9 +92,6 @@ int bt848_i2c_attach(device_t dev)
struct bktr_softc *bktr_sc = (struct bktr_softc *)device_get_softc(dev);
struct bktr_i2c_softc *sc = &bktr_sc->i2c_sc;
- device_t *list;
- int count;
-
sc->smbus = device_add_child(dev, "smbus", -1);
sc->iicbb = device_add_child(dev, "iicbb", -1);
@@ -97,13 +100,6 @@ int bt848_i2c_attach(device_t dev)
bus_generic_attach(dev);
- /* the iicbus is the first child of device iicbb */
- device_get_children(sc->iicbb, &list, &count);
- if (count) {
- sc->iicbus = list[0];
- free(list, M_TEMP);
- }
-
return (0);
};
@@ -344,3 +340,5 @@ bti2c_smb_readb(device_t dev, u_char slave, char cmd, char *byte)
return (0);
}
+
+#endif /* defined(BKTR_USE_FREEBSD_SMBUS) */
OpenPOWER on IntegriCloud