X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fhameg-hmo%2Fapi.c;h=cad91c75adfacc4f0059920aee54cb9ad5c45bb7;hb=f77afcf0aa421af3f8ae29d7b877a9cd114f3339;hp=46db733e83efc6fbe5909666c9be338a3e0fbe4b;hpb=4f840ce965b1c30c5ab75afecc56193cbaf5c1b3;p=libsigrok.git diff --git a/src/hardware/hameg-hmo/api.c b/src/hardware/hameg-hmo/api.c index 46db733e..cad91c75 100644 --- a/src/hardware/hameg-hmo/api.c +++ b/src/hardware/hameg-hmo/api.c @@ -109,8 +109,7 @@ fail: sr_scpi_hw_info_free(hw_info); if (sdi) sr_dev_inst_free(sdi); - if (devc) - g_free(devc); + g_free(devc); return NULL; } @@ -180,7 +179,7 @@ static int check_channel_group(struct dev_context *devc, const struct sr_channel_group *cg) { unsigned int i; - struct scope_config *model; + const struct scope_config *model; model = devc->model_config; @@ -206,7 +205,7 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s int ret, cg_type; unsigned int i; struct dev_context *devc; - struct scope_config *model; + const struct scope_config *model; struct scope_state *state; if (!sdi || !(devc = sdi->priv)) @@ -331,7 +330,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd unsigned int i, j; char command[MAX_COMMAND_SIZE], float_str[30]; struct dev_context *devc; - struct scope_config *model; + const struct scope_config *model; struct scope_state *state; const char *tmp; uint64_t p, q; @@ -501,7 +500,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * { int cg_type = CG_NONE; struct dev_context *devc = NULL; - struct scope_config *model = NULL; + const struct scope_config *model = NULL; if (sdi && (devc = sdi->priv)) { if ((cg_type = check_channel_group(devc, cg)) == CG_INVALID) @@ -572,7 +571,7 @@ SR_PRIV int hmo_request_data(const struct sr_dev_inst *sdi) char command[MAX_COMMAND_SIZE]; struct sr_channel *ch; struct dev_context *devc; - struct scope_config *model; + const struct scope_config *model; devc = sdi->priv; model = devc->model_config; @@ -640,7 +639,7 @@ static int hmo_setup_channels(const struct sr_dev_inst *sdi) gboolean *pod_enabled, setup_changed; char command[MAX_COMMAND_SIZE]; struct scope_state *state; - struct scope_config *model; + const struct scope_config *model; struct sr_channel *ch; struct dev_context *devc; struct sr_scpi_dev_inst *scpi;