cs5530: small cleanup

* BUG() on unknown DMA mode in cs5530_config_dma()
* there is no need to call hwif->ide_dma_host_{off,on}() in
  cs5530_config_dma() because hwif->ide_dma_host_{off,on}()
  is called by hwif->ide_dma_off_{quietly,on}()
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 73d4f7d5
...@@ -103,16 +103,13 @@ static int cs5530_config_dma (ide_drive_t *drive) ...@@ -103,16 +103,13 @@ static int cs5530_config_dma (ide_drive_t *drive)
int unit = drive->select.b.unit; int unit = drive->select.b.unit;
ide_drive_t *mate = &hwif->drives[unit^1]; ide_drive_t *mate = &hwif->drives[unit^1];
struct hd_driveid *id = drive->id; struct hd_driveid *id = drive->id;
unsigned int reg, timings; unsigned int reg, timings = 0;
unsigned long basereg; unsigned long basereg;
/* /*
* Default to DMA-off in case we run into trouble here. * Default to DMA-off in case we run into trouble here.
*/ */
hwif->ide_dma_off_quietly(drive); hwif->ide_dma_off_quietly(drive);
/* turn off DMA while we fiddle */
hwif->ide_dma_host_off(drive);
/* clear DMA_capable bit */
/* /*
* The CS5530 specifies that two drives sharing a cable cannot * The CS5530 specifies that two drives sharing a cable cannot
...@@ -182,9 +179,8 @@ static int cs5530_config_dma (ide_drive_t *drive) ...@@ -182,9 +179,8 @@ static int cs5530_config_dma (ide_drive_t *drive)
case XFER_MW_DMA_1: timings = 0x00012121; break; case XFER_MW_DMA_1: timings = 0x00012121; break;
case XFER_MW_DMA_2: timings = 0x00002020; break; case XFER_MW_DMA_2: timings = 0x00002020; break;
default: default:
printk(KERN_ERR "%s: cs5530_config_dma: huh? mode=%02x\n", BUG();
drive->name, mode); break;
return 1; /* failure */
} }
basereg = CS5530_BASEREG(hwif); basereg = CS5530_BASEREG(hwif);
reg = hwif->INL(basereg+4); /* get drive0 config register */ reg = hwif->INL(basereg+4); /* get drive0 config register */
...@@ -199,8 +195,6 @@ static int cs5530_config_dma (ide_drive_t *drive) ...@@ -199,8 +195,6 @@ static int cs5530_config_dma (ide_drive_t *drive)
hwif->OUTL(reg, basereg+4); /* write drive0 config register */ hwif->OUTL(reg, basereg+4); /* write drive0 config register */
hwif->OUTL(timings, basereg+12); /* write drive1 config register */ hwif->OUTL(timings, basereg+12); /* write drive1 config register */
} }
(void) hwif->ide_dma_host_on(drive);
/* set DMA_capable bit */
/* /*
* Finally, turn DMA on in software, and exit. * Finally, turn DMA on in software, and exit.
......
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