aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/sl82c105.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:23 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:23 -0400
commit6c61064162e6a9965a062b445c6bd6c8ed019183 (patch)
treee849c9974c746c6956375d83ce24d35b490fd97e /drivers/ide/pci/sl82c105.c
parent8552865935538127d2603110b3d36dba2b4e8eff (diff)
sl82c105: check bridge revision in sl82c105_init_one()
* Make sl82c105_bridge_revision() return 'u8' instead of 'unsigned long'. * Check bridge revision in sl82c105_init_one(). While at: * Use proper KERN_ level for printk(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/sl82c105.c')
-rw-r--r--drivers/ide/pci/sl82c105.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 8ac4e62bf1f4..2c2fe59a0d9e 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -232,7 +232,7 @@ static void sl82c105_resetproc(ide_drive_t *drive)
232 * Return the revision of the Winbond bridge 232 * Return the revision of the Winbond bridge
233 * which this function is part of. 233 * which this function is part of.
234 */ 234 */
235static unsigned int sl82c105_bridge_revision(struct pci_dev *dev) 235static u8 sl82c105_bridge_revision(struct pci_dev *dev)
236{ 236{
237 struct pci_dev *bridge; 237 struct pci_dev *bridge;
238 238
@@ -287,27 +287,11 @@ static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const c
287 */ 287 */
288static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif) 288static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
289{ 289{
290 struct pci_dev *dev = to_pci_dev(hwif->dev);
291 unsigned int rev;
292
293 DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index)); 290 DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index));
294 291
295 if (!hwif->dma_base) 292 if (!hwif->dma_base)
296 return; 293 return;
297 294
298 rev = sl82c105_bridge_revision(dev);
299 if (rev <= 5) {
300 /*
301 * Never ever EVER under any circumstances enable
302 * DMA when the bridge is this old.
303 */
304 printk(" %s: Winbond W83C553 bridge revision %d, "
305 "BM-DMA disabled\n", hwif->name, rev);
306 return;
307 }
308
309 hwif->mwdma_mask = ATA_MWDMA2;
310
311 hwif->dma_lost_irq = &sl82c105_dma_lost_irq; 295 hwif->dma_lost_irq = &sl82c105_dma_lost_irq;
312 hwif->dma_start = &sl82c105_dma_start; 296 hwif->dma_start = &sl82c105_dma_start;
313 hwif->ide_dma_end = &sl82c105_dma_end; 297 hwif->ide_dma_end = &sl82c105_dma_end;
@@ -337,11 +321,26 @@ static const struct ide_port_info sl82c105_chipset __devinitdata = {
337#endif 321#endif
338 IDE_HFLAG_NO_AUTODMA, 322 IDE_HFLAG_NO_AUTODMA,
339 .pio_mask = ATA_PIO5, 323 .pio_mask = ATA_PIO5,
324 .mwdma_mask = ATA_MWDMA2,
340}; 325};
341 326
342static int __devinit sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id) 327static int __devinit sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id)
343{ 328{
344 return ide_setup_pci_device(dev, &sl82c105_chipset); 329 struct ide_port_info d = sl82c105_chipset;
330 u8 rev = sl82c105_bridge_revision(dev);
331
332 if (rev <= 5) {
333 /*
334 * Never ever EVER under any circumstances enable
335 * DMA when the bridge is this old.
336 */
337 printk(KERN_INFO "W82C105_IDE: Winbond W83C553 bridge "
338 "revision %d, BM-DMA disabled\n", rev);
339 d.init_hwif = NULL;
340 d.mwdma_mask = 0;
341 }
342
343 return ide_setup_pci_device(dev, &d);
345} 344}
346 345
347static const struct pci_device_id sl82c105_pci_tbl[] = { 346static const struct pci_device_id sl82c105_pci_tbl[] = {