host-drivers/base-driver/vca/vop/vop_common.c
int vop_wait_for_completion(struct vop_dev_common *cdev, struct completion *x,
	    int timeout_ms)
{
	long res;

	while (ACCESS_ONCE(cdev->ready)) {
		res = wait_for_completion_interruptible_timeout(x,
			    msecs_to_jiffies(300));

		if (res < 0)
			return -EINTR;
		else if (res > 0)
			return ACCESS_ONCE(cdev->ready) ? 0 : -ENODEV;

		timeout_ms -= 300;
		if (timeout_ms <= 0) {
			return -EBUSY;
		}
	}
	return -ENODEV;
}
/**
 * vop_wait_for_completion: - waits for completion of a task or shutdown
 *
 * Return: 0 if done, ENODEV or EINTR if task should shut down
 * and EBUSY if timeout.
 */
- waits for completion of a task or shutdown
Return: 0 if done, ENODEV or EINTR if task should shut down
and EBUSY if timeout.
- waits for completion of a task or shutdown Return : 0 if done ENODEV or EINTR if task should shut down and EBUSY if timeout .
int vop_wait_for_completion(struct vop_dev_common *cdev, struct completion *x,
	    int timeout_ms)
{
	long res;
	while (ACCESS_ONCE(cdev->ready)) {
		res = wait_for_completion_interruptible_timeout(x,
			    msecs_to_jiffies(300));
		if (res < 0)
			return -EINTR;
		else if (res > 0)
			return ACCESS_ONCE(cdev->ready) ? 0 : -ENODEV;
		timeout_ms -= 300;
		if (timeout_ms <= 0) {
			return -EBUSY;
		}
	}
	return -ENODEV;
}
int vop_wait_for_completion ( struct vop_dev_common * cdev , struct completion * x , int timeout_ms ) { long res ; while ( ACCESS_ONCE ( cdev -> ready ) ) { res = wait_for_completion_interruptible_timeout ( x , msecs_to_jiffies ( 300 ) ) ; if ( res < 0 ) return - EINTR ; else if ( res > 0 ) return ACCESS_ONCE ( cdev -> ready ) ? 0 : - ENODEV ; timeout_ms -= 300 ; if ( timeout_ms <= 0 ) { return - EBUSY ; } } return - ENODEV ; }
vop_wait_for_completion: - waits for completion of a task or shutdown
 Return: 0 if done, ENODEV or EINTR if task should shut down
 and EBUSY if timeout.
vop_wait_for_completion : - waits for completion of a task or shutdown Return : 0 if done ENODEV or EINTR if task should shut down and EBUSY if timeout .