]> sigrok.org Git - libsigrok.git/commitdiff
serial-dmm: Add per-driver hw_dev_list() wrappers.
authorUwe Hermann <redacted>
Thu, 13 Dec 2012 00:41:34 +0000 (01:41 +0100)
committerUwe Hermann <redacted>
Thu, 13 Dec 2012 00:41:34 +0000 (01:41 +0100)
hardware/serial-dmm/api.c

index b9db700fd86e8d36d558a9e24a6fe88e80d83d7b..23cb9b356363cc2a504159e4f426965447e9bdcb 100644 (file)
@@ -339,15 +339,30 @@ HW_SCAN(PCE_PCE_DM32)
 HW_SCAN(RADIOSHACK_22_168)
 HW_SCAN(RADIOSHACK_22_812)
 
-static GSList *hw_dev_list(void)
+static GSList *hw_dev_list(int dmm)
 {
        struct drv_context *drvc;
 
-       drvc = di->priv;
+       drvc = dmms[dmm].di->priv;
 
        return drvc->instances;
 }
 
+/* Driver-specific hw_dev_list() function wrappers */
+#define HW_DEV_LIST(X) static GSList *hw_dev_list_##X(void) \
+                               { return hw_dev_list(X); }
+HW_DEV_LIST(DIGITEK_DT4000ZC)
+HW_DEV_LIST(TEKPOWER_TP4000ZC)
+HW_DEV_LIST(METEX_ME31)
+HW_DEV_LIST(PEAKTECH_3410)
+HW_DEV_LIST(MASTECH_MAS345)
+HW_DEV_LIST(VA_VA18B)
+HW_DEV_LIST(METEX_M3640D)
+HW_DEV_LIST(PEAKTECH_4370)
+HW_DEV_LIST(PCE_PCE_DM32)
+HW_DEV_LIST(RADIOSHACK_22_168)
+HW_DEV_LIST(RADIOSHACK_22_812)
+
 static int hw_dev_open(struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
@@ -523,7 +538,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \
        .init = hw_init_##ID_UPPER, \
        .cleanup = hw_cleanup, \
        .scan = hw_scan_##ID_UPPER, \
-       .dev_list = hw_dev_list, \
+       .dev_list = hw_dev_list_##ID_UPPER, \
        .dev_clear = clear_instances, \
        .dev_open = hw_dev_open, \
        .dev_close = hw_dev_close, \