aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/hpt366.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/hpt366.c')
-rw-r--r--drivers/ide/hpt366.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c
index b18e10d99d2e..3eb9b5c63a0f 100644
--- a/drivers/ide/hpt366.c
+++ b/drivers/ide/hpt366.c
@@ -626,7 +626,7 @@ static struct hpt_info *hpt3xx_get_info(struct device *dev)
626 626
627static u8 hpt3xx_udma_filter(ide_drive_t *drive) 627static u8 hpt3xx_udma_filter(ide_drive_t *drive)
628{ 628{
629 ide_hwif_t *hwif = HWIF(drive); 629 ide_hwif_t *hwif = drive->hwif;
630 struct hpt_info *info = hpt3xx_get_info(hwif->dev); 630 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
631 u8 mask = hwif->ultra_mask; 631 u8 mask = hwif->ultra_mask;
632 632
@@ -665,7 +665,7 @@ static u8 hpt3xx_udma_filter(ide_drive_t *drive)
665 665
666static u8 hpt3xx_mdma_filter(ide_drive_t *drive) 666static u8 hpt3xx_mdma_filter(ide_drive_t *drive)
667{ 667{
668 ide_hwif_t *hwif = HWIF(drive); 668 ide_hwif_t *hwif = drive->hwif;
669 struct hpt_info *info = hpt3xx_get_info(hwif->dev); 669 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
670 670
671 switch (info->chip_type) { 671 switch (info->chip_type) {
@@ -743,7 +743,7 @@ static void hpt3xx_quirkproc(ide_drive_t *drive)
743 743
744static void hpt3xx_maskproc(ide_drive_t *drive, int mask) 744static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
745{ 745{
746 ide_hwif_t *hwif = HWIF(drive); 746 ide_hwif_t *hwif = drive->hwif;
747 struct pci_dev *dev = to_pci_dev(hwif->dev); 747 struct pci_dev *dev = to_pci_dev(hwif->dev);
748 struct hpt_info *info = hpt3xx_get_info(hwif->dev); 748 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
749 749
@@ -788,7 +788,7 @@ static void hpt366_dma_lost_irq(ide_drive_t *drive)
788 788
789static void hpt370_clear_engine(ide_drive_t *drive) 789static void hpt370_clear_engine(ide_drive_t *drive)
790{ 790{
791 ide_hwif_t *hwif = HWIF(drive); 791 ide_hwif_t *hwif = drive->hwif;
792 struct pci_dev *dev = to_pci_dev(hwif->dev); 792 struct pci_dev *dev = to_pci_dev(hwif->dev);
793 793
794 pci_write_config_byte(dev, hwif->select_data, 0x37); 794 pci_write_config_byte(dev, hwif->select_data, 0x37);
@@ -797,7 +797,7 @@ static void hpt370_clear_engine(ide_drive_t *drive)
797 797
798static void hpt370_irq_timeout(ide_drive_t *drive) 798static void hpt370_irq_timeout(ide_drive_t *drive)
799{ 799{
800 ide_hwif_t *hwif = HWIF(drive); 800 ide_hwif_t *hwif = drive->hwif;
801 struct pci_dev *dev = to_pci_dev(hwif->dev); 801 struct pci_dev *dev = to_pci_dev(hwif->dev);
802 u16 bfifo = 0; 802 u16 bfifo = 0;
803 u8 dma_cmd; 803 u8 dma_cmd;
@@ -822,7 +822,7 @@ static void hpt370_dma_start(ide_drive_t *drive)
822 822
823static int hpt370_dma_end(ide_drive_t *drive) 823static int hpt370_dma_end(ide_drive_t *drive)
824{ 824{
825 ide_hwif_t *hwif = HWIF(drive); 825 ide_hwif_t *hwif = drive->hwif;
826 u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); 826 u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS);
827 827
828 if (dma_stat & 0x01) { 828 if (dma_stat & 0x01) {
@@ -844,7 +844,7 @@ static void hpt370_dma_timeout(ide_drive_t *drive)
844/* returns 1 if DMA IRQ issued, 0 otherwise */ 844/* returns 1 if DMA IRQ issued, 0 otherwise */
845static int hpt374_dma_test_irq(ide_drive_t *drive) 845static int hpt374_dma_test_irq(ide_drive_t *drive)
846{ 846{
847 ide_hwif_t *hwif = HWIF(drive); 847 ide_hwif_t *hwif = drive->hwif;
848 struct pci_dev *dev = to_pci_dev(hwif->dev); 848 struct pci_dev *dev = to_pci_dev(hwif->dev);
849 u16 bfifo = 0; 849 u16 bfifo = 0;
850 u8 dma_stat; 850 u8 dma_stat;
@@ -865,7 +865,7 @@ static int hpt374_dma_test_irq(ide_drive_t *drive)
865 865
866static int hpt374_dma_end(ide_drive_t *drive) 866static int hpt374_dma_end(ide_drive_t *drive)
867{ 867{
868 ide_hwif_t *hwif = HWIF(drive); 868 ide_hwif_t *hwif = drive->hwif;
869 struct pci_dev *dev = to_pci_dev(hwif->dev); 869 struct pci_dev *dev = to_pci_dev(hwif->dev);
870 u8 mcr = 0, mcr_addr = hwif->select_data; 870 u8 mcr = 0, mcr_addr = hwif->select_data;
871 u8 bwsr = 0, mask = hwif->channel ? 0x02 : 0x01; 871 u8 bwsr = 0, mask = hwif->channel ? 0x02 : 0x01;
@@ -927,7 +927,7 @@ static void hpt3xxn_set_clock(ide_hwif_t *hwif, u8 mode)
927 927
928static void hpt3xxn_rw_disk(ide_drive_t *drive, struct request *rq) 928static void hpt3xxn_rw_disk(ide_drive_t *drive, struct request *rq)
929{ 929{
930 hpt3xxn_set_clock(HWIF(drive), rq_data_dir(rq) ? 0x23 : 0x21); 930 hpt3xxn_set_clock(drive->hwif, rq_data_dir(rq) ? 0x23 : 0x21);
931} 931}
932 932
933/** 933/**
@@ -1349,8 +1349,6 @@ static int __devinit init_dma_hpt366(ide_hwif_t *hwif,
1349 if (ide_allocate_dma_engine(hwif)) 1349 if (ide_allocate_dma_engine(hwif))
1350 return -1; 1350 return -1;
1351 1351
1352 hwif->dma_ops = &sff_dma_ops;
1353
1354 return 0; 1352 return 0;
1355} 1353}
1356 1354
@@ -1426,6 +1424,7 @@ static const struct ide_dma_ops hpt37x_dma_ops = {
1426 .dma_test_irq = hpt374_dma_test_irq, 1424 .dma_test_irq = hpt374_dma_test_irq,
1427 .dma_lost_irq = ide_dma_lost_irq, 1425 .dma_lost_irq = ide_dma_lost_irq,
1428 .dma_timeout = ide_dma_timeout, 1426 .dma_timeout = ide_dma_timeout,
1427 .dma_sff_read_status = ide_dma_sff_read_status,
1429}; 1428};
1430 1429
1431static const struct ide_dma_ops hpt370_dma_ops = { 1430static const struct ide_dma_ops hpt370_dma_ops = {
@@ -1437,6 +1436,7 @@ static const struct ide_dma_ops hpt370_dma_ops = {
1437 .dma_test_irq = ide_dma_test_irq, 1436 .dma_test_irq = ide_dma_test_irq,
1438 .dma_lost_irq = ide_dma_lost_irq, 1437 .dma_lost_irq = ide_dma_lost_irq,
1439 .dma_timeout = hpt370_dma_timeout, 1438 .dma_timeout = hpt370_dma_timeout,
1439 .dma_sff_read_status = ide_dma_sff_read_status,
1440}; 1440};
1441 1441
1442static const struct ide_dma_ops hpt36x_dma_ops = { 1442static const struct ide_dma_ops hpt36x_dma_ops = {
@@ -1448,6 +1448,7 @@ static const struct ide_dma_ops hpt36x_dma_ops = {
1448 .dma_test_irq = ide_dma_test_irq, 1448 .dma_test_irq = ide_dma_test_irq,
1449 .dma_lost_irq = hpt366_dma_lost_irq, 1449 .dma_lost_irq = hpt366_dma_lost_irq,
1450 .dma_timeout = ide_dma_timeout, 1450 .dma_timeout = ide_dma_timeout,
1451 .dma_sff_read_status = ide_dma_sff_read_status,
1451}; 1452};
1452 1453
1453static const struct ide_port_info hpt366_chipsets[] __devinitdata = { 1454static const struct ide_port_info hpt366_chipsets[] __devinitdata = {