]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/ftdi-la/api.c
std_init(): Drop check if pass in driver is non-NULL
[libsigrok.git] / src / hardware / ftdi-la / api.c
index 144279851e29567dc0a9edd485b3fab7069cd250..2a64729e25722fb7910c4d8ad3f0d34243ba4ec7 100644 (file)
@@ -32,7 +32,7 @@ static const uint32_t scanopts[] = {
 
 static const uint32_t devopts[] = {
        SR_CONF_LOGIC_ANALYZER,
-       SR_CONF_CONTINUOUS | SR_CONF_SET,
+       SR_CONF_CONTINUOUS,
        SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
        SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
        SR_CONF_CONN | SR_CONF_GET,
@@ -86,7 +86,7 @@ static const struct ftdi_chip_desc *chip_descs[] = {
 
 static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
 {
-       return std_init(sr_ctx, di, LOG_PREFIX);
+       return std_init(di, sr_ctx);
 }
 
 static void scan_device(struct sr_dev_driver *di, struct libusb_device *dev, GSList **devices)
@@ -263,11 +263,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                return scan_all(di, options);
 }
 
-static GSList *dev_list(const struct sr_dev_driver *di)
-{
-       return ((struct drv_context *)(di->context))->instances;
-}
-
 static void clear_helper(void *priv)
 {
        struct dev_context *devc;
@@ -348,15 +343,6 @@ static int dev_close(struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
-static int cleanup(const struct sr_dev_driver *di)
-{
-       dev_clear(di);
-
-       /* TODO: Free other driver resources, if any. */
-
-       return SR_OK;
-}
-
 static int config_get(uint32_t key, GVariant **data,
        const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
@@ -506,9 +492,9 @@ SR_PRIV struct sr_dev_driver ftdi_la_driver_info = {
        .longname = "FTDI LA",
        .api_version = 1,
        .init = init,
-       .cleanup = cleanup,
+       .cleanup = std_cleanup,
        .scan = scan,
-       .dev_list = dev_list,
+       .dev_list = std_dev_list,
        .dev_clear = dev_clear,
        .config_get = config_get,
        .config_set = config_set,