Allow for sdi->priv helper function in std_dev_clear
This commit is contained in:
parent
c118080b1d
commit
ae5859fff0
|
@ -117,26 +117,28 @@ SR_PRIV struct sr_config *sr_config_new(int key, GVariant *data);
|
|||
SR_PRIV void sr_config_free(struct sr_config *src);
|
||||
SR_PRIV int sr_source_remove(int fd);
|
||||
SR_PRIV int sr_source_add(int fd, int events, int timeout,
|
||||
sr_receive_data_callback_t cb, void *cb_data);
|
||||
sr_receive_data_callback_t cb, void *cb_data);
|
||||
|
||||
/*--- session.c -------------------------------------------------------------*/
|
||||
|
||||
SR_PRIV int sr_session_send(const struct sr_dev_inst *sdi,
|
||||
const struct sr_datafeed_packet *packet);
|
||||
const struct sr_datafeed_packet *packet);
|
||||
SR_PRIV int sr_session_stop_sync(void);
|
||||
|
||||
/*--- std.c -----------------------------------------------------------------*/
|
||||
|
||||
typedef int (*dev_close_t)(struct sr_dev_inst *sdi);
|
||||
typedef void (*std_dev_clear_t)(void *priv);
|
||||
|
||||
SR_PRIV int std_hw_init(struct sr_context *sr_ctx, struct sr_dev_driver *di,
|
||||
const char *prefix);
|
||||
const char *prefix);
|
||||
SR_PRIV int std_hw_dev_acquisition_stop_serial(struct sr_dev_inst *sdi,
|
||||
void *cb_data, dev_close_t hw_dev_close_fn,
|
||||
struct sr_serial_dev_inst *serial, const char *prefix);
|
||||
void *cb_data, dev_close_t hw_dev_close_fn,
|
||||
struct sr_serial_dev_inst *serial, const char *prefix);
|
||||
SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi,
|
||||
const char *prefix);
|
||||
SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver);
|
||||
const char *prefix);
|
||||
SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver,
|
||||
std_dev_clear_t clear_private);
|
||||
|
||||
/*--- hardware/common/serial.c ----------------------------------------------*/
|
||||
|
||||
|
|
5
std.c
5
std.c
|
@ -174,7 +174,8 @@ SR_PRIV int std_hw_dev_acquisition_stop_serial(struct sr_dev_inst *sdi,
|
|||
*
|
||||
* @return SR_OK on success.
|
||||
*/
|
||||
SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver)
|
||||
SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver,
|
||||
std_dev_clear_t clear_private)
|
||||
{
|
||||
struct sr_dev_inst *sdi;
|
||||
struct drv_context *drvc;
|
||||
|
@ -203,6 +204,8 @@ SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver)
|
|||
else if (sdi->inst_type == SR_INST_SERIAL)
|
||||
sr_serial_dev_inst_free(sdi->conn);
|
||||
}
|
||||
if (clear_private)
|
||||
clear_private(sdi->priv);
|
||||
sdi = l->data;
|
||||
sr_dev_inst_free(sdi);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue