FreeBSD/sys/dev/bhnd/bhndb/bhndb.c
/**
 * Default bhndb(4) implementation of DEVICE_DETACH().
 * 
 * This function detaches any child devices, and if successful, releases all
 * resources held by the bridge device.
 */
Default bhndb(4) implementation of DEVICE_DETACH().

This function detaches any child devices, and if successful, releases all
resources held by the bridge device.
Default bhndb ( 4 ) implementation of DEVICE_DETACH () . This function detaches any child devices and if successful releases all resources held by the bridge device .
int
bhndb_generic_detach(device_t dev)
{
	struct bhndb_softc	*sc;
	int			 error;
	sc = device_get_softc(dev);
	if ((error = bus_generic_detach(dev)))
		return (error);
	bhndb_free_resources(sc->bus_res);
	BHNDB_LOCK_DESTROY(sc);
	return (0);
}
int bhndb_generic_detach ( device_t dev ) { struct bhndb_softc * sc ; int error ; sc = device_get_softc ( dev ) ; if ( ( error = bus_generic_detach ( dev ) ) ) return ( error ) ; bhndb_free_resources ( sc -> bus_res ) ; BHNDB_LOCK_DESTROY ( sc ) ; return ( 0 ) ; }
Default bhndb(4) implementation of DEVICE_DETACH().
Default bhndb ( 4 ) implementation of DEVICE_DETACH () .
/* Detach children */ /* Clean up our driver state. */