]> sigrok.org Git - libsigrok.git/blobdiff - src/std.c
Put driver pointers into special section
[libsigrok.git] / src / std.c
index aadf8236a790a3f79c38ece2cf6ebd191166991c..a03e509c732b4c0693ef6ee69638bffa9acc236a 100644 (file)
--- a/src/std.c
+++ b/src/std.c
  * It creates a new 'struct drv_context' (drvc), assigns sr_ctx to it, and
  * then 'drvc' is assigned to the 'struct sr_dev_driver' (di) that is passed.
  *
- * @param sr_ctx The libsigrok context to assign.
  * @param di The driver instance to use.
- * @param[in] prefix A driver-specific prefix string used for log messages.
+ * @param sr_ctx The libsigrok context to assign.
  *
  * @return SR_OK upon success, SR_ERR_ARG upon invalid arguments.
  */
-SR_PRIV int std_init(struct sr_context *sr_ctx, struct sr_dev_driver *di,
-                    const char *prefix)
+SR_PRIV int std_init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
 {
        struct drv_context *drvc;
 
-       if (!di) {
-               sr_err("%s: Invalid driver, cannot initialize.", prefix);
-               return SR_ERR_ARG;
-       }
-
        drvc = g_malloc0(sizeof(struct drv_context));
        drvc->sr_ctx = sr_ctx;
        drvc->instances = NULL;