]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/sysclk-lwla/api.c
Remove unnecessary std_init() wrapper functions
[libsigrok.git] / src / hardware / sysclk-lwla / api.c
index 8ee85a62be0c08aa0ec214798fdce4757c52e71d..99c73282bc8dfd16c544c9608274a5fdbfc8bf55 100644 (file)
@@ -61,13 +61,6 @@ static const char *const signal_edge_names[] = {
        [EDGE_NEGATIVE] = "f",
 };
 
-/* Initialize the SysClk LWLA driver.
- */
-static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
-{
-       return std_init(sr_ctx, di, LOG_PREFIX);
-}
-
 /* Create a new sigrok device instance for the indicated LWLA model.
  */
 static struct sr_dev_inst *dev_inst_new(const struct model_info *model)
@@ -212,13 +205,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        return devices;
 }
 
-/* Return the list of devices found during scan.
- */
-static GSList *dev_list(const struct sr_dev_driver *di)
-{
-       return ((struct drv_context *)(di->context))->instances;
-}
-
 /* Destroy the private device context.
  */
 static void clear_dev_context(void *priv)
@@ -289,10 +275,6 @@ static int dev_open(struct sr_dev_inst *sdi)
        devc = sdi->priv;
        usb = sdi->conn;
 
-       if (!drvc) {
-               sr_err("Driver was not initialized.");
-               return SR_ERR;
-       }
        if (sdi->status != SR_ST_INACTIVE) {
                sr_err("Device already open.");
                return SR_ERR;
@@ -356,19 +338,13 @@ static int dev_open(struct sr_dev_inst *sdi)
  */
 static int dev_close(struct sr_dev_inst *sdi)
 {
-       struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_usb_dev_inst *usb;
        int ret;
 
-       drvc = sdi->driver->context;
        devc = sdi->priv;
        usb = sdi->conn;
 
-       if (!drvc) {
-               sr_err("Driver was not initialized.");
-               return SR_ERR;
-       }
        if (sdi->status == SR_ST_INACTIVE) {
                sr_dbg("Device already closed.");
                return SR_OK;
@@ -802,10 +778,10 @@ SR_PRIV struct sr_dev_driver sysclk_lwla_driver_info = {
        .name = "sysclk-lwla",
        .longname = "SysClk LWLA series",
        .api_version = 1,
-       .init = init,
-       .cleanup = dev_clear,
+       .init = std_init,
+       .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,