FreeBSD/sys/dev/bhnd/bhndb/bhndb_subr.c
/**
 * Attach a BHND bridge device to @p parent.
 * 
 * @param parent A parent PCI device.
 * @param[out] bhndb On success, the probed and attached bhndb bridge device.
 * @param unit The device unit number, or -1 to select the next available unit
 * number.
 * 
 * @retval 0 success
 * @retval non-zero Failed to attach the bhndb device.
 */
Attach a BHND bridge device to @p parent.

@param parent A parent PCI device.
@param[out] bhndb On success, the probed and attached bhndb bridge device.
@param unit The device unit number, or -1 to select the next available unit
number.

@retval 0 success
@retval non-zero Failed to attach the bhndb device.
Attach a BHND bridge device to @p parent . @param parent A parent PCI device . @param [ out ] bhndb On success the probed and attached bhndb bridge device . @param unit The device unit number or - 1 to select the next available unit number . @retval 0 success @retval non - zero Failed to attach the bhndb device .
int
bhndb_attach_bridge(device_t parent, device_t *bhndb, int unit)
{
	int error;
	*bhndb = device_add_child(parent, "bhndb", unit);
	if (*bhndb == NULL)
		return (ENXIO);
	if (!(error = device_probe_and_attach(*bhndb)))
		return (0);
	if ((device_delete_child(parent, *bhndb)))
		device_printf(parent, "failed to detach bhndb child\n");
	return (error);
}
int bhndb_attach_bridge ( device_t parent , device_t * bhndb , int unit ) { int error ; * bhndb = device_add_child ( parent , " " , unit ) ; if ( * bhndb == NULL ) return ( ENXIO ) ; if ( ! ( error = device_probe_and_attach ( * bhndb ) ) ) return ( 0 ) ; if ( ( device_delete_child ( parent , * bhndb ) ) ) device_printf ( parent , " \n " ) ; return ( error ) ; }
Attach a BHND bridge device to @p parent.
Attach a BHND bridge device to @p parent .