cregit-Linux how code gets into the kernel

Release 4.11 drivers/scsi/scsi_module.c

Directory: drivers/scsi
/*
 * 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; }

Contributors

PersonTokensPropCommitsCommitProp
Christoph Hellwig12879.01%337.50%
Linus Torvalds (pre-git)2917.90%450.00%
Mike Anderson53.09%112.50%
Total162100.00%8100.00%


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); }

Contributors

PersonTokensPropCommitsCommitProp
Christoph Hellwig8186.17%250.00%
Linus Torvalds (pre-git)1313.83%250.00%
Total94100.00%4100.00%

module_init(init_this_scsi_driver); module_exit(exit_this_scsi_driver);

Overall Contributors

PersonTokensPropCommitsCommitProp
Christoph Hellwig21878.14%333.33%
Linus Torvalds (pre-git)5519.71%444.44%
Mike Anderson51.79%111.11%
Arjan van de Ven10.36%111.11%
Total279100.00%9100.00%
Directory: drivers/scsi
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.