]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/manson-hcs-3xxx/api.c
sr_config_set(): Factor out SR_ERR_DEV_CLOSED check.
[libsigrok.git] / src / hardware / manson-hcs-3xxx / api.c
index 59e30d3fb73fdcf4bce714781db3b9e2a1b9e121..7bae92917e79b3334db9fac302412453df36263c 100644 (file)
@@ -15,8 +15,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 /**
@@ -234,13 +233,11 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
 
        (void)cg;
 
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR_DEV_CLOSED;
-
        devc = sdi->priv;
 
        switch (key) {
        case SR_CONF_LIMIT_MSEC:
+       case SR_CONF_LIMIT_SAMPLES:
                return sr_sw_limits_config_set(&devc->limits, key, data);
        case SR_CONF_VOLTAGE_TARGET:
                dval = g_variant_get_double(data);
@@ -353,9 +350,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        struct dev_context *devc;
        struct sr_serial_dev_inst *serial;
 
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR_DEV_CLOSED;
-
        devc = sdi->priv;
 
        sr_sw_limits_acquisition_start(&devc->limits);