From: Jeff Garzik Date: Sun, 30 Oct 2005 11:41:29 +0000 (-0500) Subject: [libata] fix legacy IDE probing X-Git-Tag: v2.6.15-rc1~728^2^2~3 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=0f0d5192696eeb3072944a4a813809cc2c85891a;p=linux-2.6-omap-h63xx.git [libata] fix legacy IDE probing ata_pci_init_one() receives an array of struct ata_port_info. Recent updates to the code had always obtained port information from array element 0, rather than array element N. Change to avoid hardcoding port_info[0], thereby restoring proper hardware information to secondary legacy ports. --- diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index cc089f1fb11..8be7dc0b47b 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -4527,11 +4527,11 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int return probe_ent; } -static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, struct ata_port_info **port, int port_num) +static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, struct ata_port_info *port, int port_num) { struct ata_probe_ent *probe_ent; - probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port[0]); + probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port); if (!probe_ent) return NULL; @@ -4678,9 +4678,9 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, if (legacy_mode) { if (legacy_mode & (1 << 0)) - probe_ent = ata_pci_init_legacy_port(pdev, port, 0); + probe_ent = ata_pci_init_legacy_port(pdev, port[0], 0); if (legacy_mode & (1 << 1)) - probe_ent2 = ata_pci_init_legacy_port(pdev, port, 1); + probe_ent2 = ata_pci_init_legacy_port(pdev, port[1], 1); } else { if (n_ports == 2) probe_ent = ata_pci_init_native_mode(pdev, port, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);