diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2009-06-15 12:52:57 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-06-15 12:52:57 -0400 |
commit | 74414a91204ee57528041f771da1fd1ee3ba64c4 (patch) | |
tree | 866ea9b70f3448867024a30803d481a5350aa9da /drivers/ide/siimage.c | |
parent | 30e5ffc368ff7d96fbc7a51ede10809642b0a6df (diff) |
siimage: use ide_dma_test_irq() (take 2)
Remove interrupt bit test (not trusted anyway) from siimage_io_dma_test_irq()
and siimage_mmio_dma_test_irq() -- this allows to replace the former function
with now identical ide_dma_test_irq()...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/siimage.c')
-rw-r--r-- | drivers/ide/siimage.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/drivers/ide/siimage.c b/drivers/ide/siimage.c index 6a643fdf0e6e..af4fe7c48a01 100644 --- a/drivers/ide/siimage.c +++ b/drivers/ide/siimage.c | |||
@@ -338,26 +338,6 @@ static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
338 | sil_iowrite16(dev, ultra, ua); | 338 | sil_iowrite16(dev, ultra, ua); |
339 | } | 339 | } |
340 | 340 | ||
341 | /* returns 1 if dma irq issued, 0 otherwise */ | ||
342 | static int siimage_io_dma_test_irq(ide_drive_t *drive) | ||
343 | { | ||
344 | ide_hwif_t *hwif = drive->hwif; | ||
345 | struct pci_dev *dev = to_pci_dev(hwif->dev); | ||
346 | u8 dma_altstat = 0; | ||
347 | unsigned long addr = siimage_selreg(hwif, 1); | ||
348 | |||
349 | /* return 1 if INTR asserted */ | ||
350 | if (inb(hwif->dma_base + ATA_DMA_STATUS) & 4) | ||
351 | return 1; | ||
352 | |||
353 | /* return 1 if Device INTR asserted */ | ||
354 | pci_read_config_byte(dev, addr, &dma_altstat); | ||
355 | if (dma_altstat & 8) | ||
356 | return 0; /* return 1; */ | ||
357 | |||
358 | return 0; | ||
359 | } | ||
360 | |||
361 | /** | 341 | /** |
362 | * siimage_mmio_dma_test_irq - check we caused an IRQ | 342 | * siimage_mmio_dma_test_irq - check we caused an IRQ |
363 | * @drive: drive we are testing | 343 | * @drive: drive we are testing |
@@ -369,7 +349,6 @@ static int siimage_io_dma_test_irq(ide_drive_t *drive) | |||
369 | static int siimage_mmio_dma_test_irq(ide_drive_t *drive) | 349 | static int siimage_mmio_dma_test_irq(ide_drive_t *drive) |
370 | { | 350 | { |
371 | ide_hwif_t *hwif = drive->hwif; | 351 | ide_hwif_t *hwif = drive->hwif; |
372 | unsigned long addr = siimage_selreg(hwif, 0x1); | ||
373 | void __iomem *sata_error_addr | 352 | void __iomem *sata_error_addr |
374 | = (void __iomem *)hwif->sata_scr[SATA_ERROR_OFFSET]; | 353 | = (void __iomem *)hwif->sata_scr[SATA_ERROR_OFFSET]; |
375 | 354 | ||
@@ -398,10 +377,6 @@ static int siimage_mmio_dma_test_irq(ide_drive_t *drive) | |||
398 | if (readb((void __iomem *)(hwif->dma_base + ATA_DMA_STATUS)) & 4) | 377 | if (readb((void __iomem *)(hwif->dma_base + ATA_DMA_STATUS)) & 4) |
399 | return 1; | 378 | return 1; |
400 | 379 | ||
401 | /* return 1 if Device INTR asserted */ | ||
402 | if (readb((void __iomem *)addr) & 8) | ||
403 | return 0; /* return 1; */ | ||
404 | |||
405 | return 0; | 380 | return 0; |
406 | } | 381 | } |
407 | 382 | ||
@@ -410,7 +385,7 @@ static int siimage_dma_test_irq(ide_drive_t *drive) | |||
410 | if (drive->hwif->host_flags & IDE_HFLAG_MMIO) | 385 | if (drive->hwif->host_flags & IDE_HFLAG_MMIO) |
411 | return siimage_mmio_dma_test_irq(drive); | 386 | return siimage_mmio_dma_test_irq(drive); |
412 | else | 387 | else |
413 | return siimage_io_dma_test_irq(drive); | 388 | return ide_dma_test_irq(drive); |
414 | } | 389 | } |
415 | 390 | ||
416 | /** | 391 | /** |