iicsmb.c (227843) | iicsmb.c (289657) |
---|---|
1/*- 2 * Copyright (c) 1998, 2001 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1998, 2001 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/iicbus/iicsmb.c 227843 2011-11-22 21:28:20Z marius $"); | 28__FBSDID("$FreeBSD: head/sys/dev/iicbus/iicsmb.c 289657 2015-10-20 19:52:59Z dumbbell $"); |
29 30/* 31 * I2C to SMB bridge 32 * 33 * Example: 34 * 35 * smb bttv 36 * \ / --- 125 unchanged lines hidden (view full) --- 162 163 return (0); 164} 165 166static int 167iicsmb_detach(device_t dev) 168{ 169 struct iicsmb_softc *sc = (struct iicsmb_softc *)device_get_softc(dev); | 29 30/* 31 * I2C to SMB bridge 32 * 33 * Example: 34 * 35 * smb bttv 36 * \ / --- 125 unchanged lines hidden (view full) --- 162 163 return (0); 164} 165 166static int 167iicsmb_detach(device_t dev) 168{ 169 struct iicsmb_softc *sc = (struct iicsmb_softc *)device_get_softc(dev); |
170 | 170 |
171 bus_generic_detach(dev); | 171 bus_generic_detach(dev); |
172 if (sc->smbus) { 173 device_delete_child(dev, sc->smbus); 174 } | 172 device_delete_children(dev); |
175 mtx_destroy(&sc->lock); 176 177 return (0); 178} 179 180/* 181 * iicsmb_intr() 182 * --- 336 unchanged lines hidden --- | 173 mtx_destroy(&sc->lock); 174 175 return (0); 176} 177 178/* 179 * iicsmb_intr() 180 * --- 336 unchanged lines hidden --- |