summaryrefslogtreecommitdiffstats
path: root/sys/dev
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
parent66959139ebfb7094360b983d6364fea2f4967f42 (diff)
downloadFreeBSD-src-ecc9a88e1e406c82e64264d9aafa86c93bcaae30.zip
FreeBSD-src-ecc9a88e1e406c82e64264d9aafa86c93bcaae30.tar.gz
Fix bktr and pcf compilation with LINT
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/bktr/bktr_i2c.c18
-rw-r--r--sys/dev/bktr/bktr_os.c5
-rw-r--r--sys/dev/bktr/bktr_reg.h1
-rw-r--r--sys/dev/pcf/pcf.c4
4 files changed, 10 insertions, 18 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) */
diff --git a/sys/dev/bktr/bktr_os.c b/sys/dev/bktr/bktr_os.c
index 8cc1368..22e9bf3 100644
--- a/sys/dev/bktr/bktr_os.c
+++ b/sys/dev/bktr/bktr_os.c
@@ -986,11 +986,6 @@ bktr_attach( pcici_t tag, int unit )
#endif
pci_conf_write(tag, 0x40, fun);
-#if defined(BKTR_USE_FREEBSD_SMBUS)
- if (bt848_i2c_attach(dev))
- printf("bktr%d: i2c_attach: can't attach\n", unit);
-#endif
-
/*
* PCI latency timer. 32 is a good value for 4 bus mastering slots, if
* you have more than four, then 16 would probably be a better value.
diff --git a/sys/dev/bktr/bktr_reg.h b/sys/dev/bktr/bktr_reg.h
index 874a367..1e76d0e 100644
--- a/sys/dev/bktr/bktr_reg.h
+++ b/sys/dev/bktr/bktr_reg.h
@@ -449,7 +449,6 @@ struct bktr_i2c_softc {
int bus_owned;
device_t iicbb;
- device_t iicbus;
device_t smbus;
};
#endif
diff --git a/sys/dev/pcf/pcf.c b/sys/dev/pcf/pcf.c
index e4f8a69..7412435 100644
--- a/sys/dev/pcf/pcf.c
+++ b/sys/dev/pcf/pcf.c
@@ -197,10 +197,10 @@ pcf_attach(device_t pcfdev)
return (error);
}
- pcf->iicbus = iicbus_alloc_bus(pcfdev);
+ pcf->iicbus = device_add_child(pcfdev, "iicbus", -1);
/* probe and attach the iicbus */
- device_probe_and_attach(pcf->iicbus);
+ bus_generic_attach(pcfdev);
return (0);
}
OpenPOWER on IntegriCloud