]> sigrok.org Git - libsigrok.git/blobdiff - hardware/hantek-dso/api.c
hantek-dso: don't use deprecated hwcap_get_all() driver API call
[libsigrok.git] / hardware / hantek-dso / api.c
index ebb4edc2e9cde85aab6a507df6c53696a9e631c1..4fd07eab18f38a8244553f2c6057289cb6e11bc3 100644 (file)
@@ -157,6 +157,7 @@ static struct sr_dev_inst *dso_dev_new(int index, const struct dso_profile *prof
                prof->vendor, prof->model, NULL);
        if (!sdi)
                return NULL;
+       sdi->driver = hdi;
 
        if (!(ctx = g_try_malloc0(sizeof(struct context)))) {
                sr_err("hantek-dso: ctx malloc failed");
@@ -395,6 +396,9 @@ static int hw_info_get(int info_id, const void **data,
        case SR_DI_INST:
                *data = sdi;
                break;
+       case SR_DI_HWCAPS:
+               *data = hwcaps;
+               break;
        case SR_DI_NUM_PROBES:
                *data = GINT_TO_POINTER(NUM_PROBES);
                break;
@@ -423,6 +427,8 @@ static int hw_info_get(int info_id, const void **data,
        case SR_DI_CUR_SAMPLERATE:
                *data = &tmp;
                break;
+       default:
+               return SR_ERR_ARG;
        }
 
        return SR_OK;
@@ -438,11 +444,6 @@ static int hw_dev_status_get(int dev_index)
        return sdi->status;
 }
 
-static const int *hw_hwcap_get_all(void)
-{
-       return hwcaps;
-}
-
 static int hw_dev_config_set(int dev_index, int hwcap, const void *value)
 {
        struct sr_dev_inst *sdi;
@@ -879,7 +880,6 @@ SR_PRIV struct sr_dev_driver hantek_dso_driver_info = {
        .dev_close = hw_dev_close,
        .info_get = hw_info_get,
        .dev_status_get = hw_dev_status_get,
-//     .hwcap_get_all = hw_hwcap_get_all,
        .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,