aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2005-11-08 09:09:44 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-11-11 08:19:55 -0500
commite99f8b5efe78110e4af10f35ebf11feeef8f43b6 (patch)
tree749f7803380b81eb711acf5818b2c2db2bbc9cd2
parent29179539dac74bf46b519b889602f23841be12e8 (diff)
[PATCH] libata: propogate host private data from probe function
This will let me chop the code size of several drivers right down. In many cases the actual private data is very useful and constant for a given host controller so being able to just pass it at probe time would be very useful indeed (eg with the via driver would could pass the udma clocking and reduce the code size, or with the AMD one the UDMA multiplier and the offset) Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r--drivers/scsi/libata-core.c2
-rw-r--r--include/linux/libata.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index a74b4071a662..e51d9a8a2796 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4563,6 +4563,7 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int
4563 4563
4564 probe_ent->irq = pdev->irq; 4564 probe_ent->irq = pdev->irq;
4565 probe_ent->irq_flags = SA_SHIRQ; 4565 probe_ent->irq_flags = SA_SHIRQ;
4566 probe_ent->private_data = port[0]->private_data;
4566 4567
4567 if (ports & ATA_PORT_PRIMARY) { 4568 if (ports & ATA_PORT_PRIMARY) {
4568 probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0); 4569 probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0);
@@ -4599,6 +4600,7 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, stru
4599 probe_ent->legacy_mode = 1; 4600 probe_ent->legacy_mode = 1;
4600 probe_ent->n_ports = 1; 4601 probe_ent->n_ports = 1;
4601 probe_ent->hard_port_no = port_num; 4602 probe_ent->hard_port_no = port_num;
4603 probe_ent->private_data = port->private_data;
4602 4604
4603 switch(port_num) 4605 switch(port_num)
4604 { 4606 {
diff --git a/include/linux/libata.h b/include/linux/libata.h
index a5390313c7b4..1464a7586de8 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -405,6 +405,7 @@ struct ata_port_info {
405 unsigned long mwdma_mask; 405 unsigned long mwdma_mask;
406 unsigned long udma_mask; 406 unsigned long udma_mask;
407 const struct ata_port_operations *port_ops; 407 const struct ata_port_operations *port_ops;
408 void *private_data;
408}; 409};
409 410
410struct ata_timing { 411struct ata_timing {