sr: deprecate driver API call hwcap_get_all()
This is now handled with a call to info_get(SR_DI_HWCAPS). This brings it in line with the new driver opts: info_get(SR_DI_HWOPTS).
This commit is contained in:
parent
df12380181
commit
be34a1c746
3
device.c
3
device.c
|
@ -397,7 +397,8 @@ SR_API gboolean sr_dev_has_hwcap(const struct sr_dev *dev, int hwcap)
|
|||
|
||||
/* TODO: Sanity check on 'hwcap'. */
|
||||
|
||||
if (!(hwcaps = dev->driver->hwcap_get_all())) {
|
||||
if (dev->driver->info_get(SR_DI_HWCAPS,
|
||||
(const void **)&hwcaps, NULL) != SR_OK) {
|
||||
sr_err("dev: %s: dev has no capabilities", __func__);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -338,10 +338,8 @@ SR_API gboolean sr_driver_hwcap_exists(struct sr_dev_driver *driver, int hwcap)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (!(hwcaps = driver->hwcap_get_all())) {
|
||||
sr_err("hwdriver: %s: hwcap_get_all() returned NULL", __func__);
|
||||
if (driver->info_get(SR_DI_HWCAPS, (const void **)&hwcaps, NULL) != SR_OK)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (i = 0; hwcaps[i]; i++) {
|
||||
if (hwcaps[i] == hwcap)
|
||||
|
|
|
@ -436,7 +436,12 @@ enum {
|
|||
/* Device info IDs */
|
||||
enum {
|
||||
/* struct sr_dev_inst for this specific device */
|
||||
/* TODO: obsolete */
|
||||
SR_DI_INST,
|
||||
/* A list of options supported by the driver. */
|
||||
SR_DI_HWOPTS,
|
||||
/* A list of capabilities supported by the device. */
|
||||
SR_DI_HWCAPS,
|
||||
/* The number of probes connected to this device */
|
||||
SR_DI_NUM_PROBES,
|
||||
/* The probe names on this device */
|
||||
|
@ -492,7 +497,6 @@ struct sr_dev_driver {
|
|||
int (*info_get) (int dev_info_id, const void **data,
|
||||
const struct sr_dev_inst *sdi);
|
||||
int (*dev_status_get) (int dev_index);
|
||||
const int *(*hwcap_get_all) (void);
|
||||
int (*dev_config_set) (int dev_index, int hwcap, const void *value);
|
||||
int (*dev_acquisition_start) (int dev_index, void *session_dev_id);
|
||||
int (*dev_acquisition_stop) (int dev_index, void *session_dev_id);
|
||||
|
|
Loading…
Reference in New Issue