return 0;
}
-struct usbg_tpg *the_only_tpg_I_currently_have;
-
static struct se_portal_group *usbg_make_tpg(
struct se_wwn *wwn,
struct config_group *group,
return ERR_PTR(-EINVAL);
if (kstrtoul(name + 5, 0, &tpgt) || tpgt > UINT_MAX)
return ERR_PTR(-EINVAL);
- if (the_only_tpg_I_currently_have) {
- pr_err("Until the gadget framework can't handle multiple\n");
- pr_err("gadgets, you can't do this here.\n");
- return ERR_PTR(-EBUSY);
- }
ret = -ENODEV;
mutex_lock(&tpg_instances_lock);
for (i = 0; i < TPG_INSTANCES; ++i)
tpg->fi = tpg_instances[i].func_inst;
mutex_unlock(&opts->dep_lock);
mutex_unlock(&tpg_instances_lock);
- the_only_tpg_I_currently_have = tpg;
return &tpg->se_tpg;
free_workqueue:
mutex_unlock(&tpg_instances_lock);
kfree(tpg);
- the_only_tpg_I_currently_have = NULL;
}
static struct se_wwn *usbg_make_tport(