Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45165
b: refs/heads/master
c: dc3c337
h: refs/heads/master
i:
  45163: 4f6e7ab
v: v3
  • Loading branch information
Alan authored and Linus Torvalds committed Jan 2, 2007
1 parent 99b6466 commit dbee60e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e22a9a8b703d05f13366c3f2e7e1aa0550bb5ca6
refs/heads/master: dc3c3377f03634d351fafdfe35b237b283586c04
42 changes: 30 additions & 12 deletions trunk/drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,13 +1027,15 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
#endif
}

rc = pci_request_regions(pdev, DRV_NAME);
if (rc) {
disable_dev_on_err = 0;
goto err_out;
}

if (legacy_mode) {
if (!legacy_mode) {
rc = pci_request_regions(pdev, DRV_NAME);
if (rc) {
disable_dev_on_err = 0;
goto err_out;
}
} else {
/* Deal with combined mode hack. This side of the logic all
goes away once the combined mode hack is killed in 2.6.21 */
if (!request_region(ATA_PRIMARY_CMD, 8, "libata")) {
struct resource *conflict, res;
res.start = ATA_PRIMARY_CMD;
Expand Down Expand Up @@ -1071,6 +1073,13 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
}
} else
legacy_mode |= ATA_PORT_SECONDARY;

if (legacy_mode & ATA_PORT_PRIMARY)
pci_request_region(pdev, 1, DRV_NAME);
if (legacy_mode & ATA_PORT_SECONDARY)
pci_request_region(pdev, 3, DRV_NAME);
/* If there is a DMA resource, allocate it */
pci_request_region(pdev, 4, DRV_NAME);
}

/* we have legacy mode, but all ports are unavailable */
Expand Down Expand Up @@ -1114,11 +1123,20 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
err_out_ent:
kfree(probe_ent);
err_out_regions:
if (legacy_mode & ATA_PORT_PRIMARY)
release_region(ATA_PRIMARY_CMD, 8);
if (legacy_mode & ATA_PORT_SECONDARY)
release_region(ATA_SECONDARY_CMD, 8);
pci_release_regions(pdev);
/* All this conditional stuff is needed for the combined mode hack
until 2.6.21 when it can go */
if (legacy_mode) {
pci_release_region(pdev, 4);
if (legacy_mode & ATA_PORT_PRIMARY) {
release_region(ATA_PRIMARY_CMD, 8);
pci_release_region(pdev, 1);
}
if (legacy_mode & ATA_PORT_SECONDARY) {
release_region(ATA_SECONDARY_CMD, 8);
pci_release_region(pdev, 3);
}
} else
pci_release_regions(pdev);
err_out:
if (disable_dev_on_err)
pci_disable_device(pdev);
Expand Down

0 comments on commit dbee60e

Please sign in to comment.