We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56344e2 commit a663b3cCopy full SHA for a663b3c
drivers/i2c/busses/i2c-virtio.c
@@ -116,15 +116,16 @@ static int virtio_i2c_complete_reqs(struct virtqueue *vq,
116
for (i = 0; i < num; i++) {
117
struct virtio_i2c_req *req = &reqs[i];
118
119
- wait_for_completion(&req->completion);
120
-
121
- if (!failed && req->in_hdr.status != VIRTIO_I2C_MSG_OK)
122
- failed = true;
+ if (!failed) {
+ if (wait_for_completion_interruptible(&req->completion))
+ failed = true;
+ else if (req->in_hdr.status != VIRTIO_I2C_MSG_OK)
123
124
+ else
125
+ j++;
126
+ }
127
128
i2c_put_dma_safe_msg_buf(reqs[i].buf, &msgs[i], !failed);
- if (!failed)
- j++;
129
}
130
131
return j;
0 commit comments