* @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 */
| 1393 | * NULL if there is no such device |
| 1394 | */ |
| 1395 | device_t |
| 1396 | devclass_get_device(devclass_t dc, int unit) |
| 1397 | { |
| 1398 | if (dc == NULL || unit < 0 || unit >= dc->maxunit) |
| 1399 | return (NULL); |
| 1400 | return (dc->devices[unit]); |
| 1401 | } |
| 1402 | |
| 1403 | /** |
| 1404 | * @brief Find the softc field of a device given a unit number |
no outgoing calls
no test coverage detected