sys/kern/subr_bus.c
/**
 * @brief Find a device given a unit number
 *
 * @param dc		the devclass to search
 * @param unit		the unit number to search for
 * 
 * @returns		the device with the given unit number or @c
 *			NULL if there is no such device
 */
@brief Find a device given a unit number
@param dc            the devclass to search
@param unit          the unit number to search for

@returns             the device with the given unit number or @c
NULL if there is no such device
@brief Find a device given a unit number @param dc the devclass to search @param unit the unit number to search for @returns the device with the given unit number or @c NULL if there is no such device
device_t
devclass_get_device(devclass_t dc, int unit)
{
	if (dc == NULL || unit < 0 || unit >= dc->maxunit)
		return (NULL);
	return (dc->devices[unit]);
}
device_t devclass_get_device ( devclass_t dc , int unit ) { if ( dc == NULL || unit < 0 || unit >= dc -> maxunit ) return ( NULL ) ; return ( dc -> devices [ unit ] ) ; }
@brief Find a device given a unit number
 @param dc            the devclass to search
 @param unit          the unit number to search for
@brief Find a device given a unit number @param dc the devclass to search @param unit the unit number to search for