aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-16 20:40:23 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-16 20:40:23 -0500
commit15b854853515e7223fd7224de53799af4a66059c (patch)
treecf5032502ac053685cd0db036df0a662ed537c33 /drivers/ide
parent73d4f7d5874b378fa622f156410ffba645c1ef40 (diff)
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: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/pci/cs5530.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index 9bf5fdfc5b1f..98f260196c4b 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -103,16 +103,13 @@ static int cs5530_config_dma (ide_drive_t *drive)
103 int unit = drive->select.b.unit; 103 int unit = drive->select.b.unit;
104 ide_drive_t *mate = &hwif->drives[unit^1]; 104 ide_drive_t *mate = &hwif->drives[unit^1];
105 struct hd_driveid *id = drive->id; 105 struct hd_driveid *id = drive->id;
106 unsigned int reg, timings; 106 unsigned int reg, timings = 0;
107 unsigned long basereg; 107 unsigned long basereg;
108 108
109 /* 109 /*
110 * Default to DMA-off in case we run into trouble here. 110 * Default to DMA-off in case we run into trouble here.
111 */ 111 */
112 hwif->ide_dma_off_quietly(drive); 112 hwif->ide_dma_off_quietly(drive);
113 /* turn off DMA while we fiddle */
114 hwif->ide_dma_host_off(drive);
115 /* clear DMA_capable bit */
116 113
117 /* 114 /*
118 * The CS5530 specifies that two drives sharing a cable cannot 115 * The CS5530 specifies that two drives sharing a cable cannot
@@ -182,9 +179,8 @@ static int cs5530_config_dma (ide_drive_t *drive)
182 case XFER_MW_DMA_1: timings = 0x00012121; break; 179 case XFER_MW_DMA_1: timings = 0x00012121; break;
183 case XFER_MW_DMA_2: timings = 0x00002020; break; 180 case XFER_MW_DMA_2: timings = 0x00002020; break;
184 default: 181 default:
185 printk(KERN_ERR "%s: cs5530_config_dma: huh? mode=%02x\n", 182 BUG();
186 drive->name, mode); 183 break;
187 return 1; /* failure */
188 } 184 }
189 basereg = CS5530_BASEREG(hwif); 185 basereg = CS5530_BASEREG(hwif);
190 reg = hwif->INL(basereg+4); /* get drive0 config register */ 186 reg = hwif->INL(basereg+4); /* get drive0 config register */
@@ -199,8 +195,6 @@ static int cs5530_config_dma (ide_drive_t *drive)
199 hwif->OUTL(reg, basereg+4); /* write drive0 config register */ 195 hwif->OUTL(reg, basereg+4); /* write drive0 config register */
200 hwif->OUTL(timings, basereg+12); /* write drive1 config register */ 196 hwif->OUTL(timings, basereg+12); /* write drive1 config register */
201 } 197 }
202 (void) hwif->ide_dma_host_on(drive);
203 /* set DMA_capable bit */
204 198
205 /* 199 /*
206 * Finally, turn DMA on in software, and exit. 200 * Finally, turn DMA on in software, and exit.