mirror of
https://github.com/torvalds/linux.git
synced 2024-10-25 14:40:58 +00:00
scsi: esas2r: remove initialization / cleanup dead wood
esas2r has been converted to hotplug style initialization long ago, but kept various remant of the old-style scsi_module.c initialization around. Remove those. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
fa1467fb00
commit
5785bfadcd
|
@ -962,7 +962,6 @@ struct esas2r_adapter {
|
||||||
* Function Declarations
|
* Function Declarations
|
||||||
* SCSI functions
|
* SCSI functions
|
||||||
*/
|
*/
|
||||||
int esas2r_release(struct Scsi_Host *);
|
|
||||||
const char *esas2r_info(struct Scsi_Host *);
|
const char *esas2r_info(struct Scsi_Host *);
|
||||||
int esas2r_write_params(struct esas2r_adapter *a, struct esas2r_request *rq,
|
int esas2r_write_params(struct esas2r_adapter *a, struct esas2r_request *rq,
|
||||||
struct esas2r_sas_nvram *data);
|
struct esas2r_sas_nvram *data);
|
||||||
|
@ -984,7 +983,6 @@ int esas2r_target_reset(struct scsi_cmnd *cmd);
|
||||||
/* Internal functions */
|
/* Internal functions */
|
||||||
int esas2r_init_adapter(struct Scsi_Host *host, struct pci_dev *pcid,
|
int esas2r_init_adapter(struct Scsi_Host *host, struct pci_dev *pcid,
|
||||||
int index);
|
int index);
|
||||||
int esas2r_cleanup(struct Scsi_Host *host);
|
|
||||||
int esas2r_read_fw(struct esas2r_adapter *a, char *buf, long off, int count);
|
int esas2r_read_fw(struct esas2r_adapter *a, char *buf, long off, int count);
|
||||||
int esas2r_write_fw(struct esas2r_adapter *a, const char *buf, long off,
|
int esas2r_write_fw(struct esas2r_adapter *a, const char *buf, long off,
|
||||||
int count);
|
int count);
|
||||||
|
|
|
@ -661,27 +661,6 @@ void esas2r_kill_adapter(int i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int esas2r_cleanup(struct Scsi_Host *host)
|
|
||||||
{
|
|
||||||
struct esas2r_adapter *a;
|
|
||||||
int index;
|
|
||||||
|
|
||||||
if (host == NULL) {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
esas2r_debug("esas2r_cleanup everything");
|
|
||||||
for (i = 0; i < MAX_ADAPTERS; i++)
|
|
||||||
esas2r_kill_adapter(i);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
esas2r_debug("esas2r_cleanup called for host %p", host);
|
|
||||||
a = (struct esas2r_adapter *)host->hostdata;
|
|
||||||
index = a->index;
|
|
||||||
esas2r_kill_adapter(index);
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
|
|
||||||
int esas2r_suspend(struct pci_dev *pdev, pm_message_t state)
|
int esas2r_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
{
|
{
|
||||||
struct Scsi_Host *host = pci_get_drvdata(pdev);
|
struct Scsi_Host *host = pci_get_drvdata(pdev);
|
||||||
|
|
|
@ -235,7 +235,6 @@ static struct scsi_host_template driver_template = {
|
||||||
.module = THIS_MODULE,
|
.module = THIS_MODULE,
|
||||||
.show_info = esas2r_show_info,
|
.show_info = esas2r_show_info,
|
||||||
.name = ESAS2R_LONGNAME,
|
.name = ESAS2R_LONGNAME,
|
||||||
.release = esas2r_release,
|
|
||||||
.info = esas2r_info,
|
.info = esas2r_info,
|
||||||
.ioctl = esas2r_ioctl,
|
.ioctl = esas2r_ioctl,
|
||||||
.queuecommand = esas2r_queuecommand,
|
.queuecommand = esas2r_queuecommand,
|
||||||
|
@ -520,44 +519,16 @@ static int esas2r_probe(struct pci_dev *pcid,
|
||||||
|
|
||||||
static void esas2r_remove(struct pci_dev *pdev)
|
static void esas2r_remove(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
struct Scsi_Host *host;
|
struct Scsi_Host *host = pci_get_drvdata(pdev);
|
||||||
int index;
|
struct esas2r_adapter *a = (struct esas2r_adapter *)host->hostdata;
|
||||||
|
|
||||||
if (pdev == NULL) {
|
|
||||||
esas2r_log(ESAS2R_LOG_WARN, "esas2r_remove pdev==NULL");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
host = pci_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (host == NULL) {
|
|
||||||
/*
|
|
||||||
* this can happen if pci_set_drvdata was already called
|
|
||||||
* to clear the host pointer. if this is the case, we
|
|
||||||
* are okay; this channel has already been cleaned up.
|
|
||||||
*/
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
esas2r_log_dev(ESAS2R_LOG_INFO, &(pdev->dev),
|
esas2r_log_dev(ESAS2R_LOG_INFO, &(pdev->dev),
|
||||||
"esas2r_remove(%p) called; "
|
"esas2r_remove(%p) called; "
|
||||||
"host:%p", pdev,
|
"host:%p", pdev,
|
||||||
host);
|
host);
|
||||||
|
|
||||||
index = esas2r_cleanup(host);
|
esas2r_kill_adapter(a->index);
|
||||||
|
|
||||||
if (index < 0)
|
|
||||||
esas2r_log_dev(ESAS2R_LOG_WARN, &(pdev->dev),
|
|
||||||
"unknown host in %s",
|
|
||||||
__func__);
|
|
||||||
|
|
||||||
found_adapters--;
|
found_adapters--;
|
||||||
|
|
||||||
/* if this was the last adapter, clean up the rest of the driver */
|
|
||||||
|
|
||||||
if (found_adapters == 0)
|
|
||||||
esas2r_cleanup(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init esas2r_init(void)
|
static int __init esas2r_init(void)
|
||||||
|
@ -638,30 +609,7 @@ static int __init esas2r_init(void)
|
||||||
for (i = 0; i < MAX_ADAPTERS; i++)
|
for (i = 0; i < MAX_ADAPTERS; i++)
|
||||||
esas2r_adapters[i] = NULL;
|
esas2r_adapters[i] = NULL;
|
||||||
|
|
||||||
/* initialize */
|
return pci_register_driver(&esas2r_pci_driver);
|
||||||
|
|
||||||
driver_template.module = THIS_MODULE;
|
|
||||||
|
|
||||||
if (pci_register_driver(&esas2r_pci_driver) != 0)
|
|
||||||
esas2r_log(ESAS2R_LOG_CRIT, "pci_register_driver FAILED");
|
|
||||||
else
|
|
||||||
esas2r_log(ESAS2R_LOG_INFO, "pci_register_driver() OK");
|
|
||||||
|
|
||||||
if (!found_adapters) {
|
|
||||||
pci_unregister_driver(&esas2r_pci_driver);
|
|
||||||
esas2r_cleanup(NULL);
|
|
||||||
|
|
||||||
esas2r_log(ESAS2R_LOG_CRIT,
|
|
||||||
"driver will not be loaded because no ATTO "
|
|
||||||
"%s devices were found",
|
|
||||||
ESAS2R_DRVR_NAME);
|
|
||||||
return -1;
|
|
||||||
} else {
|
|
||||||
esas2r_log(ESAS2R_LOG_INFO, "found %d adapters",
|
|
||||||
found_adapters);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle ioctl calls to "/proc/scsi/esas2r/ATTOnode" */
|
/* Handle ioctl calls to "/proc/scsi/esas2r/ATTOnode" */
|
||||||
|
@ -753,18 +701,6 @@ int esas2r_show_info(struct seq_file *m, struct Scsi_Host *sh)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int esas2r_release(struct Scsi_Host *sh)
|
|
||||||
{
|
|
||||||
esas2r_log_dev(ESAS2R_LOG_INFO, &(sh->shost_gendev),
|
|
||||||
"esas2r_release() called");
|
|
||||||
|
|
||||||
esas2r_cleanup(sh);
|
|
||||||
if (sh->irq)
|
|
||||||
free_irq(sh->irq, NULL);
|
|
||||||
scsi_unregister(sh);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *esas2r_info(struct Scsi_Host *sh)
|
const char *esas2r_info(struct Scsi_Host *sh)
|
||||||
{
|
{
|
||||||
struct esas2r_adapter *a = (struct esas2r_adapter *)sh->hostdata;
|
struct esas2r_adapter *a = (struct esas2r_adapter *)sh->hostdata;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user