mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-29 18:00:18 +00:00
scst: Drop support for scst_register_target(..., NULL)
Support for autogenerated target names was declared obsolete in 2011. Remove
support for autogenerated target names. See also commit 21d503cbb7
("Autogenerated SCST target names made deprecated").
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8904 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -464,37 +464,18 @@ struct scst_tgt *scst_register_target(struct scst_tgt_template *vtt,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
BUG_ON(!target_name);
|
||||
|
||||
rc = scst_alloc_tgt(vtt, &tgt);
|
||||
if (rc != 0)
|
||||
goto out;
|
||||
|
||||
if (target_name != NULL) {
|
||||
|
||||
tgt->tgt_name = kstrdup(target_name, GFP_KERNEL);
|
||||
if (tgt->tgt_name == NULL) {
|
||||
PRINT_ERROR("Allocation of tgt name %s failed",
|
||||
target_name);
|
||||
rc = -ENOMEM;
|
||||
goto out_free_tgt;
|
||||
}
|
||||
} else {
|
||||
static int tgt_num; /* protected by scst_mutex */
|
||||
|
||||
PRINT_WARNING("Usage of autogenerated SCST target names "
|
||||
"is deprecated and will be removed in one of the next "
|
||||
"versions. It is strongly recommended to update target "
|
||||
"driver %s to use hardware related persistent target "
|
||||
"names instead", vtt->name);
|
||||
|
||||
tgt->tgt_name = kasprintf(GFP_KERNEL, "%s%s%d", vtt->name,
|
||||
SCST_DEFAULT_TGT_NAME_SUFFIX, tgt_num);
|
||||
if (tgt->tgt_name == NULL) {
|
||||
PRINT_ERROR("Allocation of tgt name failed "
|
||||
"(template name %s)", vtt->name);
|
||||
rc = -ENOMEM;
|
||||
goto out_free_tgt;
|
||||
}
|
||||
tgt_num++;
|
||||
tgt->tgt_name = kstrdup(target_name, GFP_KERNEL);
|
||||
if (tgt->tgt_name == NULL) {
|
||||
PRINT_ERROR("Allocation of tgt name %s failed",
|
||||
target_name);
|
||||
rc = -ENOMEM;
|
||||
goto out_free_tgt;
|
||||
}
|
||||
|
||||
rc = mutex_lock_interruptible(&scst_mutex);
|
||||
|
||||
Reference in New Issue
Block a user