Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93662
b: refs/heads/master
c: 6c61064
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Apr 26, 2008
1 parent ce740b0 commit 7a95f84
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 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: 8552865935538127d2603110b3d36dba2b4e8eff
refs/heads/master: 6c61064162e6a9965a062b445c6bd6c8ed019183
35 changes: 17 additions & 18 deletions trunk/drivers/ide/pci/sl82c105.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static void sl82c105_resetproc(ide_drive_t *drive)
* Return the revision of the Winbond bridge
* which this function is part of.
*/
static unsigned int sl82c105_bridge_revision(struct pci_dev *dev)
static u8 sl82c105_bridge_revision(struct pci_dev *dev)
{
struct pci_dev *bridge;

Expand Down Expand Up @@ -287,27 +287,11 @@ static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const c
*/
static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
{
struct pci_dev *dev = to_pci_dev(hwif->dev);
unsigned int rev;

DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index));

if (!hwif->dma_base)
return;

rev = sl82c105_bridge_revision(dev);
if (rev <= 5) {
/*
* Never ever EVER under any circumstances enable
* DMA when the bridge is this old.
*/
printk(" %s: Winbond W83C553 bridge revision %d, "
"BM-DMA disabled\n", hwif->name, rev);
return;
}

hwif->mwdma_mask = ATA_MWDMA2;

hwif->dma_lost_irq = &sl82c105_dma_lost_irq;
hwif->dma_start = &sl82c105_dma_start;
hwif->ide_dma_end = &sl82c105_dma_end;
Expand Down Expand Up @@ -337,11 +321,26 @@ static const struct ide_port_info sl82c105_chipset __devinitdata = {
#endif
IDE_HFLAG_NO_AUTODMA,
.pio_mask = ATA_PIO5,
.mwdma_mask = ATA_MWDMA2,
};

static int __devinit sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
return ide_setup_pci_device(dev, &sl82c105_chipset);
struct ide_port_info d = sl82c105_chipset;
u8 rev = sl82c105_bridge_revision(dev);

if (rev <= 5) {
/*
* Never ever EVER under any circumstances enable
* DMA when the bridge is this old.
*/
printk(KERN_INFO "W82C105_IDE: Winbond W83C553 bridge "
"revision %d, BM-DMA disabled\n", rev);
d.init_hwif = NULL;
d.mwdma_mask = 0;
}

return ide_setup_pci_device(dev, &d);
}

static const struct pci_device_id sl82c105_pci_tbl[] = {
Expand Down

0 comments on commit 7a95f84

Please sign in to comment.