From: Uwe Hermann Date: Tue, 3 Dec 2013 15:58:34 +0000 (+0100) Subject: hameg-hmo: Use hmo_ prefix for driver-local SR_PRIV functions. X-Git-Tag: libsigrok-0.3.0~501 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=719eff68ad03b4acaea87e227eda361ef2e299be;p=libsigrok.git hameg-hmo: Use hmo_ prefix for driver-local SR_PRIV functions. --- diff --git a/hardware/hameg-hmo/api.c b/hardware/hameg-hmo/api.c index 37e458af..1663a5f3 100644 --- a/hardware/hameg-hmo/api.c +++ b/hardware/hameg-hmo/api.c @@ -38,6 +38,13 @@ static struct usb_id_info ho_models[] = { { 0x0403, 0xed73 }, /* HO730 */ }; +enum { + PG_INVALID = -1, + PG_NONE, + PG_ANALOG, + PG_DIGITAL, +}; + static int init(struct sr_context *sr_ctx) { return std_init(sr_ctx, di, LOG_PREFIX); @@ -197,7 +204,7 @@ static GSList *scan(GSList *options) if (sr_serial_extract_options(options, &serial_device, &serial_options) == SR_OK) { - sdi = hameg_probe_serial_device(serial_device, serial_options); + sdi = hmo_probe_serial_device(serial_device, serial_options); if (sdi != NULL) { devices = g_slist_append(devices, sdi); drvc->instances = g_slist_append(drvc->instances, sdi); @@ -213,7 +220,7 @@ static GSList *scan(GSList *options) } for (l = tty_devs; l; l = l->next) { - sdi = hameg_probe_serial_device(l->data, serial_options); + sdi = hmo_probe_serial_device(l->data, serial_options); if (sdi != NULL) { devices = g_slist_append(devices, sdi); drvc->instances = g_slist_append(drvc->instances, sdi); @@ -240,7 +247,7 @@ static void clear_helper(void *priv) devc = priv; model = devc->model_config; - scope_state_free(devc->model_state); + hmo_scope_state_free(devc->model_state); for (i = 0; i < model->analog_channels; ++i) g_slist_free(devc->analog_groups[i].probes); @@ -267,7 +274,7 @@ static int dev_open(struct sr_dev_inst *sdi) serial_open(sdi->conn, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK) return SR_ERR; - if (scope_state_get(sdi) != SR_OK) + if (hmo_scope_state_get(sdi) != SR_OK) return SR_ERR; sdi->status = SR_ST_ACTIVE; @@ -778,7 +785,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) return SR_ERR; } - sr_source_add(serial->fd, G_IO_IN, 50, hameg_hmo_receive_data, (void *)sdi); + sr_source_add(serial->fd, G_IO_IN, 50, hmo_receive_data, (void *)sdi); /* Send header packet to the session bus. */ std_session_send_df_header(cb_data, LOG_PREFIX); diff --git a/hardware/hameg-hmo/protocol.c b/hardware/hameg-hmo/protocol.c index 68ab39cb..d76a6778 100644 --- a/hardware/hameg-hmo/protocol.c +++ b/hardware/hameg-hmo/protocol.c @@ -398,7 +398,7 @@ static int digital_channel_state_get(struct sr_serial_dev_inst *serial, return SR_OK; } -SR_PRIV int scope_state_get(struct sr_dev_inst *sdi) +SR_PRIV int hmo_scope_state_get(struct sr_dev_inst *sdi) { struct dev_context *devc; struct scope_state *state; @@ -473,7 +473,7 @@ fail: return NULL; } -SR_PRIV void scope_state_free(struct scope_state *state) +SR_PRIV void hmo_scope_state_free(struct scope_state *state) { g_free(state->analog_channels); g_free(state->digital_channels); @@ -560,8 +560,8 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi) return SR_OK; } -SR_PRIV struct sr_dev_inst *hameg_probe_serial_device(const char *serial_device, - const char *serial_options) +SR_PRIV struct sr_dev_inst *hmo_probe_serial_device(const char *serial_device, + const char *serial_options) { struct sr_dev_inst *sdi; struct dev_context *devc; @@ -622,7 +622,7 @@ fail: return NULL; } -SR_PRIV int hameg_hmo_receive_data(int fd, int revents, void *cb_data) +SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data) { struct sr_probe *probe; struct sr_dev_inst *sdi; diff --git a/hardware/hameg-hmo/protocol.h b/hardware/hameg-hmo/protocol.h index 9f27f01b..ff3b3982 100644 --- a/hardware/hameg-hmo/protocol.h +++ b/hardware/hameg-hmo/protocol.h @@ -41,13 +41,6 @@ SR_PRIV struct sr_dev_driver hameg_hmo_driver_info; static struct sr_dev_driver *di = &hameg_hmo_driver_info; -enum { - PG_INVALID = -1, - PG_NONE, - PG_ANALOG, - PG_DIGITAL, -}; - struct scope_config { const char *name[MAX_INSTRUMENT_VERSIONS]; const uint8_t analog_channels; @@ -121,12 +114,12 @@ struct dev_context { SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi); SR_PRIV int hmo_request_data(const struct sr_dev_inst *sdi); -SR_PRIV int hameg_hmo_receive_data(int fd, int revents, void *cb_data); -SR_PRIV struct sr_dev_inst *hameg_probe_serial_device(const char *serial_device, - const char *serial_options); +SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data); +SR_PRIV struct sr_dev_inst *hmo_probe_serial_device(const char *serial_device, + const char *serial_options); -SR_PRIV struct scope_state *scope_state_new(struct scope_config *config); -SR_PRIV void scope_state_free(struct scope_state *state); -SR_PRIV int scope_state_get(struct sr_dev_inst *sdi); +SR_PRIV struct scope_state *hmo_scope_state_new(struct scope_config *config); +SR_PRIV void hmo_scope_state_free(struct scope_state *state); +SR_PRIV int hmo_scope_state_get(struct sr_dev_inst *sdi); #endif