X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhameg-hmo%2Fapi.c;h=f9ba81b8051cd6b331b2021cb83374e38880f88b;hb=0af636bed97c174bea46e61e961eaa1b0b162e0f;hp=78cdc1733157fc0b5dba9cb47bfd5af67b1b2cf1;hpb=aed4ad0beaf64062752039a13f9a95326aa1df87;p=libsigrok.git diff --git a/src/hardware/hameg-hmo/api.c b/src/hardware/hameg-hmo/api.c index 78cdc173..f9ba81b8 100644 --- a/src/hardware/hameg-hmo/api.c +++ b/src/hardware/hameg-hmo/api.c @@ -75,21 +75,23 @@ static struct sr_dev_inst *hmo_probe_serial_device(struct sr_scpi_dev_inst *scpi if (check_manufacturer(hw_info->manufacturer) != SR_OK) goto fail; - if (!(sdi = sr_dev_inst_new(SR_ST_ACTIVE, - hw_info->manufacturer, hw_info->model, - hw_info->firmware_version))) { - goto fail; - } + sdi = sr_dev_inst_new(); + sdi->status = SR_ST_ACTIVE; + sdi->vendor = g_strdup(hw_info->manufacturer); + sdi->model = g_strdup(hw_info->model); + sdi->version = g_strdup(hw_info->firmware_version); + sdi->serial_num = g_strdup(hw_info->serial_number); + sdi->driver = di; + sdi->inst_type = SR_INST_SCPI; + sdi->conn = scpi; + sr_scpi_hw_info_free(hw_info); hw_info = NULL; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) goto fail; - sdi->driver = di; sdi->priv = devc; - sdi->inst_type = SR_INST_SCPI; - sdi->conn = scpi; if (hmo_init_device(sdi) != SR_OK) goto fail;