X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhameg-hmo%2Fapi.c;h=4ed9527e5a154a071d023a79505a859a0c572a91;hb=dd5c48a6d567a3cac62c4b0058588273bbeea171;hp=afe648911a06f4e2e106bf228ac45a5935fa3412;hpb=b0baddef5620c5783080d0e8811e668fbc2b38f5;p=libsigrok.git diff --git a/src/hardware/hameg-hmo/api.c b/src/hardware/hameg-hmo/api.c index afe64891..4ed9527e 100644 --- a/src/hardware/hameg-hmo/api.c +++ b/src/hardware/hameg-hmo/api.c @@ -24,7 +24,7 @@ #define SERIALCOMM "115200/8n1/flow=1" -SR_PRIV struct sr_dev_driver hameg_hmo_driver_info; +static struct sr_dev_driver hameg_hmo_driver_info; static const char *manufacturers[] = { "HAMEG", @@ -189,9 +189,11 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s const struct scope_config *model; struct scope_state *state; - if (!sdi || !(devc = sdi->priv)) + if (!sdi) return SR_ERR_ARG; + devc = sdi->priv; + if ((cg_type = check_channel_group(devc, cg)) == CG_INVALID) return SR_ERR; @@ -485,7 +487,8 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * struct dev_context *devc = NULL; const struct scope_config *model = NULL; - if (sdi && (devc = sdi->priv)) { + if (sdi) { + devc = sdi->priv; if ((cg_type = check_channel_group(devc, cg)) == CG_INVALID) return SR_ERR; @@ -770,7 +773,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) return SR_OK; } -SR_PRIV struct sr_dev_driver hameg_hmo_driver_info = { +static struct sr_dev_driver hameg_hmo_driver_info = { .name = "hameg-hmo", .longname = "Hameg HMO", .api_version = 1, @@ -788,3 +791,4 @@ SR_PRIV struct sr_dev_driver hameg_hmo_driver_info = { .dev_acquisition_stop = dev_acquisition_stop, .context = NULL, }; +SR_REGISTER_DEV_DRIVER(hameg_hmo_driver_info);