FreeBSD/sys/kern/subr_bus.c
/**
 * @brief Probe a device and attach a driver if possible
 *
 * calls device_probe() and attaches if that was successful.
 */
@brief Probe a device and attach a driver if possible
calls device_probe() and attaches if that was successful.
@brief Probe a device and attach a driver if possible calls device_probe () and attaches if that was successful .
int
device_probe_and_attach(device_t dev)
{
	int error;
	GIANT_REQUIRED;
	error = device_probe(dev);
	if (error == -1)
		return (0);
	else if (error != 0)
		return (error);
	CURVNET_SET_QUIET(vnet0);
	error = device_attach(dev);
	CURVNET_RESTORE();
	return error;
}
int device_probe_and_attach ( device_t dev ) { int error ; GIANT_REQUIRED ; error = device_probe ( dev ) ; if ( error == -1 ) return ( 0 ) ; else if ( error != 0 ) return ( error ) ; CURVNET_SET_QUIET ( vnet0 ) ; error = device_attach ( dev ) ; CURVNET_RESTORE ( ) ; return error ; }
@brief Probe a device and attach a driver if possible
 calls device_probe() and attaches if that was successful.
@brief Probe a device and attach a driver if possible calls device_probe () and attaches if that was successful .