From 3d5fda2667d2acb8d931cec2ca1c82a74caaf683 Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Thu, 27 Feb 2014 16:37:53 +0900 Subject: [PATCH] maru: replace virtqueue_add_buf function replace virtqueue_add_buf function with add_inbuf or add_outbuf Change-Id: I09224954e1d603ea723bc6e4b7c9d64b9f5fa3df Signed-off-by: GiWoong Kim --- drivers/maru/maru_virtio_evdi.c | 8 ++++---- drivers/maru/maru_virtio_hwkey.c | 2 +- drivers/maru/maru_virtio_keyboard.c | 4 ++-- drivers/maru/maru_virtio_nfc.c | 8 ++++---- drivers/maru/maru_virtio_sensor.c | 4 ++-- drivers/maru/maru_virtio_touchscreen.c | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/maru/maru_virtio_evdi.c b/drivers/maru/maru_virtio_evdi.c index ea2352f..4b3d5cc 100644 --- a/drivers/maru/maru_virtio_evdi.c +++ b/drivers/maru/maru_virtio_evdi.c @@ -142,8 +142,8 @@ int _make_buf_and_kick(void) { int ret; memset(&vevdi->read_msginfo, 0x00, sizeof(vevdi->read_msginfo)); - ret = virtqueue_add_buf(vevdi->rvq, vevdi->sg_read, 0, 1, &vevdi->read_msginfo, - GFP_ATOMIC ); + ret = virtqueue_add_inbuf(vevdi->rvq, vevdi->sg_read, + 1, &vevdi->read_msginfo, GFP_ATOMIC); if (ret < 0) { LOG("failed to add buffer to virtqueue.(%d)\n", ret); return ret; @@ -161,7 +161,7 @@ static int add_inbuf(struct virtqueue *vq, struct msg_info *msg) sg_init_one(sg, msg, sizeof(struct msg_info)); - ret = virtqueue_add_buf(vq, sg, 0, 1, msg, GFP_ATOMIC); + ret = virtqueue_add_inbuf(vq, sg, 1, msg, GFP_ATOMIC); virtqueue_kick(vq); return ret; } @@ -311,7 +311,7 @@ static ssize_t evdi_write(struct file *f, const char __user *ubuf, size_t len, } - err = virtqueue_add_buf(vevdi->svq, vevdi->sg_send, 1, 0, + err = virtqueue_add_outbuf(vevdi->svq, vevdi->sg_send, 1, &vevdi->send_msginfo, GFP_ATOMIC); /* diff --git a/drivers/maru/maru_virtio_hwkey.c b/drivers/maru/maru_virtio_hwkey.c index c9f1ffb..aa5db7d 100644 --- a/drivers/maru/maru_virtio_hwkey.c +++ b/drivers/maru/maru_virtio_hwkey.c @@ -190,7 +190,7 @@ static int virtio_hwkey_probe(struct virtio_device *vdev) } } - err = virtqueue_add_buf(vh->vq, vh->sg, 0, + err = virtqueue_add_inbuf(vh->vq, vh->sg, MAX_BUF_COUNT, (void *)MAX_BUF_COUNT, GFP_ATOMIC); /* register for input device */ diff --git a/drivers/maru/maru_virtio_keyboard.c b/drivers/maru/maru_virtio_keyboard.c index 2c123a0..e3295f2 100644 --- a/drivers/maru/maru_virtio_keyboard.c +++ b/drivers/maru/maru_virtio_keyboard.c @@ -106,7 +106,7 @@ static void vq_keyboard_handle(struct virtqueue *vq) vqidx = 0; } } - err = virtqueue_add_buf (vq, vkbd->sg, 0, KBD_BUF_SIZE, (void *)KBD_BUF_SIZE, GFP_ATOMIC); + err = virtqueue_add_inbuf(vq, vkbd->sg, KBD_BUF_SIZE, (void *)KBD_BUF_SIZE, GFP_ATOMIC); if (err < 0) { VKBD_LOG(KERN_ERR, "failed to add buffer to virtqueue.\n"); return; @@ -177,7 +177,7 @@ static int virtio_keyboard_probe(struct virtio_device *vdev) sizeof(struct EmulKbdEvent)); } - ret = virtqueue_add_buf(vkbd->vq, vkbd->sg, 0, KBD_BUF_SIZE, (void *)KBD_BUF_SIZE, GFP_ATOMIC); + ret = virtqueue_add_inbuf(vkbd->vq, vkbd->sg, KBD_BUF_SIZE, (void *)KBD_BUF_SIZE, GFP_ATOMIC); if (ret < 0) { VKBD_LOG(KERN_ERR, "failed to add buffer to virtqueue.\n"); kfree(vkbd); diff --git a/drivers/maru/maru_virtio_nfc.c b/drivers/maru/maru_virtio_nfc.c index df6c682..24fc065 100644 --- a/drivers/maru/maru_virtio_nfc.c +++ b/drivers/maru/maru_virtio_nfc.c @@ -129,8 +129,8 @@ int make_buf_and_kick(void) { int ret; memset(&vnfc->read_msginfo, 0x00, sizeof(vnfc->read_msginfo)); - ret = virtqueue_add_buf(vnfc->rvq, vnfc->sg_read, 0, 1, &vnfc->read_msginfo, - GFP_ATOMIC ); + ret = virtqueue_add_inbuf(vnfc->rvq, vnfc->sg_read, + 1, &vnfc->read_msginfo, GFP_ATOMIC); if (ret < 0) { LOG("failed to add buffer to virtqueue.(%d)\n", ret); return ret; @@ -148,7 +148,7 @@ static int add_inbuf(struct virtqueue *vq, struct msg_info *msg) sg_init_one(sg, msg, MAX_BUF_SIZE); - ret = virtqueue_add_buf(vq, sg, 0, 1, msg, GFP_ATOMIC); + ret = virtqueue_add_inbuf(vq, sg, 1, msg, GFP_ATOMIC); virtqueue_kick(vq); return ret; } @@ -292,7 +292,7 @@ static ssize_t nfc_write(struct file *f, const char __user *ubuf, size_t len, sg_init_one(vnfc->sg_send, &vnfc->send_msginfo, sizeof(vnfc->send_msginfo)); - err = virtqueue_add_buf(vnfc->svq, vnfc->sg_send, 1, 0, + err = virtqueue_add_outbuf(vnfc->svq, vnfc->sg_send, 1, &vnfc->send_msginfo, GFP_ATOMIC); /* diff --git a/drivers/maru/maru_virtio_sensor.c b/drivers/maru/maru_virtio_sensor.c index 110b9af..4500345 100644 --- a/drivers/maru/maru_virtio_sensor.c +++ b/drivers/maru/maru_virtio_sensor.c @@ -396,7 +396,7 @@ static int _make_buf_and_kick(void) { int ret; memset(&vs->read_msginfo, 0x00, sizeof(vs->read_msginfo)); - ret = virtqueue_add_buf(vs->rvq, vs->sg_read, 0, 1, &vs->read_msginfo, GFP_ATOMIC ); + ret = virtqueue_add_inbuf(vs->rvq, vs->sg_read, 1, &vs->read_msginfo, GFP_ATOMIC ); if (ret < 0) { LOG(KERN_ERR, "failed to add buffer to virtqueue.(%d)\n", ret); return ret; @@ -448,7 +448,7 @@ static void get_sensor_value(int type) LOG(KERN_INFO, "vs->send_msginfo type: %d, req: %d, buf: %s", vs->send_msginfo.type, vs->send_msginfo.req, vs->send_msginfo.buf); - err = virtqueue_add_buf(vs->svq, vs->sg_send, 1, 0, &vs->send_msginfo, GFP_ATOMIC); + err = virtqueue_add_outbuf(vs->svq, vs->sg_send, 1, &vs->send_msginfo, GFP_ATOMIC); if (err < 0) { LOG(KERN_ERR, "failed to add buffer to virtqueue (err = %d)", err); return; diff --git a/drivers/maru/maru_virtio_touchscreen.c b/drivers/maru/maru_virtio_touchscreen.c index efda72c..d1f3eb2 100644 --- a/drivers/maru/maru_virtio_touchscreen.c +++ b/drivers/maru/maru_virtio_touchscreen.c @@ -106,7 +106,7 @@ static int run_touchscreen(void *_vtouchscreen) for (index = 0; index < MAX_BUF_COUNT; index++) { sg_set_buf(&sg[index], &vbuf[index], sizeof(EmulTouchEvent)); - err = virtqueue_add_buf(vt->vq, sg, 0, index + 1, (void *)index + 1, GFP_ATOMIC); + err = virtqueue_add_inbuf(vt->vq, sg, index + 1, (void *)index + 1, GFP_ATOMIC); if (err < 0) { printk(KERN_ERR "failed to add buf\n"); } @@ -148,7 +148,7 @@ static int run_touchscreen(void *_vtouchscreen) input_sync(input_dev); /* expose buffer to other end */ - err = virtqueue_add_buf(vt->vq, sg, 0, recv_index, (void *)recv_index, GFP_ATOMIC); + err = virtqueue_add_inbuf(vt->vq, sg, recv_index, (void *)recv_index, GFP_ATOMIC); if (err < 0) { printk(KERN_ERR "failed to add buf\n"); } @@ -223,7 +223,7 @@ static void vq_touchscreen_callback(struct virtqueue *vq) } /* expose buffer to other end */ - err = virtqueue_add_buf(vt->vq, sg, 0, + err = virtqueue_add_inbuf(vt->vq, sg, recv_index, (void *)recv_index, GFP_ATOMIC); if (err < 0) { @@ -301,7 +301,7 @@ static int virtio_touchscreen_probe(struct virtio_device *vdev) for (index = 0; index < MAX_BUF_COUNT; index++) { sg_set_buf(&sg[index], &vbuf[index], sizeof(EmulTouchEvent)); - err = virtqueue_add_buf(vt->vq, sg, 0, + err = virtqueue_add_inbuf(vt->vq, sg, index + 1, (void *)index + 1, GFP_ATOMIC); if (err < 0) { -- 2.7.4