]> sigrok.org Git - libsigrok.git/commitdiff
sr/drivers: remove driver API call dev_status_get()
authorBert Vermeulen <redacted>
Sun, 22 Jul 2012 10:37:59 +0000 (12:37 +0200)
committerBert Vermeulen <redacted>
Fri, 3 Aug 2012 09:27:31 +0000 (11:27 +0200)
It's obsolete: no frontend ever used it, and neither did libsigrok.
The sdi->status field is only used internally by some drivers, and
should probably be moved to the driver-specific context structs.

hardware/asix-sigma/asix-sigma.c
hardware/chronovu-la8/api.c
hardware/demo/demo.c
hardware/fx2lafw/fx2lafw.c
hardware/genericdmm/api.c
hardware/hantek-dso/api.c
hardware/openbench-logic-sniffer/ols.c
hardware/zeroplus-logic-cube/zeroplus.c
libsigrok.h

index b174eaff050b8c4db4e202d8ac6e9426331be65c..ea12da8b863caf82abdc872ecb0e9c8f42c24723 100644 (file)
@@ -809,17 +809,6 @@ static int hw_info_get(int info_id, const void **data,
        return SR_OK;
 }
 
-static int hw_dev_status_get(int dev_index)
-{
-       struct sr_dev_inst *sdi;
-
-       sdi = sr_dev_inst_get(adi->instances, dev_index);
-       if (sdi)
-               return sdi->status;
-       else
-               return SR_ST_NOT_FOUND;
-}
-
 static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                const void *value)
 {
@@ -1447,7 +1436,6 @@ SR_PRIV struct sr_dev_driver asix_sigma_driver_info = {
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
        .info_get = hw_info_get,
-       .dev_status_get = hw_dev_status_get,
        .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
index 419fd118d88ccfd11848fad4b6872417f8e89ef4..a8888604e40be1805a7282a47ec17fd851cd95de 100644 (file)
@@ -305,20 +305,6 @@ static int hw_info_get(int info_id, const void **data,
        return SR_OK;
 }
 
-static int hw_dev_status_get(int dev_index)
-{
-       struct sr_dev_inst *sdi;
-
-       if (!(sdi = sr_dev_inst_get(cdi->instances, dev_index))) {
-               sr_err("la8: %s: sdi was NULL, device not found", __func__);
-               return SR_ST_NOT_FOUND;
-       }
-
-       sr_dbg("la8: Returning status: %d.", sdi->status);
-
-       return sdi->status;
-}
-
 static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                const void *value)
 {
@@ -526,7 +512,6 @@ SR_PRIV struct sr_dev_driver chronovu_la8_driver_info = {
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
        .info_get = hw_info_get,
-       .dev_status_get = hw_dev_status_get,
        .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
index 2fbac3eaaef6b415fe9a32e6c19fbc461ccd418b..2f845108a934ab7fdf6652a1b78c84cbe84b7b53 100644 (file)
@@ -229,14 +229,6 @@ static int hw_info_get(int info_id, const void **data,
        return SR_OK;
 }
 
-static int hw_dev_status_get(int dev_index)
-{
-       /* Avoid compiler warnings. */
-       (void)dev_index;
-
-       return SR_ST_ACTIVE;
-}
-
 static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                const void *value)
 {
@@ -525,7 +517,6 @@ SR_PRIV struct sr_dev_driver demo_driver_info = {
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
        .info_get = hw_info_get,
-       .dev_status_get = hw_dev_status_get,
        .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
index 87edea6f52ba936580381225b1200c13851033ac..3e67c5f54e31ee47d75f012655e60999c8958831 100644 (file)
@@ -638,17 +638,6 @@ static int hw_info_get(int info_id, const void **data,
        return SR_OK;
 }
 
-static int hw_dev_status_get(int dev_index)
-{
-       const struct sr_dev_inst *const sdi =
-               sr_dev_inst_get(fdi->instances, dev_index);
-
-       if (!sdi)
-               return SR_ST_NOT_FOUND;
-
-       return sdi->status;
-}
-
 static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                const void *value)
 {
@@ -1030,7 +1019,6 @@ SR_PRIV struct sr_dev_driver fx2lafw_driver_info = {
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
        .info_get = hw_info_get,
-       .dev_status_get = hw_dev_status_get,
        .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
index 70d49b110c235abad88f42dcf5279ae2a99c3a21..a8e13beeff7c119e29608cb5aec049ea4de733ff 100644 (file)
@@ -460,20 +460,6 @@ static int hw_info_get(int info_id, const void **data,
        return SR_OK;
 }
 
-static int hw_dev_status_get(int dev_index)
-{
-       struct sr_dev_inst *sdi;
-
-       if (!(sdi = sr_dev_inst_get(gdi->instances, dev_index))) {
-               sr_err("genericdmm: sdi was NULL, device not found.");
-               return SR_ST_NOT_FOUND;
-       }
-
-       sr_dbg("genericdmm: Returning status: %d.", sdi->status);
-
-       return sdi->status;
-}
-
 static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                const void *value)
 {
@@ -610,7 +596,6 @@ SR_PRIV struct sr_dev_driver genericdmm_driver_info = {
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
        .info_get = hw_info_get,
-       .dev_status_get = hw_dev_status_get,
        .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
index 60c913146f58b55b2c03096df2f3fa38b32c728b..72f7079365b627dda049cb796d750047d141ce9f 100644 (file)
@@ -427,16 +427,6 @@ static int hw_info_get(int info_id, const void **data,
        return SR_OK;
 }
 
-static int hw_dev_status_get(int dev_index)
-{
-       struct sr_dev_inst *sdi;
-
-       if (!(sdi = sr_dev_inst_get(hdi->instances, dev_index)))
-               return SR_ST_NOT_FOUND;
-
-       return sdi->status;
-}
-
 static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                const void *value)
 {
@@ -863,7 +853,6 @@ SR_PRIV struct sr_dev_driver hantek_dso_driver_info = {
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
        .info_get = hw_info_get,
-       .dev_status_get = hw_dev_status_get,
        .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
index ad5e7f29ed86f9220202d471b5e7a0cfb509d97a..d0fb487890a0d0f98d76390176df484bc77e3598 100644 (file)
@@ -611,16 +611,6 @@ static int hw_info_get(int info_id, const void **data,
        return SR_OK;
 }
 
-static int hw_dev_status_get(int dev_index)
-{
-       struct sr_dev_inst *sdi;
-
-       if (!(sdi = sr_dev_inst_get(odi->instances, dev_index)))
-               return SR_ST_NOT_FOUND;
-
-       return sdi->status;
-}
-
 static int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate)
 {
        struct context *ctx;
@@ -1065,7 +1055,6 @@ SR_PRIV struct sr_dev_driver ols_driver_info = {
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
        .info_get = hw_info_get,
-       .dev_status_get = hw_dev_status_get,
        .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
index c72f255163959bae146e6d3023c1d3e4023b8540..07f38366203da11ea2ff772fcee647c03b8db33b 100644 (file)
@@ -507,17 +507,6 @@ static int hw_info_get(int info_id, const void **data,
        return SR_OK;
 }
 
-static int hw_dev_status_get(int dev_index)
-{
-       struct sr_dev_inst *sdi;
-
-       sdi = sr_dev_inst_get(zdi->instances, dev_index);
-       if (sdi)
-               return sdi->status;
-       else
-               return SR_ST_NOT_FOUND;
-}
-
 static int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate)
 {
        struct context *ctx;
@@ -676,7 +665,6 @@ SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info = {
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
        .info_get = hw_info_get,
-       .dev_status_get = hw_dev_status_get,
        .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
index 33d28697adf06d3a446cad78e536a9ceeecc2cf5..c3e85c73f552451a90174f171a2beff23ab88d6f 100644 (file)
@@ -494,9 +494,8 @@ struct sr_dev_driver {
        int (*dev_close) (struct sr_dev_inst *sdi);
        /* TODO remove this */
        const void *(*dev_info_get) (int dev_index, int dev_info_id);
-       int (*info_get) (int dev_info_id, const void **data,
+       int (*info_get) (int info_id, const void **data,
                        const struct sr_dev_inst *sdi);
-       int (*dev_status_get) (int dev_index);
        int (*dev_config_set) (const struct sr_dev_inst *sdi, int hwcap,
                        const void *value);
        int (*dev_acquisition_start) (const struct sr_dev_inst *sdi,