sr/drivers: remove driver API call dev_status_get()
It's obsolete: no frontend ever used it, and neither did libsigrok. The sdi->status field is only used internally by some drivers, and should probably be moved to the driver-specific context structs.
This commit is contained in:
parent
5d9ed643e9
commit
9e90dcba9c
|
@ -809,17 +809,6 @@ static int hw_info_get(int info_id, const void **data,
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_dev_status_get(int dev_index)
|
||||
{
|
||||
struct sr_dev_inst *sdi;
|
||||
|
||||
sdi = sr_dev_inst_get(adi->instances, dev_index);
|
||||
if (sdi)
|
||||
return sdi->status;
|
||||
else
|
||||
return SR_ST_NOT_FOUND;
|
||||
}
|
||||
|
||||
static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
|
||||
const void *value)
|
||||
{
|
||||
|
@ -1447,7 +1436,6 @@ SR_PRIV struct sr_dev_driver asix_sigma_driver_info = {
|
|||
.dev_open = hw_dev_open,
|
||||
.dev_close = hw_dev_close,
|
||||
.info_get = hw_info_get,
|
||||
.dev_status_get = hw_dev_status_get,
|
||||
.dev_config_set = hw_dev_config_set,
|
||||
.dev_acquisition_start = hw_dev_acquisition_start,
|
||||
.dev_acquisition_stop = hw_dev_acquisition_stop,
|
||||
|
|
|
@ -305,20 +305,6 @@ static int hw_info_get(int info_id, const void **data,
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_dev_status_get(int dev_index)
|
||||
{
|
||||
struct sr_dev_inst *sdi;
|
||||
|
||||
if (!(sdi = sr_dev_inst_get(cdi->instances, dev_index))) {
|
||||
sr_err("la8: %s: sdi was NULL, device not found", __func__);
|
||||
return SR_ST_NOT_FOUND;
|
||||
}
|
||||
|
||||
sr_dbg("la8: Returning status: %d.", sdi->status);
|
||||
|
||||
return sdi->status;
|
||||
}
|
||||
|
||||
static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
|
||||
const void *value)
|
||||
{
|
||||
|
@ -526,7 +512,6 @@ SR_PRIV struct sr_dev_driver chronovu_la8_driver_info = {
|
|||
.dev_open = hw_dev_open,
|
||||
.dev_close = hw_dev_close,
|
||||
.info_get = hw_info_get,
|
||||
.dev_status_get = hw_dev_status_get,
|
||||
.dev_config_set = hw_dev_config_set,
|
||||
.dev_acquisition_start = hw_dev_acquisition_start,
|
||||
.dev_acquisition_stop = hw_dev_acquisition_stop,
|
||||
|
|
|
@ -229,14 +229,6 @@ static int hw_info_get(int info_id, const void **data,
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_dev_status_get(int dev_index)
|
||||
{
|
||||
/* Avoid compiler warnings. */
|
||||
(void)dev_index;
|
||||
|
||||
return SR_ST_ACTIVE;
|
||||
}
|
||||
|
||||
static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
|
||||
const void *value)
|
||||
{
|
||||
|
@ -525,7 +517,6 @@ SR_PRIV struct sr_dev_driver demo_driver_info = {
|
|||
.dev_open = hw_dev_open,
|
||||
.dev_close = hw_dev_close,
|
||||
.info_get = hw_info_get,
|
||||
.dev_status_get = hw_dev_status_get,
|
||||
.dev_config_set = hw_dev_config_set,
|
||||
.dev_acquisition_start = hw_dev_acquisition_start,
|
||||
.dev_acquisition_stop = hw_dev_acquisition_stop,
|
||||
|
|
|
@ -638,17 +638,6 @@ static int hw_info_get(int info_id, const void **data,
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_dev_status_get(int dev_index)
|
||||
{
|
||||
const struct sr_dev_inst *const sdi =
|
||||
sr_dev_inst_get(fdi->instances, dev_index);
|
||||
|
||||
if (!sdi)
|
||||
return SR_ST_NOT_FOUND;
|
||||
|
||||
return sdi->status;
|
||||
}
|
||||
|
||||
static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
|
||||
const void *value)
|
||||
{
|
||||
|
@ -1030,7 +1019,6 @@ SR_PRIV struct sr_dev_driver fx2lafw_driver_info = {
|
|||
.dev_open = hw_dev_open,
|
||||
.dev_close = hw_dev_close,
|
||||
.info_get = hw_info_get,
|
||||
.dev_status_get = hw_dev_status_get,
|
||||
.dev_config_set = hw_dev_config_set,
|
||||
.dev_acquisition_start = hw_dev_acquisition_start,
|
||||
.dev_acquisition_stop = hw_dev_acquisition_stop,
|
||||
|
|
|
@ -460,20 +460,6 @@ static int hw_info_get(int info_id, const void **data,
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_dev_status_get(int dev_index)
|
||||
{
|
||||
struct sr_dev_inst *sdi;
|
||||
|
||||
if (!(sdi = sr_dev_inst_get(gdi->instances, dev_index))) {
|
||||
sr_err("genericdmm: sdi was NULL, device not found.");
|
||||
return SR_ST_NOT_FOUND;
|
||||
}
|
||||
|
||||
sr_dbg("genericdmm: Returning status: %d.", sdi->status);
|
||||
|
||||
return sdi->status;
|
||||
}
|
||||
|
||||
static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
|
||||
const void *value)
|
||||
{
|
||||
|
@ -610,7 +596,6 @@ SR_PRIV struct sr_dev_driver genericdmm_driver_info = {
|
|||
.dev_open = hw_dev_open,
|
||||
.dev_close = hw_dev_close,
|
||||
.info_get = hw_info_get,
|
||||
.dev_status_get = hw_dev_status_get,
|
||||
.dev_config_set = hw_dev_config_set,
|
||||
.dev_acquisition_start = hw_dev_acquisition_start,
|
||||
.dev_acquisition_stop = hw_dev_acquisition_stop,
|
||||
|
|
|
@ -427,16 +427,6 @@ static int hw_info_get(int info_id, const void **data,
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_dev_status_get(int dev_index)
|
||||
{
|
||||
struct sr_dev_inst *sdi;
|
||||
|
||||
if (!(sdi = sr_dev_inst_get(hdi->instances, dev_index)))
|
||||
return SR_ST_NOT_FOUND;
|
||||
|
||||
return sdi->status;
|
||||
}
|
||||
|
||||
static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
|
||||
const void *value)
|
||||
{
|
||||
|
@ -863,7 +853,6 @@ SR_PRIV struct sr_dev_driver hantek_dso_driver_info = {
|
|||
.dev_open = hw_dev_open,
|
||||
.dev_close = hw_dev_close,
|
||||
.info_get = hw_info_get,
|
||||
.dev_status_get = hw_dev_status_get,
|
||||
.dev_config_set = hw_dev_config_set,
|
||||
.dev_acquisition_start = hw_dev_acquisition_start,
|
||||
.dev_acquisition_stop = hw_dev_acquisition_stop,
|
||||
|
|
|
@ -611,16 +611,6 @@ static int hw_info_get(int info_id, const void **data,
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_dev_status_get(int dev_index)
|
||||
{
|
||||
struct sr_dev_inst *sdi;
|
||||
|
||||
if (!(sdi = sr_dev_inst_get(odi->instances, dev_index)))
|
||||
return SR_ST_NOT_FOUND;
|
||||
|
||||
return sdi->status;
|
||||
}
|
||||
|
||||
static int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate)
|
||||
{
|
||||
struct context *ctx;
|
||||
|
@ -1065,7 +1055,6 @@ SR_PRIV struct sr_dev_driver ols_driver_info = {
|
|||
.dev_open = hw_dev_open,
|
||||
.dev_close = hw_dev_close,
|
||||
.info_get = hw_info_get,
|
||||
.dev_status_get = hw_dev_status_get,
|
||||
.dev_config_set = hw_dev_config_set,
|
||||
.dev_acquisition_start = hw_dev_acquisition_start,
|
||||
.dev_acquisition_stop = hw_dev_acquisition_stop,
|
||||
|
|
|
@ -507,17 +507,6 @@ static int hw_info_get(int info_id, const void **data,
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_dev_status_get(int dev_index)
|
||||
{
|
||||
struct sr_dev_inst *sdi;
|
||||
|
||||
sdi = sr_dev_inst_get(zdi->instances, dev_index);
|
||||
if (sdi)
|
||||
return sdi->status;
|
||||
else
|
||||
return SR_ST_NOT_FOUND;
|
||||
}
|
||||
|
||||
static int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate)
|
||||
{
|
||||
struct context *ctx;
|
||||
|
@ -676,7 +665,6 @@ SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info = {
|
|||
.dev_open = hw_dev_open,
|
||||
.dev_close = hw_dev_close,
|
||||
.info_get = hw_info_get,
|
||||
.dev_status_get = hw_dev_status_get,
|
||||
.dev_config_set = hw_dev_config_set,
|
||||
.dev_acquisition_start = hw_dev_acquisition_start,
|
||||
.dev_acquisition_stop = hw_dev_acquisition_stop,
|
||||
|
|
|
@ -494,9 +494,8 @@ struct sr_dev_driver {
|
|||
int (*dev_close) (struct sr_dev_inst *sdi);
|
||||
/* TODO remove this */
|
||||
const void *(*dev_info_get) (int dev_index, int dev_info_id);
|
||||
int (*info_get) (int dev_info_id, const void **data,
|
||||
int (*info_get) (int info_id, const void **data,
|
||||
const struct sr_dev_inst *sdi);
|
||||
int (*dev_status_get) (int dev_index);
|
||||
int (*dev_config_set) (const struct sr_dev_inst *sdi, int hwcap,
|
||||
const void *value);
|
||||
int (*dev_acquisition_start) (const struct sr_dev_inst *sdi,
|
||||
|
|
Loading…
Reference in New Issue