diff options
author | Christoph Hellwig <hch@lst.de> | 2005-06-10 19:05:01 -0400 |
---|---|---|
committer | James Bottomley <jejb@titanic.(none)> | 2005-06-26 09:31:47 -0400 |
commit | 12413197eef2a29e0b9fb0fa541f5cbaeb1d3f3f (patch) | |
tree | 9f294101d0b9df2c49a0911b127aa99823bc0060 | |
parent | 117e4b27ebb1133072b1453145e60e576569e8af (diff) |
[SCSI] remove scsi_set_device
scsi_add_host is the proper place to set the device, but people copy
the scsi_set_device usage from older drivers again and again.
note that this leaves some legacy drivers like qlogicisp/qlogicfc
without pci association in sysfs, but they're scheduled to go away soon
anyway.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r-- | Documentation/scsi/scsi_mid_low_api.txt | 15 | ||||
-rw-r--r-- | drivers/message/fusion/mptfc.c | 4 | ||||
-rw-r--r-- | drivers/message/fusion/mptspi.c | 4 | ||||
-rw-r--r-- | drivers/scsi/advansys.c | 2 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx_old.c | 1 | ||||
-rw-r--r-- | drivers/scsi/cpqfcTSinit.c | 1 | ||||
-rw-r--r-- | drivers/scsi/fdomain.c | 1 | ||||
-rw-r--r-- | drivers/scsi/gdth.c | 4 | ||||
-rw-r--r-- | drivers/scsi/hosts.c | 5 | ||||
-rw-r--r-- | drivers/scsi/ips.h | 2 | ||||
-rw-r--r-- | drivers/scsi/libata-core.c | 2 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_mbox.c | 1 | ||||
-rw-r--r-- | drivers/scsi/ncr53c8xx.c | 1 | ||||
-rw-r--r-- | drivers/scsi/nsp32.c | 4 | ||||
-rw-r--r-- | drivers/scsi/qlogicfc.c | 1 | ||||
-rw-r--r-- | drivers/scsi/qlogicisp.c | 1 | ||||
-rw-r--r-- | include/scsi/scsi_host.h | 6 |
17 files changed, 4 insertions, 51 deletions
diff --git a/Documentation/scsi/scsi_mid_low_api.txt b/Documentation/scsi/scsi_mid_low_api.txt index da176c95d0fb..7536823c0cb1 100644 --- a/Documentation/scsi/scsi_mid_low_api.txt +++ b/Documentation/scsi/scsi_mid_low_api.txt | |||
@@ -388,7 +388,6 @@ Summary: | |||
388 | scsi_remove_device - detach and remove a SCSI device | 388 | scsi_remove_device - detach and remove a SCSI device |
389 | scsi_remove_host - detach and remove all SCSI devices owned by host | 389 | scsi_remove_host - detach and remove all SCSI devices owned by host |
390 | scsi_report_bus_reset - report scsi _bus_ reset observed | 390 | scsi_report_bus_reset - report scsi _bus_ reset observed |
391 | scsi_set_device - place device reference in host structure | ||
392 | scsi_track_queue_full - track successive QUEUE_FULL events | 391 | scsi_track_queue_full - track successive QUEUE_FULL events |
393 | scsi_unblock_requests - allow further commands to be queued to given host | 392 | scsi_unblock_requests - allow further commands to be queued to given host |
394 | scsi_unregister - [calls scsi_host_put()] | 393 | scsi_unregister - [calls scsi_host_put()] |
@@ -741,20 +740,6 @@ void scsi_report_bus_reset(struct Scsi_Host * shost, int channel) | |||
741 | 740 | ||
742 | 741 | ||
743 | /** | 742 | /** |
744 | * scsi_set_device - place device reference in host structure | ||
745 | * @shost: a pointer to a scsi host instance | ||
746 | * @pdev: pointer to device instance to assign | ||
747 | * | ||
748 | * Returns nothing | ||
749 | * | ||
750 | * Might block: no | ||
751 | * | ||
752 | * Defined in: include/scsi/scsi_host.h . | ||
753 | **/ | ||
754 | void scsi_set_device(struct Scsi_Host * shost, struct device * dev) | ||
755 | |||
756 | |||
757 | /** | ||
758 | * scsi_track_queue_full - track successive QUEUE_FULL events on given | 743 | * scsi_track_queue_full - track successive QUEUE_FULL events on given |
759 | * device to determine if and when there is a need | 744 | * device to determine if and when there is a need |
760 | * to adjust the queue depth on the device. | 745 | * to adjust the queue depth on the device. |
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index d8d65397e06e..79959562248c 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c | |||
@@ -267,10 +267,6 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
267 | sh->sg_tablesize = numSGE; | 267 | sh->sg_tablesize = numSGE; |
268 | } | 268 | } |
269 | 269 | ||
270 | /* Set the pci device pointer in Scsi_Host structure. | ||
271 | */ | ||
272 | scsi_set_device(sh, &ioc->pcidev->dev); | ||
273 | |||
274 | spin_unlock_irqrestore(&ioc->FreeQlock, flags); | 270 | spin_unlock_irqrestore(&ioc->FreeQlock, flags); |
275 | 271 | ||
276 | hd = (MPT_SCSI_HOST *) sh->hostdata; | 272 | hd = (MPT_SCSI_HOST *) sh->hostdata; |
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 5f9a61b85b3b..d2b53eac9c94 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
@@ -287,10 +287,6 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
287 | sh->sg_tablesize = numSGE; | 287 | sh->sg_tablesize = numSGE; |
288 | } | 288 | } |
289 | 289 | ||
290 | /* Set the pci device pointer in Scsi_Host structure. | ||
291 | */ | ||
292 | scsi_set_device(sh, &ioc->pcidev->dev); | ||
293 | |||
294 | spin_unlock_irqrestore(&ioc->FreeQlock, flags); | 290 | spin_unlock_irqrestore(&ioc->FreeQlock, flags); |
295 | 291 | ||
296 | hd = (MPT_SCSI_HOST *) sh->hostdata; | 292 | hd = (MPT_SCSI_HOST *) sh->hostdata; |
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 04cb5c405a2d..a53d43352d99 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c | |||
@@ -4556,8 +4556,6 @@ advansys_detect(struct scsi_host_template *tpnt) | |||
4556 | continue; | 4556 | continue; |
4557 | } | 4557 | } |
4558 | 4558 | ||
4559 | scsi_set_device(shp, dev); | ||
4560 | |||
4561 | /* Save a pointer to the Scsi_Host of each board found. */ | 4559 | /* Save a pointer to the Scsi_Host of each board found. */ |
4562 | asc_host[asc_board_count++] = shp; | 4560 | asc_host[asc_board_count++] = shp; |
4563 | 4561 | ||
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c index fac091e7093c..52b72d7794f5 100644 --- a/drivers/scsi/aic7xxx_old.c +++ b/drivers/scsi/aic7xxx_old.c | |||
@@ -8448,7 +8448,6 @@ aic7xxx_alloc(Scsi_Host_Template *sht, struct aic7xxx_host *temp) | |||
8448 | } | 8448 | } |
8449 | p->host_no = host->host_no; | 8449 | p->host_no = host->host_no; |
8450 | } | 8450 | } |
8451 | scsi_set_device(host, &p->pdev->dev); | ||
8452 | return (p); | 8451 | return (p); |
8453 | } | 8452 | } |
8454 | 8453 | ||
diff --git a/drivers/scsi/cpqfcTSinit.c b/drivers/scsi/cpqfcTSinit.c index 5674ada6d5c2..d72be0ce89c8 100644 --- a/drivers/scsi/cpqfcTSinit.c +++ b/drivers/scsi/cpqfcTSinit.c | |||
@@ -336,7 +336,6 @@ int cpqfcTS_detect(Scsi_Host_Template *ScsiHostTemplate) | |||
336 | DEBUG_PCI(printk(" PciDev->baseaddress[3]= %lx\n", | 336 | DEBUG_PCI(printk(" PciDev->baseaddress[3]= %lx\n", |
337 | PciDev->resource[3].start)); | 337 | PciDev->resource[3].start)); |
338 | 338 | ||
339 | scsi_set_device(HostAdapter, &PciDev->dev); | ||
340 | HostAdapter->irq = PciDev->irq; // copy for Scsi layers | 339 | HostAdapter->irq = PciDev->irq; // copy for Scsi layers |
341 | 340 | ||
342 | // HP Tachlite uses two (255-byte) ranges of Port I/O (lower & upper), | 341 | // HP Tachlite uses two (255-byte) ranges of Port I/O (lower & upper), |
diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index 4ba6a15cf43d..aecf32dd0bde 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c | |||
@@ -938,7 +938,6 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt ) | |||
938 | } | 938 | } |
939 | shpnt->irq = interrupt_level; | 939 | shpnt->irq = interrupt_level; |
940 | shpnt->io_port = port_base; | 940 | shpnt->io_port = port_base; |
941 | scsi_set_device(shpnt, &pdev->dev); | ||
942 | shpnt->n_io_port = 0x10; | 941 | shpnt->n_io_port = 0x10; |
943 | print_banner( shpnt ); | 942 | print_banner( shpnt ); |
944 | 943 | ||
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 4552cccd2834..af682301beac 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c | |||
@@ -4521,9 +4521,7 @@ static int __init gdth_detect(Scsi_Host_Template *shtp) | |||
4521 | ha->virt_bus = hdr_channel; | 4521 | ha->virt_bus = hdr_channel; |
4522 | 4522 | ||
4523 | 4523 | ||
4524 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) | 4524 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) |
4525 | scsi_set_device(shp, &pcistr[ctr].pdev->dev); | ||
4526 | #else | ||
4527 | scsi_set_pci_device(shp, pcistr[ctr].pdev); | 4525 | scsi_set_pci_device(shp, pcistr[ctr].pdev); |
4528 | #endif | 4526 | #endif |
4529 | if (!(ha->cache_feat & ha->raw_feat & ha->screen_feat &GDT_64BIT)|| | 4527 | if (!(ha->cache_feat & ha->raw_feat & ha->screen_feat &GDT_64BIT)|| |
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index d7a38b6713f9..5feb886c3392 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -180,11 +180,6 @@ static void scsi_host_dev_release(struct device *dev) | |||
180 | scsi_destroy_command_freelist(shost); | 180 | scsi_destroy_command_freelist(shost); |
181 | kfree(shost->shost_data); | 181 | kfree(shost->shost_data); |
182 | 182 | ||
183 | /* | ||
184 | * Some drivers (eg aha1542) do scsi_register()/scsi_unregister() | ||
185 | * during probing without performing a scsi_set_device() in between. | ||
186 | * In this case dev->parent is NULL. | ||
187 | */ | ||
188 | if (parent) | 183 | if (parent) |
189 | put_device(parent); | 184 | put_device(parent); |
190 | kfree(shost); | 185 | kfree(shost); |
diff --git a/drivers/scsi/ips.h b/drivers/scsi/ips.h index 906a76158fa9..480e06f4d6ae 100644 --- a/drivers/scsi/ips.h +++ b/drivers/scsi/ips.h | |||
@@ -111,7 +111,7 @@ | |||
111 | #define IPS_UNREGISTER_HOSTS(SHT) | 111 | #define IPS_UNREGISTER_HOSTS(SHT) |
112 | #define IPS_ADD_HOST(shost,device) do { scsi_add_host(shost,device); scsi_scan_host(shost); } while (0) | 112 | #define IPS_ADD_HOST(shost,device) do { scsi_add_host(shost,device); scsi_scan_host(shost); } while (0) |
113 | #define IPS_REMOVE_HOST(shost) scsi_remove_host(shost) | 113 | #define IPS_REMOVE_HOST(shost) scsi_remove_host(shost) |
114 | #define IPS_SCSI_SET_DEVICE(sh,ha) scsi_set_device(sh, &(ha)->pcidev->dev) | 114 | #define IPS_SCSI_SET_DEVICE(sh,ha) do { } while (0) |
115 | #define IPS_PRINTK(level, pcidev, format, arg...) \ | 115 | #define IPS_PRINTK(level, pcidev, format, arg...) \ |
116 | dev_printk(level , &((pcidev)->dev) , format , ## arg) | 116 | dev_printk(level , &((pcidev)->dev) , format , ## arg) |
117 | #endif | 117 | #endif |
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 36b401fee1f1..a974dc8984b4 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -3748,7 +3748,7 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, | |||
3748 | host->max_channel = 1; | 3748 | host->max_channel = 1; |
3749 | host->unique_id = ata_unique_id++; | 3749 | host->unique_id = ata_unique_id++; |
3750 | host->max_cmd_len = 12; | 3750 | host->max_cmd_len = 12; |
3751 | scsi_set_device(host, ent->dev); | 3751 | |
3752 | scsi_assign_lock(host, &host_set->lock); | 3752 | scsi_assign_lock(host, &host_set->lock); |
3753 | 3753 | ||
3754 | ap->flags = ATA_FLAG_PORT_DISABLED; | 3754 | ap->flags = ATA_FLAG_PORT_DISABLED; |
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index cbe430246276..d47be8e0ea3a 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c | |||
@@ -719,7 +719,6 @@ megaraid_io_attach(adapter_t *adapter) | |||
719 | 719 | ||
720 | // export the parameters required by the mid-layer | 720 | // export the parameters required by the mid-layer |
721 | scsi_assign_lock(host, adapter->host_lock); | 721 | scsi_assign_lock(host, adapter->host_lock); |
722 | scsi_set_device(host, &adapter->pdev->dev); | ||
723 | 722 | ||
724 | host->irq = adapter->irq; | 723 | host->irq = adapter->irq; |
725 | host->unique_id = adapter->unique_id; | 724 | host->unique_id = adapter->unique_id; |
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index 2a0e42ec27d3..519486d24b28 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c | |||
@@ -7756,7 +7756,6 @@ struct Scsi_Host * __init ncr_attach(struct scsi_host_template *tpnt, | |||
7756 | * your module_init */ | 7756 | * your module_init */ |
7757 | BUG_ON(!ncr53c8xx_transport_template); | 7757 | BUG_ON(!ncr53c8xx_transport_template); |
7758 | instance->transportt = ncr53c8xx_transport_template; | 7758 | instance->transportt = ncr53c8xx_transport_template; |
7759 | scsi_set_device(instance, device->dev); | ||
7760 | 7759 | ||
7761 | /* Patch script to physical addresses */ | 7760 | /* Patch script to physical addresses */ |
7762 | ncr_script_fill(&script0, &scripth0); | 7761 | ncr_script_fill(&script0, &scripth0); |
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c index 5159ceea319e..6367f009cd74 100644 --- a/drivers/scsi/nsp32.c +++ b/drivers/scsi/nsp32.c | |||
@@ -2719,9 +2719,7 @@ static int nsp32_detect(Scsi_Host_Template *sht) | |||
2719 | host->unique_id = data->BaseAddress; | 2719 | host->unique_id = data->BaseAddress; |
2720 | host->n_io_port = data->NumAddress; | 2720 | host->n_io_port = data->NumAddress; |
2721 | host->base = (unsigned long)data->MmioAddress; | 2721 | host->base = (unsigned long)data->MmioAddress; |
2722 | #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,63)) | 2722 | #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,63)) |
2723 | scsi_set_device(host, &PCIDEV->dev); | ||
2724 | #else | ||
2725 | scsi_set_pci_device(host, PCIDEV); | 2723 | scsi_set_pci_device(host, PCIDEV); |
2726 | #endif | 2724 | #endif |
2727 | 2725 | ||
diff --git a/drivers/scsi/qlogicfc.c b/drivers/scsi/qlogicfc.c index ddf0f4277ee8..a4b3b3fd4815 100644 --- a/drivers/scsi/qlogicfc.c +++ b/drivers/scsi/qlogicfc.c | |||
@@ -746,7 +746,6 @@ static int isp2x00_detect(Scsi_Host_Template * tmpt) | |||
746 | printk("qlogicfc%d : could not register host.\n", hosts); | 746 | printk("qlogicfc%d : could not register host.\n", hosts); |
747 | continue; | 747 | continue; |
748 | } | 748 | } |
749 | scsi_set_device(host, &pdev->dev); | ||
750 | host->max_id = QLOGICFC_MAX_ID + 1; | 749 | host->max_id = QLOGICFC_MAX_ID + 1; |
751 | host->max_lun = QLOGICFC_MAX_LUN; | 750 | host->max_lun = QLOGICFC_MAX_LUN; |
752 | hostdata = (struct isp2x00_hostdata *) host->hostdata; | 751 | hostdata = (struct isp2x00_hostdata *) host->hostdata; |
diff --git a/drivers/scsi/qlogicisp.c b/drivers/scsi/qlogicisp.c index 6d29e1b864e2..6c9266b8ffdf 100644 --- a/drivers/scsi/qlogicisp.c +++ b/drivers/scsi/qlogicisp.c | |||
@@ -694,7 +694,6 @@ static int isp1020_detect(Scsi_Host_Template *tmpt) | |||
694 | memset(hostdata, 0, sizeof(struct isp1020_hostdata)); | 694 | memset(hostdata, 0, sizeof(struct isp1020_hostdata)); |
695 | 695 | ||
696 | hostdata->pci_dev = pdev; | 696 | hostdata->pci_dev = pdev; |
697 | scsi_set_device(host, &pdev->dev); | ||
698 | 697 | ||
699 | if (isp1020_init(host)) | 698 | if (isp1020_init(host)) |
700 | goto fail_and_unregister; | 699 | goto fail_and_unregister; |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index db9914adeac9..81d5234f6771 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -641,12 +641,6 @@ static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock) | |||
641 | shost->host_lock = lock; | 641 | shost->host_lock = lock; |
642 | } | 642 | } |
643 | 643 | ||
644 | static inline void scsi_set_device(struct Scsi_Host *shost, | ||
645 | struct device *dev) | ||
646 | { | ||
647 | shost->shost_gendev.parent = dev; | ||
648 | } | ||
649 | |||
650 | static inline struct device *scsi_get_device(struct Scsi_Host *shost) | 644 | static inline struct device *scsi_get_device(struct Scsi_Host *shost) |
651 | { | 645 | { |
652 | return shost->shost_gendev.parent; | 646 | return shost->shost_gendev.parent; |