diff --git a/drivers/regulator/virtio_regulator.c b/drivers/regulator/virtio_regulator.c index 99c587026668..9cf394a13bc1 100644 --- a/drivers/regulator/virtio_regulator.c +++ b/drivers/regulator/virtio_regulator.c @@ -27,7 +27,6 @@ #include #include -#define VIRTIO_REGULATOR_TIMEOUT 200 /* miliseconds */ #define VIRTIO_REGULATOR_MAX_NAME 20 #define VIRTIO_REGULATOR_VOLTAGE_UNKNOWN 1 @@ -78,12 +77,7 @@ static int virtio_regulator_enable(struct regulator_dev *rdev) virtqueue_kick(vreg->vq); - ret = wait_for_completion_timeout(&vreg->rsp_avail, - msecs_to_jiffies(VIRTIO_REGULATOR_TIMEOUT)); - if (!ret) { - ret = -ETIMEDOUT; - goto out; - } + wait_for_completion(&vreg->rsp_avail); rsp = virtqueue_get_buf(vreg->vq, &len); if (!rsp) { @@ -132,12 +126,7 @@ static int virtio_regulator_disable(struct regulator_dev *rdev) virtqueue_kick(vreg->vq); - ret = wait_for_completion_timeout(&vreg->rsp_avail, - msecs_to_jiffies(VIRTIO_REGULATOR_TIMEOUT)); - if (!ret) { - ret = -ETIMEDOUT; - goto out; - } + wait_for_completion(&vreg->rsp_avail); rsp = virtqueue_get_buf(vreg->vq, &len); if (!rsp) { @@ -198,12 +187,7 @@ static int virtio_regulator_set_voltage(struct regulator_dev *rdev, int min_uV, virtqueue_kick(vreg->vq); - ret = wait_for_completion_timeout(&vreg->rsp_avail, - msecs_to_jiffies(VIRTIO_REGULATOR_TIMEOUT)); - if (!ret) { - ret = -ETIMEDOUT; - goto out; - } + wait_for_completion(&vreg->rsp_avail); rsp = virtqueue_get_buf(vreg->vq, &len); if (!rsp) { @@ -250,12 +234,7 @@ static int virtio_regulator_get_voltage(struct regulator_dev *rdev) virtqueue_kick(vreg->vq); - ret = wait_for_completion_timeout(&vreg->rsp_avail, - msecs_to_jiffies(VIRTIO_REGULATOR_TIMEOUT)); - if (!ret) { - ret = -ETIMEDOUT; - goto out; - } + wait_for_completion(&vreg->rsp_avail); rsp = virtqueue_get_buf(vreg->vq, &len); if (!rsp) { @@ -309,12 +288,7 @@ static int virtio_regulator_set_mode(struct regulator_dev *rdev, virtqueue_kick(vreg->vq); - ret = wait_for_completion_timeout(&vreg->rsp_avail, - msecs_to_jiffies(VIRTIO_REGULATOR_TIMEOUT)); - if (!ret) { - ret = -ETIMEDOUT; - goto out; - } + wait_for_completion(&vreg->rsp_avail); rsp = virtqueue_get_buf(vreg->vq, &len); if (!rsp) { @@ -361,12 +335,7 @@ static unsigned int virtio_regulator_get_mode(struct regulator_dev *rdev) virtqueue_kick(vreg->vq); - ret = wait_for_completion_timeout(&vreg->rsp_avail, - msecs_to_jiffies(VIRTIO_REGULATOR_TIMEOUT)); - if (!ret) { - ret = -ETIMEDOUT; - goto out; - } + wait_for_completion(&vreg->rsp_avail); rsp = virtqueue_get_buf(vreg->vq, &len); if (!rsp) { @@ -419,12 +388,7 @@ static int virtio_regulator_set_load(struct regulator_dev *rdev, int load_ua) virtqueue_kick(vreg->vq); - ret = wait_for_completion_timeout(&vreg->rsp_avail, - msecs_to_jiffies(VIRTIO_REGULATOR_TIMEOUT)); - if (!ret) { - ret = -ETIMEDOUT; - goto out; - } + wait_for_completion(&vreg->rsp_avail); rsp = virtqueue_get_buf(vreg->vq, &len); if (!rsp) {