]> sigrok.org Git - libsigrok.git/blobdiff - hardware/lascar-el-usb/api.c
Shorten/simplify hw_dev_list() implementations.
[libsigrok.git] / hardware / lascar-el-usb / api.c
index 1ab2a68fdb3e7f6a0fc6f23401e1d417dc4c93a4..2b442d6dc101e90585bd98a0f30af93416d35148 100644 (file)
@@ -127,14 +127,7 @@ static GSList *hw_scan(GSList *options)
 
 static GSList *hw_dev_list(void)
 {
-       struct drv_context *drvc;
-
-       if (!(drvc = di->priv)) {
-               sr_err("Driver was not initialized.");
-               return NULL;
-       }
-
-       return drvc->instances;
+       return ((struct drv_context *)(di->priv))->instances;
 }
 
 static int hw_dev_open(struct sr_dev_inst *sdi)