From: Jeff Garzik <jgarzik@pobox.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] Re: [PATCH 1/4] aic7xxx/aic79xx: call scsi_set_device()
Date: Sun, 29 May 2005 04:52:56 -0400 [thread overview]
Message-ID: <429982E8.4000503@pobox.com> (raw)
In-Reply-To: <20050529082422.GA19685@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 250 bytes --]
Christoph Hellwig wrote:
> scsi_add_host connects the host to the device tree. scsi_set_device
> is obsolete and should go away ASAP.
Someone needs to tell authors of newer drivers not to use
scsi_set_device(), until it can be deleted...
Jeff
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 4154 bytes --]
diff --git a/Documentation/scsi/scsi_mid_low_api.txt b/Documentation/scsi/scsi_mid_low_api.txt
--- a/Documentation/scsi/scsi_mid_low_api.txt
+++ b/Documentation/scsi/scsi_mid_low_api.txt
@@ -388,7 +388,7 @@ 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_set_device - place device reference in host structure (DEPRECATED)
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()]
@@ -741,7 +741,7 @@ void scsi_report_bus_reset(struct Scsi_H
/**
- * scsi_set_device - place device reference in host structure
+ * scsi_set_device - place device reference in host structure (DEPRECATED)
* @shost: a pointer to a scsi host instance
* @pdev: pointer to device instance to assign
*
@@ -750,6 +750,11 @@ void scsi_report_bus_reset(struct Scsi_H
* Might block: no
*
* Defined in: include/scsi/scsi_host.h .
+ *
+ * Notes: Do not use this function, it only exists for a few
+ * ancient drivers. Add struct device* to scsi_add_host()
+ * instead.
+ *
**/
void scsi_set_device(struct Scsi_Host * shost, struct device * dev)
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1157,10 +1157,6 @@ mptscsih_probe(struct pci_dev *pdev, con
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;
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -7034,7 +7034,7 @@ ips_register_scsi(int index)
sh->max_channel = ha->nbus - 1;
sh->can_queue = ha->max_cmds - 1;
- IPS_ADD_HOST(sh, NULL);
+ IPS_ADD_HOST(sh, &ha->pcidev->dev);
return 0;
}
diff --git a/drivers/scsi/ips.h b/drivers/scsi/ips.h
--- a/drivers/scsi/ips.h
+++ b/drivers/scsi/ips.h
@@ -111,7 +111,7 @@
#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)
#define IPS_PRINTK(level, pcidev, format, arg...) \
dev_printk(level , &((pcidev)->dev) , format , ## arg)
#endif
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -3365,7 +3365,6 @@ static void ata_host_init(struct ata_por
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;
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -814,7 +814,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;
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -2720,9 +2720,7 @@ static int nsp32_detect(Scsi_Host_Templa
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
next prev parent reply other threads:[~2005-05-29 8:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-29 7:40 [PATCH 1/4] aic7xxx/aic79xx: call scsi_set_device() Jeff Garzik
2005-05-29 7:57 ` [PATCH 0/4] aic7xxx/aic79xx changes Jeff Garzik
2005-05-29 8:24 ` [PATCH 1/4] aic7xxx/aic79xx: call scsi_set_device() Christoph Hellwig
2005-05-29 8:27 ` Jeff Garzik
2005-05-29 8:30 ` Christoph Hellwig
2005-05-29 8:52 ` Jeff Garzik [this message]
2005-05-29 9:05 ` [PATCH] " Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=429982E8.4000503@pobox.com \
--to=jgarzik@pobox.com \
--cc=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox