[SCSI] remove scsi_set_device
authorChristoph Hellwig <hch@lst.de>
Fri, 10 Jun 2005 23:05:01 +0000 (01:05 +0200)
committerJames Bottomley <jejb@titanic.(none)>
Sun, 26 Jun 2005 13:31:47 +0000 (08:31 -0500)
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>
17 files changed:
Documentation/scsi/scsi_mid_low_api.txt
drivers/message/fusion/mptfc.c
drivers/message/fusion/mptspi.c
drivers/scsi/advansys.c
drivers/scsi/aic7xxx_old.c
drivers/scsi/cpqfcTSinit.c
drivers/scsi/fdomain.c
drivers/scsi/gdth.c
drivers/scsi/hosts.c
drivers/scsi/ips.h
drivers/scsi/libata-core.c
drivers/scsi/megaraid/megaraid_mbox.c
drivers/scsi/ncr53c8xx.c
drivers/scsi/nsp32.c
drivers/scsi/qlogicfc.c
drivers/scsi/qlogicisp.c
include/scsi/scsi_host.h

index da176c95d0fb62618ff5c3684f5768a935f9dd0f..7536823c0cb1d392b30876eb1922dffd0a5b9b07 100644 (file)
@@ -388,7 +388,6 @@ Summary:
    scsi_remove_device - detach and remove a SCSI device
    scsi_remove_host - detach and remove all SCSI devices owned by host
    scsi_report_bus_reset - report scsi _bus_ reset observed
-   scsi_set_device - place device reference in host structure
    scsi_track_queue_full - track successive QUEUE_FULL events 
    scsi_unblock_requests - allow further commands to be queued to given host
    scsi_unregister - [calls scsi_host_put()]
@@ -740,20 +739,6 @@ int scsi_remove_host(struct Scsi_Host *shost)
 void scsi_report_bus_reset(struct Scsi_Host * shost, int channel)
 
 
-/**
- * scsi_set_device - place device reference in host structure
- * @shost: a pointer to a scsi host instance
- * @pdev: pointer to device instance to assign
- *
- *      Returns nothing
- *
- *      Might block: no
- *
- *      Defined in: include/scsi/scsi_host.h .
- **/
-void scsi_set_device(struct Scsi_Host * shost, struct device * dev)
-
-
 /**
  * scsi_track_queue_full - track successive QUEUE_FULL events on given
  *                      device to determine if and when there is a need
index d8d65397e06e668be27cebf001e6681ddfd253c4..79959562248ca944b87a7edcc04831a0f056947a 100644 (file)
@@ -267,10 +267,6 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                sh->sg_tablesize = numSGE;
        }
 
-       /* Set the pci device pointer in Scsi_Host structure.
-        */
-       scsi_set_device(sh, &ioc->pcidev->dev);
-
        spin_unlock_irqrestore(&ioc->FreeQlock, flags);
 
        hd = (MPT_SCSI_HOST *) sh->hostdata;
index 5f9a61b85b3b6c3b0c65c1f0581f21fe09769b22..d2b53eac9c9419c5419abe759d0888c8825a28e8 100644 (file)
@@ -287,10 +287,6 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                sh->sg_tablesize = numSGE;
        }
 
-       /* Set the pci device pointer in Scsi_Host structure.
-        */
-       scsi_set_device(sh, &ioc->pcidev->dev);
-
        spin_unlock_irqrestore(&ioc->FreeQlock, flags);
 
        hd = (MPT_SCSI_HOST *) sh->hostdata;
index 04cb5c405a2db94a232f7621c2e09f1f5599cd14..a53d43352d99f335efa75e9ac0e513a922a52c7a 100644 (file)
@@ -4556,8 +4556,6 @@ advansys_detect(struct scsi_host_template *tpnt)
                 continue;
             }
 
-           scsi_set_device(shp, dev);
-
             /* Save a pointer to the Scsi_Host of each board found. */
             asc_host[asc_board_count++] = shp;
 
index fac091e7093c2e490d789704eaa9afdf6cf583ba..52b72d7794f51aeadc11df93a1a53aed02f1b478 100644 (file)
@@ -8448,7 +8448,6 @@ aic7xxx_alloc(Scsi_Host_Template *sht, struct aic7xxx_host *temp)
     }
     p->host_no = host->host_no;
   }
-  scsi_set_device(host, &p->pdev->dev);
   return (p);
 }
 
index 5674ada6d5c249ca58fb1d39ffba9355171d1b18..d72be0ce89c84534911026dce7879659045bd619 100644 (file)
@@ -336,7 +336,6 @@ int cpqfcTS_detect(Scsi_Host_Template *ScsiHostTemplate)
       DEBUG_PCI(printk("  PciDev->baseaddress[3]= %lx\n", 
                                PciDev->resource[3].start));
 
-      scsi_set_device(HostAdapter, &PciDev->dev);
       HostAdapter->irq = PciDev->irq;  // copy for Scsi layers
       
       // HP Tachlite uses two (255-byte) ranges of Port I/O (lower & upper),
index 4ba6a15cf43d2afb6715607174a843ccb6b7d9e6..aecf32dd0bde9ca7f510fd8d31106a8adfa0fd02 100644 (file)
@@ -938,7 +938,6 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt )
    }
    shpnt->irq = interrupt_level;
    shpnt->io_port = port_base;
-   scsi_set_device(shpnt, &pdev->dev);
    shpnt->n_io_port = 0x10;
    print_banner( shpnt );
 
