mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-17 04:36:22 +00:00
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:
+1
-9
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user