]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/kern-scale/api.c
Add sr_dev_acquisition_start(), factor out SR_ERR_DEV_CLOSED check.
[libsigrok.git] / src / hardware / kern-scale / api.c
index 584702dacb9e3f457b65d995dcb3a396b03985c3..0f7b8709016febe4df42797d9818a25dfb69e804 100644 (file)
@@ -14,8 +14,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/>.
  */
 
 #include <config.h>
@@ -153,9 +152,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;
        serial = sdi->conn;
 
@@ -174,11 +170,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
-static int dev_acquisition_stop(struct sr_dev_inst *sdi)
-{
-       return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close);
-}
-
 #define SCALE(ID, CHIPSET, VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, \
                        VALID, PARSE) \
        &((struct scale_info) { \
@@ -196,7 +187,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
                        .dev_open = std_serial_dev_open, \
                        .dev_close = std_serial_dev_close, \
                        .dev_acquisition_start = dev_acquisition_start, \
-                       .dev_acquisition_stop = dev_acquisition_stop, \
+                       .dev_acquisition_stop = std_serial_dev_acquisition_stop, \
                        .context = NULL, \
                }, \
                VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, \