index 4552cccd283484e4b863d4c1f9a77e1c052f1647..af682301beacb5eb627faef8439d3150d7af4e54 100644 (file)
@@ -4521,9 +4521,7 @@ static int __init gdth_detect(Scsi_Host_Template *shtp)
             ha->virt_bus = hdr_channel;
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-            scsi_set_device(shp, &pcistr[ctr].pdev->dev);
-#else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
             scsi_set_pci_device(shp, pcistr[ctr].pdev);
 #endif
             if (!(ha->cache_feat & ha->raw_feat & ha->screen_feat &GDT_64BIT)||
index d7a38b6713f958b1c4023544b3de1869b5a22bcf..5feb886c33921075ab728f8d6a072dedf9959a8c 100644 (file)
@@ -180,11 +180,6 @@ static void scsi_host_dev_release(struct device *dev)
        scsi_destroy_command_freelist(shost);
        kfree(shost->shost_data);
 
-       /*
-        * Some drivers (eg aha1542) do scsi_register()/scsi_unregister()
-        * during probing without performing a scsi_set_device() in between.
-        * In this case dev->parent is NULL.
-        */
        if (parent)
                put_device(parent);
        kfree(shost);
index 906a76158fa95b1f39b92e0a00a0c2db8d9ebdfa..480e06f4d6ae2b833f8cf108e2159a11a58ecbfe 100644 (file)
       #define IPS_UNREGISTER_HOSTS(SHT)
       #define IPS_ADD_HOST(shost,device)   do { scsi_add_host(shost,device); scsi_scan_host(shost); } while (0)
       #define IPS_REMOVE_HOST(shost)       scsi_remove_host(shost)
-      #define IPS_SCSI_SET_DEVICE(sh,ha)   scsi_set_device(sh, &(ha)->pcidev->dev)
+      #define IPS_SCSI_SET_DEVICE(sh,ha)   do { } while (0)
       #define IPS_PRINTK(level, pcidev, format, arg...)                 \
             dev_printk(level , &((pcidev)->dev) , format , ## arg)
    #endif
index 36b401fee1f184d0ba6edcebd48a21e463bab89f..a974dc8984b4a017ba1260e94bf9c67579da6902 100644 (file)
@@ -3748,7 +3748,7 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
        host->max_channel = 1;
        host->unique_id = ata_unique_id++;
        host->max_cmd_len = 12;
-       scsi_set_device(host, ent->dev);
+
        scsi_assign_lock(host, &host_set->lock);
 
        ap->flags = ATA_FLAG_PORT_DISABLED;
index cbe4302462760b681ddd85d79cfd9d02f0258e7d..d47be8e0ea3a9ff33009bd40567556a724dadca5 100644 (file)
@@ -719,7 +719,6 @@ megaraid_io_attach(adapter_t *adapter)
 
        // export the parameters required by the mid-layer
        scsi_assign_lock(host, adapter->host_lock);
-       scsi_set_device(host, &adapter->pdev->dev);
 
        host->irq               = adapter->irq;
        host->unique_id         = adapter->unique_id;
index 2a0e42ec27d3e8bc5a66baf424f990516632a0e4..519486d24b28ec11ab08a601763e7343440741f7 100644 (file)
@@ -7756,7 +7756,6 @@ struct Scsi_Host * __init ncr_attach(struct scsi_host_template *tpnt,
         * your module_init */
        BUG_ON(!ncr53c8xx_transport_template);
        instance->transportt    = ncr53c8xx_transport_template;
-       scsi_set_device(instance, device->dev);
 
        /* Patch script to physical addresses */
        ncr_script_fill(&script0, &scripth0);
index 5159ceea319eb99e34f8bb7fd10527562b179d5b..6367f009cd74b5d70ce32b47041b0c59896ce474 100644 (file)
@@ -2719,9 +2719,7 @@ static int nsp32_detect(Scsi_Host_Template *sht)
        host->unique_id = data->BaseAddress;
        host->n_io_port = data->NumAddress;
        host->base      = (unsigned long)data->MmioAddress;
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,63))
-       scsi_set_device(host, &PCIDEV->dev);
-#else
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,63))
        scsi_set_pci_device(host, PCIDEV);
 #endif
 
index ddf0f4277ee8cd087b24b007afb07adcb1b085c3..a4b3b3fd4815df4c35b9d5149b0605f511ddd730 100644 (file)
@@ -746,7 +746,6 @@ static int isp2x00_detect(Scsi_Host_Template * tmpt)
                                printk("qlogicfc%d : could not register host.\n", hosts);
                                continue;
                        }
-                       scsi_set_device(host, &pdev->dev);
                        host->max_id = QLOGICFC_MAX_ID + 1;
                        host->max_lun = QLOGICFC_MAX_LUN;
                        hostdata = (struct isp2x00_hostdata *) host->hostdata;
index 6d29e1b864e2361ec067280be8d586bf04e17d38..6c9266b8ffdfd2c91eeafcfc3da18aefe921dd6e 100644 (file)
@@ -694,7 +694,6 @@ static int isp1020_detect(Scsi_Host_Template *tmpt)
                memset(hostdata, 0, sizeof(struct isp1020_hostdata));
 
                hostdata->pci_dev = pdev;
-               scsi_set_device(host, &pdev->dev);
 
                if (isp1020_init(host))
                        goto fail_and_unregister;
index db9914adeac94b510b5f51a9cde33331f5f93d4d..81d5234f67711314cb51e33738c5c165ca9e39b7 100644 (file)
@@ -641,12 +641,6 @@ static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock)
        shost->host_lock = lock;
 }
 
-static inline void scsi_set_device(struct Scsi_Host *shost,
-                                   struct device *dev)
-{
-        shost->shost_gendev.parent = dev;
-}
-
 static inline struct device *scsi_get_device(struct Scsi_Host *shost)
 {
         return shost->shost_gendev.parent;