Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93567
b: refs/heads/master
c: 05230e2
h: refs/heads/master
i:
  93565: 1bcb424
  93563: 1e8f663
  93559: 919da34
  93551: bec0b75
  93535: cd22253
  93503: b10fe7a
  93439: 794c84f
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Apr 26, 2008
1 parent c0f36d7 commit 8e59a7e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 27 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: 951784b667d78dad52ffea0a958fdbe14da97972
refs/heads/master: 05230e23cf02d939865a902f6ec4c1b2c82faf33
36 changes: 11 additions & 25 deletions trunk/drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,29 +251,21 @@ static struct resource* hwif_request_region(ide_hwif_t *hwif,
int ide_hwif_request_regions(ide_hwif_t *hwif)
{
unsigned long addr;
unsigned int i;

if (hwif->mmio)
return 0;

addr = hwif->io_ports[IDE_CONTROL_OFFSET];

if (addr && !hwif_request_region(hwif, addr, 1))
goto control_region_busy;
hwif->straight8 = 0;

addr = hwif->io_ports[IDE_DATA_OFFSET];
if ((addr | 7) == hwif->io_ports[IDE_STATUS_OFFSET]) {
if (!hwif_request_region(hwif, addr, 8))
goto data_region_busy;
hwif->straight8 = 1;
return 0;
}
for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
addr = hwif->io_ports[i];
if (!hwif_request_region(hwif, addr, 1)) {
while (--i)
release_region(addr, 1);
goto data_region_busy;
}
}
BUG_ON((addr | 7) != hwif->io_ports[IDE_STATUS_OFFSET]);

if (!hwif_request_region(hwif, addr, 8))
goto data_region_busy;

return 0;

data_region_busy:
Expand All @@ -299,19 +291,13 @@ int ide_hwif_request_regions(ide_hwif_t *hwif)

void ide_hwif_release_regions(ide_hwif_t *hwif)
{
u32 i = 0;

if (hwif->mmio)
return;

if (hwif->io_ports[IDE_CONTROL_OFFSET])
release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1);
if (hwif->straight8) {
release_region(hwif->io_ports[IDE_DATA_OFFSET], 8);
return;
}
for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++)
if (hwif->io_ports[i])
release_region(hwif->io_ports[i], 1);

release_region(hwif->io_ports[IDE_DATA_OFFSET], 8);
}

void ide_remove_port_from_hwgroup(ide_hwif_t *hwif)
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,6 @@ typedef struct hwif_s {
unsigned reset : 1; /* reset after probe */
unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
unsigned mmio : 1; /* host uses MMIO */
unsigned straight8 : 1; /* Alan's straight 8 check */

struct device gendev;
struct device *portdev;
Expand Down

0 comments on commit 8e59a7e

Please sign in to comment.