From 049dc57b108c4b012c5da084c073b23c5e6d6f7b Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Thu, 10 Nov 2022 10:57:43 +0300 Subject: [PATCH] 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 4ac6d7a26d1f ("[PATCH] scst: Drop detect() method"). --- doc/scst_pg.sgml | 10 +--------- scst/include/scst.h | 11 ----------- scst/src/scst_main.c | 22 ---------------------- 3 files changed, 1 insertion(+), 42 deletions(-) diff --git a/doc/scst_pg.sgml b/doc/scst_pg.sgml index 5750db679..81dd91023 100644 --- a/doc/scst_pg.sgml +++ b/doc/scst_pg.sgml @@ -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. -= 0 to -signify the number of detected target adapters. A negative value should -be returned whenever there is an error. Must be defined. - = 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 diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 7ad113cea..d466ec77d 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -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;