diff options
author | Christoph Hellwig <hch@lst.de> | 2018-03-19 08:37:53 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-03-19 22:54:47 -0400 |
commit | 83c9f08e6c6a6dc668384882de4dcf5ef4ae0ba7 (patch) | |
tree | 6751b9993669a3ac2739378d3a5c1a3c00910de2 /drivers/scsi | |
parent | 616434e2aa7091f0fc5f7838af0f8bc809c8cf85 (diff) | |
download | talos-obmc-linux-83c9f08e6c6a6dc668384882de4dcf5ef4ae0ba7.tar.gz talos-obmc-linux-83c9f08e6c6a6dc668384882de4dcf5ef4ae0ba7.zip |
scsi: remove the old scsi_module.c initialization model
After more than 15 years all users of this legacy interface are finally
gone. Rest in peace!
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/hosts.c | 23 | ||||
-rw-r--r-- | drivers/scsi/scsi_module.c | 73 |
2 files changed, 0 insertions, 96 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 0a5362822ed6..ffd1030b6c91 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -518,29 +518,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) } EXPORT_SYMBOL(scsi_host_alloc); -struct Scsi_Host *scsi_register(struct scsi_host_template *sht, int privsize) -{ - struct Scsi_Host *shost = scsi_host_alloc(sht, privsize); - - if (!sht->detect) { - printk(KERN_WARNING "scsi_register() called on new-style " - "template for driver %s\n", sht->name); - dump_stack(); - } - - if (shost) - list_add_tail(&shost->sht_legacy_list, &sht->legacy_hosts); - return shost; -} -EXPORT_SYMBOL(scsi_register); - -void scsi_unregister(struct Scsi_Host *shost) -{ - list_del(&shost->sht_legacy_list); - scsi_host_put(shost); -} -EXPORT_SYMBOL(scsi_unregister); - static int __scsi_host_match(struct device *dev, const void *data) { struct Scsi_Host *p; diff --git a/drivers/scsi/scsi_module.c b/drivers/scsi/scsi_module.c deleted file mode 100644 index 489175833709..000000000000 --- a/drivers/scsi/scsi_module.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2003 Christoph Hellwig. - * Released under GPL v2. - * - * Support for old-style host templates. - * - * NOTE: Do not use this for new drivers ever. - */ - -#include <linux/init.h> -#include <linux/kernel.h> -#include <linux/module.h> - -#include <scsi/scsi_host.h> - - -static int __init init_this_scsi_driver(void) -{ - struct scsi_host_template *sht = &driver_template; - struct Scsi_Host *shost; - struct list_head *l; - int error; - - if (!sht->release) { - printk(KERN_ERR - "scsi HBA driver %s didn't set a release method.\n", - sht->name); - return -EINVAL; - } - - sht->module = THIS_MODULE; - INIT_LIST_HEAD(&sht->legacy_hosts); - - sht->detect(sht); - if (list_empty(&sht->legacy_hosts)) - return -ENODEV; - - list_for_each_entry(shost, &sht->legacy_hosts, sht_legacy_list) { - error = scsi_add_host(shost, NULL); - if (error) - goto fail; - scsi_scan_host(shost); - } - return 0; - fail: - l = &shost->sht_legacy_list; - while ((l = l->prev) != &sht->legacy_hosts) - scsi_remove_host(list_entry(l, struct Scsi_Host, sht_legacy_list)); - return error; -} - -static void __exit exit_this_scsi_driver(void) -{ - struct scsi_host_template *sht = &driver_template; - struct Scsi_Host *shost, *s; - - list_for_each_entry(shost, &sht->legacy_hosts, sht_legacy_list) - scsi_remove_host(shost); - list_for_each_entry_safe(shost, s, &sht->legacy_hosts, sht_legacy_list) - sht->release(shost); - - if (list_empty(&sht->legacy_hosts)) - return; - - printk(KERN_WARNING "%s did not call scsi_unregister\n", sht->name); - dump_stack(); - - list_for_each_entry_safe(shost, s, &sht->legacy_hosts, sht_legacy_list) - scsi_unregister(shost); -} - -module_init(init_this_scsi_driver); -module_exit(exit_this_scsi_driver); |