aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/siimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/siimage.c')
-rw-r--r--drivers/ide/pci/siimage.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 174a873b4c64..eb4faf92c571 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -116,13 +116,14 @@ static inline unsigned long siimage_seldev(ide_drive_t *drive, int r)
116{ 116{
117 ide_hwif_t *hwif = HWIF(drive); 117 ide_hwif_t *hwif = HWIF(drive);
118 unsigned long base = (unsigned long)hwif->hwif_data; 118 unsigned long base = (unsigned long)hwif->hwif_data;
119 u8 unit = drive->dn & 1;
119 120
120 base += 0xA0 + r; 121 base += 0xA0 + r;
121 if (hwif->host_flags & IDE_HFLAG_MMIO) 122 if (hwif->host_flags & IDE_HFLAG_MMIO)
122 base += hwif->channel << 6; 123 base += hwif->channel << 6;
123 else 124 else
124 base += hwif->channel << 4; 125 base += hwif->channel << 4;
125 base |= drive->select.b.unit << drive->select.b.unit; 126 base |= unit << unit;
126 return base; 127 return base;
127} 128}
128 129
@@ -255,7 +256,7 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio)
255 u8 addr_mask = hwif->channel ? (mmio ? 0xF4 : 0x84) 256 u8 addr_mask = hwif->channel ? (mmio ? 0xF4 : 0x84)
256 : (mmio ? 0xB4 : 0x80); 257 : (mmio ? 0xB4 : 0x80);
257 u8 mode = 0; 258 u8 mode = 0;
258 u8 unit = drive->select.b.unit; 259 u8 unit = drive->dn & 1;
259 260
260 /* trim *taskfile* PIO to the slowest of the master/slave */ 261 /* trim *taskfile* PIO to the slowest of the master/slave */
261 if (pair) { 262 if (pair) {
@@ -301,9 +302,9 @@ static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed)
301 302
302 ide_hwif_t *hwif = HWIF(drive); 303 ide_hwif_t *hwif = HWIF(drive);
303 struct pci_dev *dev = to_pci_dev(hwif->dev); 304 struct pci_dev *dev = to_pci_dev(hwif->dev);
304 u16 ultra = 0, multi = 0;
305 u8 mode = 0, unit = drive->select.b.unit;
306 unsigned long base = (unsigned long)hwif->hwif_data; 305 unsigned long base = (unsigned long)hwif->hwif_data;
306 u16 ultra = 0, multi = 0;
307 u8 mode = 0, unit = drive->dn & 1;
307 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0; 308 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
308 u8 scsc = 0, addr_mask = hwif->channel ? (mmio ? 0xF4 : 0x84) 309 u8 scsc = 0, addr_mask = hwif->channel ? (mmio ? 0xF4 : 0x84)
309 : (mmio ? 0xB4 : 0x80); 310 : (mmio ? 0xB4 : 0x80);
@@ -712,7 +713,7 @@ static const struct ide_dma_ops sil_dma_ops = {
712 .dma_setup = ide_dma_setup, 713 .dma_setup = ide_dma_setup,
713 .dma_exec_cmd = ide_dma_exec_cmd, 714 .dma_exec_cmd = ide_dma_exec_cmd,
714 .dma_start = ide_dma_start, 715 .dma_start = ide_dma_start,
715 .dma_end = __ide_dma_end, 716 .dma_end = ide_dma_end,
716 .dma_test_irq = siimage_dma_test_irq, 717 .dma_test_irq = siimage_dma_test_irq,
717 .dma_timeout = ide_dma_timeout, 718 .dma_timeout = ide_dma_timeout,
718 .dma_lost_irq = ide_dma_lost_irq, 719 .dma_lost_irq = ide_dma_lost_irq,
@@ -829,7 +830,7 @@ static const struct pci_device_id siimage_pci_tbl[] = {
829}; 830};
830MODULE_DEVICE_TABLE(pci, siimage_pci_tbl); 831MODULE_DEVICE_TABLE(pci, siimage_pci_tbl);
831 832
832static struct pci_driver driver = { 833static struct pci_driver siimage_pci_driver = {
833 .name = "SiI_IDE", 834 .name = "SiI_IDE",
834 .id_table = siimage_pci_tbl, 835 .id_table = siimage_pci_tbl,
835 .probe = siimage_init_one, 836 .probe = siimage_init_one,
@@ -840,12 +841,12 @@ static struct pci_driver driver = {
840 841
841static int __init siimage_ide_init(void) 842static int __init siimage_ide_init(void)
842{ 843{
843 return ide_pci_register_driver(&driver); 844 return ide_pci_register_driver(&siimage_pci_driver);
844} 845}
845 846
846static void __exit siimage_ide_exit(void) 847static void __exit siimage_ide_exit(void)
847{ 848{
848 pci_unregister_driver(&driver); 849 pci_unregister_driver(&siimage_pci_driver);
849} 850}
850 851
851module_init(siimage_ide_init); 852module_init(siimage_ide_init);