Add a struct sr_context * parameter to hw_init()
This commit is contained in:
parent
44fc870c9c
commit
34f06b903e
|
@ -94,7 +94,7 @@ static int clear_instances(void)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ struct context {
|
|||
void *session_dev_id;
|
||||
};
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct sr_dev_inst *sdi;
|
||||
struct context *ctx;
|
||||
|
|
|
@ -432,7 +432,7 @@ static int clear_instances(void)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ static int clear_instances(void)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ static int clear_instances(void)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ static int clear_instances(void)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ static int clear_instances(void)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
|
|
@ -399,7 +399,7 @@ static int clear_instances(void)
|
|||
* API callbacks
|
||||
*/
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
|
|
@ -253,7 +253,7 @@ static int clear_instances(void)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
|
|
@ -401,7 +401,7 @@ static int mso_parse_serial(const char *iSerial, const char *iProduct,
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
/* Nothing to do. */
|
||||
|
||||
|
|
|
@ -362,7 +362,7 @@ static struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial)
|
|||
return sdi;
|
||||
}
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ static int clear_instances(void)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init(int dmm)
|
||||
static int hw_init(struct sr_context *sr_ctx, int dmm)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
@ -207,59 +207,59 @@ static int hw_init(int dmm)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init_digitek_dt4000zc(void)
|
||||
static int hw_init_digitek_dt4000zc(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(DIGITEK_DT4000ZC);
|
||||
return hw_init(sr_ctx, DIGITEK_DT4000ZC);
|
||||
}
|
||||
|
||||
static int hw_init_tekpower_tp4000zc(void)
|
||||
static int hw_init_tekpower_tp4000zc(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(TEKPOWER_TP4000ZC);
|
||||
return hw_init(sr_ctx, TEKPOWER_TP4000ZC);
|
||||
}
|
||||
|
||||
static int hw_init_metex_me31(void)
|
||||
static int hw_init_metex_me31(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(METEX_ME31);
|
||||
return hw_init(sr_ctx, METEX_ME31);
|
||||
}
|
||||
|
||||
static int hw_init_peaktech_3410(void)
|
||||
static int hw_init_peaktech_3410(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(PEAKTECH_3410);
|
||||
return hw_init(sr_ctx, PEAKTECH_3410);
|
||||
}
|
||||
|
||||
static int hw_init_mastech_mas345(void)
|
||||
static int hw_init_mastech_mas345(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(MASTECH_MAS345);
|
||||
return hw_init(sr_ctx, MASTECH_MAS345);
|
||||
}
|
||||
|
||||
static int hw_init_va_va18b(void)
|
||||
static int hw_init_va_va18b(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(VA_VA18B);
|
||||
return hw_init(sr_ctx, VA_VA18B);
|
||||
}
|
||||
|
||||
static int hw_init_metex_m3640d(void)
|
||||
static int hw_init_metex_m3640d(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(METEX_M3640D);
|
||||
return hw_init(sr_ctx, METEX_M3640D);
|
||||
}
|
||||
|
||||
static int hw_init_peaktech_4370(void)
|
||||
static int hw_init_peaktech_4370(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(PEAKTECH_4370);
|
||||
return hw_init(sr_ctx, PEAKTECH_4370);
|
||||
}
|
||||
|
||||
static int hw_init_pce_pce_dm32(void)
|
||||
static int hw_init_pce_pce_dm32(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(PCE_PCE_DM32);
|
||||
return hw_init(sr_ctx, PCE_PCE_DM32);
|
||||
}
|
||||
|
||||
static int hw_init_radioshack_22_168(void)
|
||||
static int hw_init_radioshack_22_168(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(RADIOSHACK_22_168);
|
||||
return hw_init(sr_ctx, RADIOSHACK_22_168);
|
||||
}
|
||||
|
||||
static int hw_init_radioshack_22_812(void)
|
||||
static int hw_init_radioshack_22_812(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(RADIOSHACK_22_812);
|
||||
return hw_init(sr_ctx, RADIOSHACK_22_812);
|
||||
}
|
||||
|
||||
static GSList *scan(const char *conn, const char *serialcomm, int dmm)
|
||||
|
|
|
@ -73,7 +73,7 @@ static int clear_instances(void)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ static int clear_instances(void)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init(int dmm)
|
||||
static int hw_init(struct sr_context *sr_ctx, int dmm)
|
||||
{
|
||||
int ret;
|
||||
struct drv_context *drvc;
|
||||
|
@ -80,14 +80,14 @@ static int hw_init(int dmm)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init_ut61d(void)
|
||||
static int hw_init_ut61d(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(UNI_T_UT61D);
|
||||
return hw_init(sr_ctx, UNI_T_UT61D);
|
||||
}
|
||||
|
||||
static int hw_init_vc820(void)
|
||||
static int hw_init_vc820(struct sr_context *sr_ctx)
|
||||
{
|
||||
return hw_init(VOLTCRAFT_VC820);
|
||||
return hw_init(sr_ctx, VOLTCRAFT_VC820);
|
||||
}
|
||||
|
||||
static GSList *hw_scan(GSList *options)
|
||||
|
|
|
@ -76,7 +76,7 @@ static int clear_instances(void)
|
|||
return SR_OK;
|
||||
}
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ static int clear_instances(void)
|
|||
* API callbacks
|
||||
*/
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
struct drv_context *drvc;
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ SR_API int sr_driver_init(struct sr_context *ctx, struct sr_dev_driver *driver)
|
|||
{
|
||||
|
||||
if (driver->init)
|
||||
return driver->init();
|
||||
return driver->init(ctx);
|
||||
|
||||
return SR_OK;
|
||||
}
|
||||
|
|
|
@ -605,7 +605,7 @@ struct sr_dev_driver {
|
|||
char *name;
|
||||
char *longname;
|
||||
int api_version;
|
||||
int (*init) (void);
|
||||
int (*init) (struct sr_context *sr_ctx);
|
||||
int (*cleanup) (void);
|
||||
GSList *(*scan) (GSList *options);
|
||||
GSList *(*dev_list) (void);
|
||||
|
|
|
@ -117,8 +117,10 @@ static int receive_data(int fd, int revents, void *cb_data)
|
|||
/* driver callbacks */
|
||||
static int hw_cleanup(void);
|
||||
|
||||
static int hw_init(void)
|
||||
static int hw_init(struct sr_context *sr_ctx)
|
||||
{
|
||||
(void)sr_ctx;
|
||||
|
||||
return SR_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue