hw_init(): Save struct sr_context * parameter in struct drv_context
This commit is contained in:
parent
34f06b903e
commit
1ebe4b4e69
|
@ -103,6 +103,7 @@ static int hw_init(struct sr_context *sr_ctx)
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
di->priv = drvc;
|
di->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -440,6 +440,7 @@ static int hw_init(struct sr_context *sr_ctx)
|
||||||
sr_err("Driver context malloc failed.");
|
sr_err("Driver context malloc failed.");
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
}
|
}
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
adi->priv = drvc;
|
adi->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -77,6 +77,7 @@ static int hw_init(struct sr_context *sr_ctx)
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
di->priv = drvc;
|
di->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -86,6 +86,7 @@ static int hw_init(struct sr_context *sr_ctx)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
di->priv = drvc;
|
di->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -161,6 +161,7 @@ static int hw_init(struct sr_context *sr_ctx)
|
||||||
sr_err("Driver context malloc failed.");
|
sr_err("Driver context malloc failed.");
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
}
|
}
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
ddi->priv = drvc;
|
ddi->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -90,6 +90,7 @@ static int hw_init(struct sr_context *sr_ctx)
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
di->priv = drvc;
|
di->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -414,6 +414,7 @@ static int hw_init(struct sr_context *sr_ctx)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
fdi->priv = drvc;
|
fdi->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -268,6 +268,7 @@ static int hw_init(struct sr_context *sr_ctx)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
hdi->priv = drvc;
|
hdi->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -370,6 +370,7 @@ static int hw_init(struct sr_context *sr_ctx)
|
||||||
sr_err("ols: driver context malloc failed.");
|
sr_err("ols: driver context malloc failed.");
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
}
|
}
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
odi->priv = drvc;
|
odi->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -202,6 +202,7 @@ static int hw_init(struct sr_context *sr_ctx, int dmm)
|
||||||
di = di_22_812;
|
di = di_22_812;
|
||||||
sr_dbg("Selected '%s' subdriver.", di->name);
|
sr_dbg("Selected '%s' subdriver.", di->name);
|
||||||
|
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
di->priv = drvc;
|
di->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -82,6 +82,7 @@ static int hw_init(struct sr_context *sr_ctx)
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
di->priv = drvc;
|
di->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -75,6 +75,7 @@ static int hw_init(struct sr_context *sr_ctx, int dmm)
|
||||||
di = di_vc820;
|
di = di_vc820;
|
||||||
sr_dbg("Selected '%s' subdriver.", di->name);
|
sr_dbg("Selected '%s' subdriver.", di->name);
|
||||||
|
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
di->priv = drvc;
|
di->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -84,6 +84,7 @@ static int hw_init(struct sr_context *sr_ctx)
|
||||||
sr_err("Driver context malloc failed.");
|
sr_err("Driver context malloc failed.");
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
}
|
}
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
di->priv = drvc;
|
di->priv = drvc;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
|
@ -311,6 +311,7 @@ static int hw_init(struct sr_context *sr_ctx)
|
||||||
sr_err("zeroplus: driver context malloc failed.");
|
sr_err("zeroplus: driver context malloc failed.");
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
}
|
}
|
||||||
|
drvc->sr_ctx = sr_ctx;
|
||||||
zdi->priv = drvc;
|
zdi->priv = drvc;
|
||||||
|
|
||||||
if (libusb_init(&usb_context) != 0) {
|
if (libusb_init(&usb_context) != 0) {
|
||||||
|
|
|
@ -76,6 +76,7 @@ struct sr_serial_dev_inst {
|
||||||
|
|
||||||
/* Private driver context. */
|
/* Private driver context. */
|
||||||
struct drv_context {
|
struct drv_context {
|
||||||
|
struct sr_context *sr_ctx;
|
||||||
GSList *instances;
|
GSList *instances;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue