diff options
author | avg <avg@FreeBSD.org> | 2016-12-24 14:39:30 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2016-12-24 14:39:30 +0000 |
commit | a66ecb9db0bafa9a7f03de1d0a93798c3124f874 (patch) | |
tree | a0ebc0d4cf157f49d7ae9e3e8642110268e04eb9 /sys/dev/smbus | |
parent | 931aadcf44d190850c78526300eaceed7ba78a63 (diff) | |
download | FreeBSD-src-a66ecb9db0bafa9a7f03de1d0a93798c3124f874.zip FreeBSD-src-a66ecb9db0bafa9a7f03de1d0a93798c3124f874.tar.gz |
MFC r308220: smbus: remove the potentially very dangerous slave probing code
Diffstat (limited to 'sys/dev/smbus')
-rw-r--r-- | sys/dev/smbus/smbus.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/sys/dev/smbus/smbus.c b/sys/dev/smbus/smbus.c index d485094..328c452 100644 --- a/sys/dev/smbus/smbus.c +++ b/sys/dev/smbus/smbus.c @@ -50,7 +50,6 @@ struct smbus_ivar /* * Autoconfiguration and support routines for System Management bus */ -static void smbus_probe_device(device_t dev, u_char addr); static int smbus_probe(device_t dev) @@ -65,13 +64,9 @@ static int smbus_attach(device_t dev) { struct smbus_softc *sc = device_get_softc(dev); - unsigned char addr; mtx_init(&sc->lock, device_get_nameunit(dev), "smbus", MTX_DEF); bus_generic_probe(dev); - for (addr = SMBUS_ADDR_MIN; addr < SMBUS_ADDR_MAX; ++addr) { - smbus_probe_device(dev, addr); - } bus_enumerate_hinted_children(dev); bus_generic_attach(dev); @@ -98,30 +93,6 @@ smbus_generic_intr(device_t dev, u_char devaddr, char low, char high, int err) { } -static void -smbus_probe_device(device_t dev, u_char addr) -{ - device_t child; - int error; - u_char cmd; - u_char buf[2]; - struct smbus_ivar *devi; - - cmd = 0x01; - error = smbus_trans(dev, addr, cmd, - SMB_TRANS_NOCNT | SMB_TRANS_NOREPORT, - NULL, 0, buf, 1, NULL); - if (error == 0) { - if (bootverbose) - device_printf(dev, "Probed address 0x%02x\n", addr); - child = BUS_ADD_CHILD(dev, SMBUS_ORDER_PNP, NULL, -1); - if (child == NULL) - return; - devi = device_get_ivars(child); - devi->addr = addr; - } -} - static device_t smbus_add_child(device_t dev, u_int order, const char *name, int unit) { |