From: GiWoong Kim Date: Wed, 23 Apr 2014 04:10:56 +0000 (+0900) Subject: touch: modified virtio device class init X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~386^2~35^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6fb7c2e88f6a2fe00b9b3f892610f05ef6d245cf;p=sdk%2Femulator%2Fqemu.git touch: modified virtio device class init convert init to realize Change-Id: Id0e126b133cb8db37a29b9acd80813c4c4729b35 Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/hw/maru_virtio_touchscreen.c b/tizen/src/hw/maru_virtio_touchscreen.c index 2f0f1789ab..5b98cff2b6 100644 --- a/tizen/src/hw/maru_virtio_touchscreen.c +++ b/tizen/src/hw/maru_virtio_touchscreen.c @@ -28,7 +28,6 @@ #include -#include "ui/console.h" #include "maru_virtio_touchscreen.h" #include "maru_device_ids.h" #include "emul_state.h" @@ -306,10 +305,10 @@ static void maru_touchscreen_bh(void *opaque) maru_virtio_touchscreen_notify(); } -static int virtio_touchscreen_device_init(VirtIODevice *vdev) +static void virtio_touchscreen_device_realize(DeviceState *dev, Error **errp) { - DeviceState *qdev = DEVICE(vdev); - ts = VIRTIO_TOUCHSCREEN(vdev); + VirtIODevice *vdev = VIRTIO_DEVICE(dev); + ts = VIRTIO_TOUCHSCREEN(dev); INFO("initialize the touchscreen device\n"); @@ -321,17 +320,15 @@ static int virtio_touchscreen_device_init(VirtIODevice *vdev) // TODO: reduce size ts->vq = virtio_add_queue(&ts->vdev, 64, maru_virtio_touchscreen_handle); - ts->qdev = qdev; + ts->qdev = dev; /* bottom halves */ ts->bh = qemu_bh_new(maru_touchscreen_bh, ts); - - return 0; } -static int virtio_touchscreen_device_exit(DeviceState *qdev) +static void virtio_touchscreen_device_unrealize(DeviceState *dev, Error **errp) { - VirtIODevice *vdev = VIRTIO_DEVICE(qdev); + VirtIODevice *vdev = VIRTIO_DEVICE(dev); INFO("exit the touchscreen device\n"); @@ -343,8 +340,6 @@ static int virtio_touchscreen_device_exit(DeviceState *qdev) pthread_mutex_destroy(&event_mutex); pthread_mutex_destroy(&elem_mutex); - - return 0; } static Property virtio_touchscreen_properties[] = { @@ -388,9 +383,10 @@ static void virtio_touchscreen_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->exit = virtio_touchscreen_device_exit; + dc->props = virtio_touchscreen_properties; - vdc->init = virtio_touchscreen_device_init; + vdc->realize = virtio_touchscreen_device_realize; + vdc->unrealize = virtio_touchscreen_device_unrealize; vdc->reset = virtio_touchscreen_device_reset; vdc->get_config = virtio_touchscreen_get_config; vdc->set_config = virtio_touchscreen_set_config; diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index ab13671fc8..3cc555fb64 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -39,6 +39,7 @@ #include "maruskin_operation.h" #include "hw/maru_brightness.h" #include "hw/maru_virtio_hwkey.h" +#include "hw/maru_virtio_touchscreen.h" #include "maru_display.h" #include "emulator.h" #include "debug_ch.h"