From: jinhyung.jo Date: Tue, 29 Apr 2014 04:29:19 +0000 (+0900) Subject: maru_camera: Fixed a bug X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~386^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b46dfb789fd100b43278736dcce3377dcfed0848;p=sdk%2Femulator%2Fqemu.git maru_camera: Fixed a bug Fix a bug that emulator is closed unexpectedly when the webcam is not connected to the host PC. Change-Id: I53c7101aa4255666dd8087d4c7034d152ea5745f Signed-off-by: Jinhyung Jo --- diff --git a/tizen/src/hw/maru_camera_common_pci.c b/tizen/src/hw/maru_camera_common_pci.c index e5dd3ce59e..4774e6f072 100644 --- a/tizen/src/hw/maru_camera_common_pci.c +++ b/tizen/src/hw/maru_camera_common_pci.c @@ -270,13 +270,15 @@ static void marucam_resetfn(DeviceState *d) { MaruCamState *s = (MaruCamState *)d; - marucam_device_close(s); - qemu_mutex_lock(&s->thread_mutex); - s->isr = s->streamon = s->req_frame = s->buf_size = 0; - qemu_mutex_unlock(&s->thread_mutex); - memset(s->vaddr, 0, MARUCAM_MEM_SIZE); - memset(s->param, 0x00, sizeof(MaruCamParam)); - INFO("[%s]\n", __func__); + if (s->initialized) { + marucam_device_close(s); + qemu_mutex_lock(&s->thread_mutex); + s->isr = s->streamon = s->req_frame = s->buf_size = 0; + qemu_mutex_unlock(&s->thread_mutex); + memset(s->vaddr, 0, MARUCAM_MEM_SIZE); + memset(s->param, 0x00, sizeof(MaruCamParam)); + TRACE("[%s] This device has been reset\n", __func__); + } } int maru_camera_pci_init(PCIBus *bus)