]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/tondaj-sl-814/api.c
license: remove FSF postal address from boiler plate license text
[libsigrok.git] / src / hardware / tondaj-sl-814 / api.c
index cdb6f18652c5e68f6d0d29f8d7061bae9c7be918..32f5de7bcc353b1f017798f6d26caca89dcd0501 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>
@@ -41,18 +40,13 @@ static const uint32_t devopts[] = {
 
 static GSList *scan(struct sr_dev_driver *di, GSList *options)
 {
-       struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_config *src;
-       GSList *devices, *l;
+       GSList *l;
        const char *conn, *serialcomm;
        struct sr_serial_dev_inst *serial;
 
-       drvc = di->context;
-
-       devices = NULL;
-
        conn = serialcomm = NULL;
        for (l = options; l; l = l->next) {
                if (!(src = l->data)) {
@@ -93,9 +87,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        sdi->priv = devc;
        sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "P1");
-       devices = g_slist_append(devices, sdi);
 
-       return std_scan_complete(di, devices);
+       return std_scan_complete(di, g_slist_append(NULL, sdi));
 }
 
 static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
@@ -143,7 +136,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       std_session_send_df_header(sdi, LOG_PREFIX);
+       std_session_send_df_header(sdi);
        
        sr_sw_limits_acquisition_start(&devc->limits);
 
@@ -155,12 +148,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,
-                       sdi->conn, LOG_PREFIX);
-}
-
 static struct sr_dev_driver tondaj_sl_814_driver_info = {
        .name = "tondaj-sl-814",
        .longname = "Tondaj SL-814",
@@ -176,7 +163,7 @@ static struct sr_dev_driver tondaj_sl_814_driver_info = {
        .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,
 };
 SR_REGISTER_DEV_DRIVER(tondaj_sl_814_driver_info);