提交 e99f8b5e 编写于 作者: A Alan Cox 提交者: Jeff Garzik

[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: NAlan Cox <alan@redhat.com>
Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
上级 29179539
...@@ -4563,6 +4563,7 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int ...@@ -4563,6 +4563,7 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int
probe_ent->irq = pdev->irq; probe_ent->irq = pdev->irq;
probe_ent->irq_flags = SA_SHIRQ; probe_ent->irq_flags = SA_SHIRQ;
probe_ent->private_data = port[0]->private_data;
if (ports & ATA_PORT_PRIMARY) { if (ports & ATA_PORT_PRIMARY) {
probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0); 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,6 +4600,7 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, stru
probe_ent->legacy_mode = 1; probe_ent->legacy_mode = 1;
probe_ent->n_ports = 1; probe_ent->n_ports = 1;
probe_ent->hard_port_no = port_num; probe_ent->hard_port_no = port_num;
probe_ent->private_data = port->private_data;
switch(port_num) switch(port_num)
{ {
......
...@@ -405,6 +405,7 @@ struct ata_port_info { ...@@ -405,6 +405,7 @@ struct ata_port_info {
unsigned long mwdma_mask; unsigned long mwdma_mask;
unsigned long udma_mask; unsigned long udma_mask;
const struct ata_port_operations *port_ops; const struct ata_port_operations *port_ops;
void *private_data;
}; };
struct ata_timing { struct ata_timing {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册