diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-09-28 03:48:18 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-28 03:48:18 -0400 |
commit | d639ca94188fedbd8cfde1ab4ed9e9878ab2f01e (patch) | |
tree | 07795198224b43bf96a1471b4add4237f023dd09 /drivers | |
parent | c791c30670ea61f19eec390124128bf278e854fe (diff) |
[libata] init probe_ent->private_data in a common location
Don't write the same code twice, in two different functions, when they
both call the same initialization function, with the same private_data
pointer info.
Also, note a bug found with a FIXME.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-core.c | 1 | ||||
-rw-r--r-- | drivers/ata/libata-sff.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 396493cc98ce..72644bdecbb0 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -5785,6 +5785,7 @@ ata_probe_ent_alloc(struct device *dev, const struct ata_port_info *port) | |||
5785 | probe_ent->mwdma_mask = port->mwdma_mask; | 5785 | probe_ent->mwdma_mask = port->mwdma_mask; |
5786 | probe_ent->udma_mask = port->udma_mask; | 5786 | probe_ent->udma_mask = port->udma_mask; |
5787 | probe_ent->port_ops = port->port_ops; | 5787 | probe_ent->port_ops = port->port_ops; |
5788 | probe_ent->private_data = port->private_data; | ||
5788 | 5789 | ||
5789 | return probe_ent; | 5790 | return probe_ent; |
5790 | } | 5791 | } |
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index a620e235ccc2..06daaa3736a2 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -828,7 +828,6 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int | |||
828 | 828 | ||
829 | probe_ent->irq = pdev->irq; | 829 | probe_ent->irq = pdev->irq; |
830 | probe_ent->irq_flags = IRQF_SHARED; | 830 | probe_ent->irq_flags = IRQF_SHARED; |
831 | probe_ent->private_data = port[0]->private_data; | ||
832 | 831 | ||
833 | if (ports & ATA_PORT_PRIMARY) { | 832 | if (ports & ATA_PORT_PRIMARY) { |
834 | probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0); | 833 | probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0); |
@@ -878,7 +877,6 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, | |||
878 | return NULL; | 877 | return NULL; |
879 | 878 | ||
880 | probe_ent->n_ports = 2; | 879 | probe_ent->n_ports = 2; |
881 | probe_ent->private_data = port[0]->private_data; | ||
882 | 880 | ||
883 | if (port_mask & ATA_PORT_PRIMARY) { | 881 | if (port_mask & ATA_PORT_PRIMARY) { |
884 | probe_ent->irq = ATA_PRIMARY_IRQ; | 882 | probe_ent->irq = ATA_PRIMARY_IRQ; |
@@ -908,6 +906,8 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, | |||
908 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; | 906 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
909 | } | 907 | } |
910 | ata_std_ports(&probe_ent->port[1]); | 908 | ata_std_ports(&probe_ent->port[1]); |
909 | |||
910 | /* FIXME: could be pointing to stack area; must copy */ | ||
911 | probe_ent->pinfo2 = port[1]; | 911 | probe_ent->pinfo2 = port[1]; |
912 | } else | 912 | } else |
913 | probe_ent->dummy_port_mask |= ATA_PORT_SECONDARY; | 913 | probe_ent->dummy_port_mask |= ATA_PORT_SECONDARY; |