Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66126
b: refs/heads/master
c: f44ae58
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 11, 2007
1 parent d5cf0b9 commit b086177
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 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: ca1997c1f35891b9e5d6c71ac587f97216886194
refs/heads/master: f44ae58a273b1b051122784a159ad608b7205afd
21 changes: 8 additions & 13 deletions trunk/drivers/ide/arm/icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static void icside_build_sglist(ide_drive_t *drive, struct request *rq)
*/
static int icside_set_speed(ide_drive_t *drive, const u8 xfer_mode)
{
int on = 0, cycle_time = 0, use_dma_info = 0;
int cycle_time, use_dma_info = 0;

switch (xfer_mode) {
case XFER_MW_DMA_2:
Expand All @@ -272,6 +272,8 @@ static int icside_set_speed(ide_drive_t *drive, const u8 xfer_mode)
case XFER_SW_DMA_0:
cycle_time = 480;
break;
default:
return 1;
}

/*
Expand All @@ -283,17 +285,10 @@ static int icside_set_speed(ide_drive_t *drive, const u8 xfer_mode)

drive->drive_data = cycle_time;

if (cycle_time && ide_config_drive_speed(drive, xfer_mode) == 0)
on = 1;
else
drive->drive_data = 480;

printk("%s: %s selected (peak %dMB/s)\n", drive->name,
ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data);

drive->current_speed = xfer_mode;

return on;
return ide_config_drive_speed(drive, xfer_mode);
}

static void icside_dma_host_off(ide_drive_t *drive)
Expand All @@ -320,8 +315,7 @@ static int icside_dma_check(ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
ide_hwif_t *hwif = HWIF(drive);
int xfer_mode = XFER_PIO_2;
int on;
int xfer_mode = 0;

if (!(id->capability & 1) || !hwif->autodma)
goto out;
Expand Down Expand Up @@ -350,9 +344,10 @@ static int icside_dma_check(ide_drive_t *drive)
}

out:
on = icside_set_speed(drive, xfer_mode);
if (xfer_mode == 0)
return -1;

return on ? 0 : -1;
return icside_set_speed(drive, xfer_mode) ? -1 : 0;
}

static int icside_dma_end(ide_drive_t *drive)
Expand Down

0 comments on commit b086177

Please sign in to comment.