From ea4122d2bf741fef648e16aa82ad42f5a3ba5382 Mon Sep 17 00:00:00 2001 From: Nicolas Souchu Date: Mon, 25 Mar 2002 21:22:35 +0000 Subject: Fix bktr and pcf compilation with LINT --- sys/dev/bktr/bktr_i2c.c | 18 ++++++++---------- sys/dev/bktr/bktr_os.c | 5 ----- sys/dev/bktr/bktr_reg.h | 1 - sys/dev/pcf/pcf.c | 4 ++-- 4 files changed, 10 insertions(+), 18 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/bktr/bktr_i2c.c b/sys/dev/bktr/bktr_i2c.c index 20342d1cb8ab..19e8cfb129df 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 8cc13684071a..22e9bf38c770 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 874a367842d8..1e76d0e318ce 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 e4f8a69fb191..741243518dfd 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); } -- cgit v1.3