/* ccw_device_resume() calls rsch on @cdev's subchannel. Returns: %0 on success, -ENODEV on device not operational, -EINVAL on invalid device state, -EBUSY on device busy or interrupt pending. Context: Interrupts disabled, ccw device lock held  */
int ccw_device_resume(struct ccw_device *cdev)
/* ccw_device_resume() calls rsch on @cdev's subchannel. Returns: %0 on success, -ENODEV on device not operational, -EINVAL on invalid device state, -EBUSY on device busy or interrupt pending. Context: Interrupts disabled, ccw device lock held  */
int ccw_device_resume(struct ccw_device *cdev)
{
	struct subchannel *sch;
	if (!cdev || !cdev->dev.parent)
		return -ENODEV;
	sch = to_subchannel(cdev->dev.parent);
	if (!sch->schib.pmcw.ena)
		return -EINVAL;
	if (cdev->private->state == DEV_STATE_NOT_OPER)
		return -ENODEV;
	if (cdev->private->state != DEV_STATE_ONLINE ||
	    !(sch->schib.scsw.cmd.actl & SCSW_ACTL_SUSPENDED))
		return -EINVAL;
	return cio_resume(sch);
}