/* Cancel the I/O request specified by cdev->req. Return non-zero if request has already finished, zero otherwise.  */
int ccw_request_cancel(struct ccw_device *cdev)
/* Cancel the I/O request specified by cdev->req. Return non-zero if request has already finished, zero otherwise.  */
int ccw_request_cancel(struct ccw_device *cdev)
{
	struct subchannel *sch = to_subchannel(cdev->dev.parent);
	struct ccw_request *req = &cdev->private->req;
	int rc;
	if (req->done)
		return 1;
	req->cancel = 1;
	rc = cio_clear(sch);
	if (rc)
		ccwreq_stop(cdev, rc);
	return 0;
}