diff options
Diffstat (limited to 'drivers/ide/pci/alim15x3.c')
-rw-r--r-- | drivers/ide/pci/alim15x3.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index 053c75263918..daf9dce39e52 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c | |||
@@ -77,8 +77,7 @@ static void ali_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
77 | int bus_speed = ide_pci_clk ? ide_pci_clk : 33; | 77 | int bus_speed = ide_pci_clk ? ide_pci_clk : 33; |
78 | int port = hwif->channel ? 0x5c : 0x58; | 78 | int port = hwif->channel ? 0x5c : 0x58; |
79 | int portFIFO = hwif->channel ? 0x55 : 0x54; | 79 | int portFIFO = hwif->channel ? 0x55 : 0x54; |
80 | u8 cd_dma_fifo = 0; | 80 | u8 cd_dma_fifo = 0, unit = drive->dn & 1; |
81 | int unit = drive->select.b.unit & 1; | ||
82 | 81 | ||
83 | if ((s_clc = (s_time * bus_speed + 999) / 1000) >= 8) | 82 | if ((s_clc = (s_time * bus_speed + 999) / 1000) >= 8) |
84 | s_clc = 0; | 83 | s_clc = 0; |
@@ -112,7 +111,7 @@ static void ali_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
112 | } | 111 | } |
113 | 112 | ||
114 | pci_write_config_byte(dev, port, s_clc); | 113 | pci_write_config_byte(dev, port, s_clc); |
115 | pci_write_config_byte(dev, port+drive->select.b.unit+2, (a_clc << 4) | r_clc); | 114 | pci_write_config_byte(dev, port + unit + 2, (a_clc << 4) | r_clc); |
116 | local_irq_restore(flags); | 115 | local_irq_restore(flags); |
117 | } | 116 | } |
118 | 117 | ||
@@ -154,7 +153,7 @@ static void ali_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
154 | ide_hwif_t *hwif = HWIF(drive); | 153 | ide_hwif_t *hwif = HWIF(drive); |
155 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 154 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
156 | u8 speed1 = speed; | 155 | u8 speed1 = speed; |
157 | u8 unit = (drive->select.b.unit & 0x01); | 156 | u8 unit = drive->dn & 1; |
158 | u8 tmpbyte = 0x00; | 157 | u8 tmpbyte = 0x00; |
159 | int m5229_udma = (hwif->channel) ? 0x57 : 0x56; | 158 | int m5229_udma = (hwif->channel) ? 0x57 : 0x56; |
160 | 159 | ||
@@ -508,7 +507,7 @@ static const struct ide_dma_ops ali_dma_ops = { | |||
508 | .dma_setup = ali15x3_dma_setup, | 507 | .dma_setup = ali15x3_dma_setup, |
509 | .dma_exec_cmd = ide_dma_exec_cmd, | 508 | .dma_exec_cmd = ide_dma_exec_cmd, |
510 | .dma_start = ide_dma_start, | 509 | .dma_start = ide_dma_start, |
511 | .dma_end = __ide_dma_end, | 510 | .dma_end = ide_dma_end, |
512 | .dma_test_irq = ide_dma_test_irq, | 511 | .dma_test_irq = ide_dma_test_irq, |
513 | .dma_lost_irq = ide_dma_lost_irq, | 512 | .dma_lost_irq = ide_dma_lost_irq, |
514 | .dma_timeout = ide_dma_timeout, | 513 | .dma_timeout = ide_dma_timeout, |
@@ -576,7 +575,7 @@ static const struct pci_device_id alim15x3_pci_tbl[] = { | |||
576 | }; | 575 | }; |
577 | MODULE_DEVICE_TABLE(pci, alim15x3_pci_tbl); | 576 | MODULE_DEVICE_TABLE(pci, alim15x3_pci_tbl); |
578 | 577 | ||
579 | static struct pci_driver driver = { | 578 | static struct pci_driver alim15x3_pci_driver = { |
580 | .name = "ALI15x3_IDE", | 579 | .name = "ALI15x3_IDE", |
581 | .id_table = alim15x3_pci_tbl, | 580 | .id_table = alim15x3_pci_tbl, |
582 | .probe = alim15x3_init_one, | 581 | .probe = alim15x3_init_one, |
@@ -587,12 +586,12 @@ static struct pci_driver driver = { | |||
587 | 586 | ||
588 | static int __init ali15x3_ide_init(void) | 587 | static int __init ali15x3_ide_init(void) |
589 | { | 588 | { |
590 | return ide_pci_register_driver(&driver); | 589 | return ide_pci_register_driver(&alim15x3_pci_driver); |
591 | } | 590 | } |
592 | 591 | ||
593 | static void __exit ali15x3_ide_exit(void) | 592 | static void __exit ali15x3_ide_exit(void) |
594 | { | 593 | { |
595 | return pci_unregister_driver(&driver); | 594 | return pci_unregister_driver(&alim15x3_pci_driver); |
596 | } | 595 | } |
597 | 596 | ||
598 | module_init(ali15x3_ide_init); | 597 | module_init(ali15x3_ide_init); |