scst: Drop support for detect() method

Support for scst_tgt_template detect() method was declared obsolete
in 2015. Remove support for scst_tgt_template detect() method.

See also commit 4ac6d7a26d ("[PATCH] scst: Drop detect() method").
This commit is contained in:
Gleb Chesnokov
2022-11-10 11:46:03 +03:00
parent 2bffc71dfb
commit 049dc57b10
3 changed files with 1 additions and 42 deletions
+1 -9
View File
@@ -163,11 +163,10 @@ struct scst_tgt_template
int threads_num;
int (*detect) (struct scst_tgt_template *tgt_template);
int (*release)(struct scst_tgt *tgt);
int (*xmit_response)(struct scst_cmd *cmd);
int (* rdy_to_xfer)(struct scst_cmd *cmd);
int (*rdy_to_xfer)(struct scst_cmd *cmd);
void (*on_hw_pending_cmd_timeout) (struct scst_cmd *cmd);
@@ -230,13 +229,6 @@ dedicated threads. Used if xmit_response() or rdy_to_xfer() is blocking.
It is the target driver's duty to ensure that not more, than that number
of threads, are blocked in those functions at any time.
<item><bf/int (*detect) (struct scst_tgt_template *tgt_template)/ - this
function is intended to detect the target adapters that are present in
the system. Each found adapter should be registered by calling
<it/scst_register_target()/. The function should return a value >= 0 to
signify the number of detected target adapters. A negative value should
be returned whenever there is an error. Must be defined.
<item><bf/int (*release)(struct scst_tgt *tgt)/ - this function is
intended to free up resources allocated to the device. The function
should return 0 to indicate successful release or a negative value if
-11
View File
@@ -1005,17 +1005,6 @@ struct scst_tgt_template {
*/
void (*on_abort_cmd)(struct scst_cmd *cmd);
/*
* This function should detect the target adapters that
* are present in the system. The function should return a value
* >= 0 to signify the number of detected target adapters.
* A negative value should be returned whenever there is
* an error.
*
* OBSOLETE
*/
int (*detect)(struct scst_tgt_template *tgt_template);
/*
* This function should free up the resources allocated to the device.
* The function should return 0 to indicate successful release
-22
View File
@@ -221,10 +221,6 @@ int __scst_register_target_template(struct scst_tgt_template *vtt,
goto out;
}
if (vtt->detect)
PRINT_WARNING("detect() method is obsolete and scheduled for "
"removal (target driver %s)", vtt->name);
if (!vtt->release) {
PRINT_ERROR("Target driver %s must have "
"release() method.", vtt->name);
@@ -292,30 +288,12 @@ int __scst_register_target_template(struct scst_tgt_template *vtt,
mutex_unlock(&scst_mutex2);
mutex_unlock(&scst_mutex);
TRACE_DBG("%s", "Calling target driver's detect()");
res = vtt->detect ? vtt->detect(vtt) : 0;
TRACE_DBG("Target driver's detect() returned %d", res);
if (res < 0) {
PRINT_ERROR("%s", "The detect() routine failed");
res = -EINVAL;
goto out_del;
}
PRINT_INFO("Target template %s registered successfully", vtt->name);
out:
TRACE_EXIT_RES(res);
return res;
out_del:
scst_tgtt_sysfs_del(vtt);
mutex_lock(&scst_mutex);
mutex_lock(&scst_mutex2);
list_del(&vtt->scst_template_list_entry);
mutex_unlock(&scst_mutex2);
out_unlock:
mutex_unlock(&scst_mutex);
goto out;