Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: dpt_i2o: stop using scsi_unregister

dpt_i2o doesn't use scsi_register, so it should not use scsi_unregister
either. Also refactor the module exit path to make a little more sense.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Christoph Hellwig and committed by
Martin K. Petersen
38e09e3b 6b1745ca

+4 -13
+4 -12
drivers/scsi/dpt_i2o.c
··· 302 302 } 303 303 304 304 305 - /* 306 - * scsi_unregister will be called AFTER we return. 307 - */ 308 - static int adpt_release(struct Scsi_Host *host) 305 + static void adpt_release(adpt_hba *pHba) 309 306 { 310 - adpt_hba* pHba = (adpt_hba*) host->hostdata[0]; 307 + scsi_remove_host(pHba->host); 311 308 // adpt_i2o_quiesce_hba(pHba); 312 309 adpt_i2o_delete_hba(pHba); 313 - scsi_unregister(host); 314 - return 0; 310 + scsi_host_put(pHba->host); 315 311 } 316 312 317 313 ··· 1083 1087 1084 1088 1085 1089 mutex_lock(&adpt_configuration_lock); 1086 - // scsi_unregister calls our adpt_release which 1087 - // does a quiese 1088 1090 if(pHba->host){ 1089 1091 free_irq(pHba->host->irq, pHba); 1090 1092 } ··· 3589 3595 { 3590 3596 adpt_hba *pHba, *next; 3591 3597 3592 - for (pHba = hba_chain; pHba; pHba = pHba->next) 3593 - scsi_remove_host(pHba->host); 3594 3598 for (pHba = hba_chain; pHba; pHba = next) { 3595 3599 next = pHba->next; 3596 - adpt_release(pHba->host); 3600 + adpt_release(pHba); 3597 3601 } 3598 3602 } 3599 3603
-1
drivers/scsi/dpti.h
··· 32 32 static int adpt_queue(struct Scsi_Host *h, struct scsi_cmnd * cmd); 33 33 static int adpt_abort(struct scsi_cmnd * cmd); 34 34 static int adpt_reset(struct scsi_cmnd* cmd); 35 - static int adpt_release(struct Scsi_Host *host); 36 35 static int adpt_slave_configure(struct scsi_device *); 37 36 38 37 static const char *adpt_info(struct Scsi_Host *pSHost);