* @brief Tells a driver to quiesce itself. * * This function is a wrapper around the DEVICE_QUIESCE() driver * method. If the call to DEVICE_QUIESCE() succeeds. * * @param dev the device to quiesce * * @retval 0 success * @retval ENXIO no driver was found * @retval ENOMEM memory allocation failure * @retval non-zero some other unix error code */
| 3050 | * @retval non-zero some other unix error code |
| 3051 | */ |
| 3052 | int |
| 3053 | device_quiesce(device_t dev) |
| 3054 | { |
| 3055 | PDEBUG(("%s", DEVICENAME(dev))); |
| 3056 | if (dev->state == DS_BUSY) |
| 3057 | return (EBUSY); |
| 3058 | if (dev->state != DS_ATTACHED) |
| 3059 | return (0); |
| 3060 | |
| 3061 | return (DEVICE_QUIESCE(dev)); |
| 3062 | } |
| 3063 | |
| 3064 | /** |
| 3065 | * @brief Notify a device of system shutdown |
no outgoing calls
no test coverage detected