Shorten/simplify hw_dev_list() implementations.
This commit is contained in:
parent
7c8a9e1e0f
commit
0e94d524c1
|
@ -188,11 +188,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -62,11 +62,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -513,11 +513,7 @@ free:
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int upload_firmware(int firmware_idx, struct dev_context *devc)
|
static int upload_firmware(int firmware_idx, struct dev_context *devc)
|
||||||
|
|
|
@ -172,11 +172,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -180,11 +180,7 @@ err_free_nothing:
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -134,11 +134,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -187,11 +187,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -222,11 +222,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -478,11 +478,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -341,11 +341,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -127,14 +127,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
if (!(drvc = di->priv)) {
|
|
||||||
sr_err("Driver was not initialized.");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -200,11 +200,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -169,11 +169,7 @@ static GSList *hw_scan(GSList *options, int idx)
|
||||||
|
|
||||||
static GSList *hw_dev_list(int idx)
|
static GSList *hw_dev_list(int idx)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(mic_devs[idx].di->priv))->instances;
|
||||||
|
|
||||||
drvc = mic_devs[idx].di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -218,11 +218,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -173,11 +173,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -273,11 +273,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -315,11 +315,7 @@ static GSList *hw_scan(GSList *options, int dmm)
|
||||||
|
|
||||||
static GSList *hw_dev_list(int dmm)
|
static GSList *hw_dev_list(int dmm)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(dmms[dmm].di->priv))->instances;
|
||||||
|
|
||||||
drvc = dmms[dmm].di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -144,11 +144,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -142,11 +142,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -135,14 +135,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
if (!(drvc = di->priv)) {
|
|
||||||
sr_err("Driver was not initialized.");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
|
@ -382,11 +382,7 @@ static GSList *hw_scan(GSList *options)
|
||||||
|
|
||||||
static GSList *hw_dev_list(void)
|
static GSList *hw_dev_list(void)
|
||||||
{
|
{
|
||||||
struct drv_context *drvc;
|
return ((struct drv_context *)(di->priv))->instances;
|
||||||
|
|
||||||
drvc = di->priv;
|
|
||||||
|
|
||||||
return drvc->instances;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hw_dev_open(struct sr_dev_inst *sdi)
|
static int hw_dev_open(struct sr_dev_inst *sdi)
|
||||||
|
|
Loading…
Reference in New Issue