Shorten/simplify hw_dev_list() implementations.

This commit is contained in:
Uwe Hermann 2013-02-02 19:52:26 +01:00
parent 7c8a9e1e0f
commit 0e94d524c1
21 changed files with 21 additions and 111 deletions

View File

@ -188,11 +188,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -62,11 +62,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -513,11 +513,7 @@ free:
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int upload_firmware(int firmware_idx, struct dev_context *devc)

View File

@ -172,11 +172,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -180,11 +180,7 @@ err_free_nothing:
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -134,11 +134,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -187,11 +187,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -222,11 +222,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -478,11 +478,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -341,11 +341,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View 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)

View File

@ -200,11 +200,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -169,11 +169,7 @@ static GSList *hw_scan(GSList *options, int idx)
static GSList *hw_dev_list(int idx)
{
struct drv_context *drvc;
drvc = mic_devs[idx].di->priv;
return drvc->instances;
return ((struct drv_context *)(mic_devs[idx].di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -218,11 +218,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -173,11 +173,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -273,11 +273,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -315,11 +315,7 @@ static GSList *hw_scan(GSList *options, int dmm)
static GSList *hw_dev_list(int dmm)
{
struct drv_context *drvc;
drvc = dmms[dmm].di->priv;
return drvc->instances;
return ((struct drv_context *)(dmms[dmm].di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -144,11 +144,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -142,11 +142,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)

View File

@ -135,14 +135,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)

View File

@ -382,11 +382,7 @@ static GSList *hw_scan(GSList *options)
static GSList *hw_dev_list(void)
{
struct drv_context *drvc;
drvc = di->priv;
return drvc->instances;
return ((struct drv_context *)(di->priv))->instances;
}
static int hw_dev_open(struct sr_dev_inst *sdi)