diff options
author | brian <brian@FreeBSD.org> | 2005-07-29 00:20:50 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2005-07-29 00:20:50 +0000 |
commit | 8b3f56edd4c08f7f3a58c0db13f53d43c10c1bc0 (patch) | |
tree | 417713b791688fb5ad9260f3e2f87564bac86d7e /sys/dev/ichsmb | |
parent | 3dd597e54bb091c242c811c3b673042e2f60027e (diff) | |
download | FreeBSD-src-8b3f56edd4c08f7f3a58c0db13f53d43c10c1bc0.zip FreeBSD-src-8b3f56edd4c08f7f3a58c0db13f53d43c10c1bc0.tar.gz |
Make ichsmb unloadable.
It seems that the unload problems were due to a dodgy sc->smb usage and a
missing mtx_destroy().
Sponsored by: ActiveState/Sophos
MFC after: 3 weeks
Diffstat (limited to 'sys/dev/ichsmb')
-rw-r--r-- | sys/dev/ichsmb/ichsmb.c | 10 | ||||
-rw-r--r-- | sys/dev/ichsmb/ichsmb_pci.c | 1 |
2 files changed, 3 insertions, 8 deletions
diff --git a/sys/dev/ichsmb/ichsmb.c b/sys/dev/ichsmb/ichsmb.c index 2cfb564..9361c7e 100644 --- a/sys/dev/ichsmb/ichsmb.c +++ b/sys/dev/ichsmb/ichsmb.c @@ -108,10 +108,9 @@ ichsmb_attach(device_t dev) { const sc_p sc = device_get_softc(dev); int error; - device_t smb; /* Add child: an instance of the "smbus" device */ - if ((smb = device_add_child(dev, DRIVER_SMBUS, -1)) == NULL) { + if ((sc->smb = device_add_child(dev, DRIVER_SMBUS, -1)) == NULL) { log(LOG_ERR, "%s: no \"%s\" child found\n", device_get_nameunit(dev), DRIVER_SMBUS); return (ENXIO); @@ -677,15 +676,12 @@ ichsmb_release_resources(sc_p sc) int ichsmb_detach(device_t dev) { -#if 0 const sc_p sc = device_get_softc(dev); + + mtx_destroy(&sc->mutex); bus_generic_detach(dev); device_delete_child(dev, sc->smb); ichsmb_release_resources(sc); return 0; -#else - /*smbus drivers don't handle detach child properly*/ - return EBUSY; -#endif } diff --git a/sys/dev/ichsmb/ichsmb_pci.c b/sys/dev/ichsmb/ichsmb_pci.c index 41f7c29..54c3b97 100644 --- a/sys/dev/ichsmb/ichsmb_pci.c +++ b/sys/dev/ichsmb/ichsmb_pci.c @@ -233,4 +233,3 @@ fail: MODULE_DEPEND(ichsmb, pci, 1, 1, 1); MODULE_DEPEND(ichsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); MODULE_VERSION(ichsmb, 1); -; |