Add small helper for creating struct sr_config
This commit is contained in:
parent
72e435ab94
commit
4c0e310ca3
12
hwdriver.c
12
hwdriver.c
|
@ -285,6 +285,18 @@ SR_PRIV void sr_hw_cleanup_all(void)
|
|||
}
|
||||
}
|
||||
|
||||
SR_PRIV struct sr_config *sr_config_make(int key, const void *value)
|
||||
{
|
||||
struct sr_config *src;
|
||||
|
||||
if (!(src = g_try_malloc(sizeof(struct sr_config))))
|
||||
return NULL;
|
||||
src->key = key;
|
||||
src->value = value;
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about the given driver or device instance.
|
||||
*
|
||||
|
|
|
@ -113,6 +113,7 @@ SR_PRIV void sr_serial_dev_inst_free(struct sr_serial_dev_inst *serial);
|
|||
/*--- hwdriver.c ------------------------------------------------------------*/
|
||||
|
||||
SR_PRIV void sr_hw_cleanup_all(void);
|
||||
SR_PRIV struct sr_config *sr_config_make(int key, const void *value);
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue