From: Bert Vermeulen Date: Mon, 31 Jan 2011 23:06:32 +0000 (+0100) Subject: session_driver: remove unneeded callbacks X-Git-Tag: libsigrok-0.1.0~356 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b8c2f85f561a3e2738b621a0d42e0c066c1fcee9;p=libsigrok.git session_driver: remove unneeded callbacks --- diff --git a/device.c b/device.c index 9985fca9..f5674b4c 100644 --- a/device.c +++ b/device.c @@ -64,7 +64,7 @@ void device_close_all(void) while (devices) { device = devices->data; - if (device->plugin) + if (device->plugin && device->plugin->close) device->plugin->close(device->plugin_index); device_destroy(device); } diff --git a/session.c b/session.c index ab8e5c13..ed86de3c 100644 --- a/session.c +++ b/session.c @@ -201,7 +201,7 @@ void session_stop(void) session->running = FALSE; for (l = session->devices; l; l = l->next) { device = l->data; - if (device->plugin) + if (device->plugin && device->plugin->stop_acquisition) device->plugin->stop_acquisition(device->plugin_index, device); } diff --git a/session_driver.c b/session_driver.c index bbd5a615..1bc430d5 100644 --- a/session_driver.c +++ b/session_driver.c @@ -146,19 +146,14 @@ static int hw_opendev(int device_index) return SR_OK; } -static void hw_closedev(int device_index) -{ - - /* avoid compiler warning */ - device_index = device_index; - -} - static void *hw_get_device_info(int device_index, int device_info_id) { struct session_vdevice *vdevice; void *info; + if (device_info_id != SR_DI_CUR_SAMPLERATE) + return NULL; + if (!(vdevice = get_vdevice_by_index(device_index))) return NULL; @@ -275,19 +270,6 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) return SR_OK; } -static void hw_stop_acquisition(int device_index, gpointer session_device_id) -{ - struct session_vdevice *vdevice; - - /* avoid compiler warning */ - session_device_id = session_device_id; - -// vdevice = get_vdevice_by_index(device_index); -// zip_fclose(vdevice->capfile); -// zip_close(vdevice->archive); - -} - struct sr_device_plugin session_driver = { "session", @@ -296,11 +278,11 @@ struct sr_device_plugin session_driver = { hw_init, hw_cleanup, hw_opendev, - hw_closedev, + NULL, hw_get_device_info, hw_get_status, hw_get_capabilities, hw_set_configuration, hw_start_acquisition, - hw_stop_acquisition, + NULL };