Commit 29da9f6d authored by Jeff Garzik's avatar Jeff Garzik

[libata] Fix oops introduced in non-uniform port handling fix

Noticed by several people.
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent c32a8fd7
...@@ -484,7 +484,7 @@ static void nv_error_handler(struct ata_port *ap) ...@@ -484,7 +484,7 @@ static void nv_error_handler(struct ata_port *ap)
static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version = 0; static int printed_version = 0;
struct ata_port_info *ppi; struct ata_port_info *ppi[2];
struct ata_probe_ent *probe_ent; struct ata_probe_ent *probe_ent;
int pci_dev_busy = 0; int pci_dev_busy = 0;
int rc; int rc;
...@@ -520,8 +520,8 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -520,8 +520,8 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
rc = -ENOMEM; rc = -ENOMEM;
ppi = &nv_port_info[ent->driver_data]; ppi[0] = ppi[1] = &nv_port_info[ent->driver_data];
probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY); probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
if (!probe_ent) if (!probe_ent)
goto err_out_regions; goto err_out_regions;
......
...@@ -240,7 +240,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -240,7 +240,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
struct ata_probe_ent *probe_ent = NULL; struct ata_probe_ent *probe_ent = NULL;
int rc; int rc;
u32 genctl; u32 genctl;
struct ata_port_info *ppi; struct ata_port_info *ppi[2];
int pci_dev_busy = 0; int pci_dev_busy = 0;
u8 pmr; u8 pmr;
u8 port2_start; u8 port2_start;
...@@ -265,8 +265,8 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -265,8 +265,8 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc) if (rc)
goto err_out_regions; goto err_out_regions;
ppi = &sis_port_info; ppi[0] = ppi[1] = &sis_port_info;
probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY); probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
if (!probe_ent) { if (!probe_ent) {
rc = -ENOMEM; rc = -ENOMEM;
goto err_out_regions; goto err_out_regions;
......
...@@ -185,7 +185,7 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -185,7 +185,7 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version; static int printed_version;
struct ata_probe_ent *probe_ent; struct ata_probe_ent *probe_ent;
struct ata_port_info *ppi; struct ata_port_info *ppi[2];
int rc; int rc;
unsigned int board_idx = (unsigned int) ent->driver_data; unsigned int board_idx = (unsigned int) ent->driver_data;
int pci_dev_busy = 0; int pci_dev_busy = 0;
...@@ -211,8 +211,8 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -211,8 +211,8 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc) if (rc)
goto err_out_regions; goto err_out_regions;
ppi = &uli_port_info; ppi[0] = ppi[1] = &uli_port_info;
probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY); probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
if (!probe_ent) { if (!probe_ent) {
rc = -ENOMEM; rc = -ENOMEM;
goto err_out_regions; goto err_out_regions;
......
...@@ -318,9 +318,10 @@ static void vt6421_init_addrs(struct ata_probe_ent *probe_ent, ...@@ -318,9 +318,10 @@ static void vt6421_init_addrs(struct ata_probe_ent *probe_ent,
static struct ata_probe_ent *vt6420_init_probe_ent(struct pci_dev *pdev) static struct ata_probe_ent *vt6420_init_probe_ent(struct pci_dev *pdev)
{ {
struct ata_probe_ent *probe_ent; struct ata_probe_ent *probe_ent;
struct ata_port_info *ppi = &vt6420_port_info; struct ata_port_info *ppi[2];
probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY); ppi[0] = ppi[1] = &vt6420_port_info;
probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
if (!probe_ent) if (!probe_ent)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment