aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 15:21:50 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 15:21:50 -0400
commitff07488346702f554aaeb6aae982540aa0302373 (patch)
tree1df71858ebc91390c34ffc9e71a1c8c4278a785d /drivers/ide
parent0fd04dcc2ebb6ec9088c24b368b0ce1f42a98ef5 (diff)
ide: remove drive->ctl
Remove drive->ctl (it is always equal to 0x08 after init time). While at it: * Use ATA_DEVCTL_OBS define. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/h8300/ide-h8300.c4
-rw-r--r--drivers/ide/ide-iops.c10
-rw-r--r--drivers/ide/ide-probe.c2
-rw-r--r--drivers/ide/ide.c1
-rw-r--r--drivers/ide/pci/hpt366.c3
-rw-r--r--drivers/ide/pci/ns87415.c4
-rw-r--r--drivers/ide/pci/scc_pata.c4
-rw-r--r--drivers/ide/pci/sgiioc4.c2
8 files changed, 14 insertions, 16 deletions
diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c
index d5afc28eaae7..ae37ee58bae2 100644
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -96,7 +96,7 @@ static void h8300_tf_read(ide_drive_t *drive, ide_task_t *task)
96 } 96 }
97 97
98 /* be sure we're looking at the low order bits */ 98 /* be sure we're looking at the low order bits */
99 outb(drive->ctl & ~0x80, io_ports->ctl_addr); 99 outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);
100 100
101 if (task->tf_flags & IDE_TFLAG_IN_NSECT) 101 if (task->tf_flags & IDE_TFLAG_IN_NSECT)
102 tf->nsect = inb(io_ports->nsect_addr); 102 tf->nsect = inb(io_ports->nsect_addr);
@@ -110,7 +110,7 @@ static void h8300_tf_read(ide_drive_t *drive, ide_task_t *task)
110 tf->device = inb(io_ports->device_addr); 110 tf->device = inb(io_ports->device_addr);
111 111
112 if (task->tf_flags & IDE_TFLAG_LBA48) { 112 if (task->tf_flags & IDE_TFLAG_LBA48) {
113 outb(drive->ctl | 0x80, io_ports->ctl_addr); 113 outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr);
114 114
115 if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE) 115 if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE)
116 tf->hob_feature = inb(io_ports->feature_addr); 116 tf->hob_feature = inb(io_ports->feature_addr);
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 4c32cf0b623c..80ad4f234f3f 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -186,7 +186,7 @@ static void ide_tf_read(ide_drive_t *drive, ide_task_t *task)
186 } 186 }
187 187
188 /* be sure we're looking at the low order bits */ 188 /* be sure we're looking at the low order bits */
189 tf_outb(drive->ctl & ~0x80, io_ports->ctl_addr); 189 tf_outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);
190 190
191 if (task->tf_flags & IDE_TFLAG_IN_NSECT) 191 if (task->tf_flags & IDE_TFLAG_IN_NSECT)
192 tf->nsect = tf_inb(io_ports->nsect_addr); 192 tf->nsect = tf_inb(io_ports->nsect_addr);
@@ -200,7 +200,7 @@ static void ide_tf_read(ide_drive_t *drive, ide_task_t *task)
200 tf->device = tf_inb(io_ports->device_addr); 200 tf->device = tf_inb(io_ports->device_addr);
201 201
202 if (task->tf_flags & IDE_TFLAG_LBA48) { 202 if (task->tf_flags & IDE_TFLAG_LBA48) {
203 tf_outb(drive->ctl | 0x80, io_ports->ctl_addr); 203 tf_outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr);
204 204
205 if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE) 205 if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE)
206 tf->hob_feature = tf_inb(io_ports->feature_addr); 206 tf->hob_feature = tf_inb(io_ports->feature_addr);
@@ -1125,13 +1125,13 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
1125 * recover from reset very quickly, saving us the first 50ms wait time. 1125 * recover from reset very quickly, saving us the first 50ms wait time.
1126 */ 1126 */
1127 /* set SRST and nIEN */ 1127 /* set SRST and nIEN */
1128 hwif->OUTBSYNC(hwif, drive->ctl | 6, io_ports->ctl_addr); 1128 hwif->OUTBSYNC(hwif, ATA_DEVCTL_OBS | 6, io_ports->ctl_addr);
1129 /* more than enough time */ 1129 /* more than enough time */
1130 udelay(10); 1130 udelay(10);
1131 if (drive->quirk_list == 2) 1131 if (drive->quirk_list == 2)
1132 ctl = drive->ctl; /* clear SRST and nIEN */ 1132 ctl = ATA_DEVCTL_OBS; /* clear SRST and nIEN */
1133 else 1133 else
1134 ctl = drive->ctl | 2; /* clear SRST, leave nIEN */ 1134 ctl = ATA_DEVCTL_OBS | 2; /* clear SRST, leave nIEN */
1135 hwif->OUTBSYNC(hwif, ctl, io_ports->ctl_addr); 1135 hwif->OUTBSYNC(hwif, ctl, io_ports->ctl_addr);
1136 /* more than enough time */ 1136 /* more than enough time */
1137 udelay(10); 1137 udelay(10);
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 809362b13c99..d21e51a02c3e 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1065,7 +1065,7 @@ static int init_irq (ide_hwif_t *hwif)
1065 1065
1066 if (io_ports->ctl_addr) 1066 if (io_ports->ctl_addr)
1067 /* clear nIEN */ 1067 /* clear nIEN */
1068 hwif->OUTBSYNC(hwif, 0x08, io_ports->ctl_addr); 1068 hwif->OUTBSYNC(hwif, ATA_DEVCTL_OBS, io_ports->ctl_addr);
1069 1069
1070 if (request_irq(hwif->irq,&ide_intr,sa,hwif->name,hwgroup)) 1070 if (request_irq(hwif->irq,&ide_intr,sa,hwif->name,hwgroup))
1071 goto out_unlink; 1071 goto out_unlink;
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 1defba3eefe7..2b8453510e09 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -136,7 +136,6 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
136 drive->media = ide_disk; 136 drive->media = ide_disk;
137 drive->select.all = (unit<<4)|0xa0; 137 drive->select.all = (unit<<4)|0xa0;
138 drive->hwif = hwif; 138 drive->hwif = hwif;
139 drive->ctl = 0x08;
140 drive->ready_stat = READY_STAT; 139 drive->ready_stat = READY_STAT;
141 drive->bad_wstat = BAD_W_STAT; 140 drive->bad_wstat = BAD_W_STAT;
142 drive->special.b.recalibrate = 1; 141 drive->special.b.recalibrate = 1;
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index c929dadaaaff..397c6cbe953c 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -759,8 +759,7 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
759 enable_irq (hwif->irq); 759 enable_irq (hwif->irq);
760 } 760 }
761 } else 761 } else
762 outb(mask ? (drive->ctl | 2) : (drive->ctl & ~2), 762 outb(ATA_DEVCTL_OBS | (mask ? 2 : 0), hwif->io_ports.ctl_addr);
763 hwif->io_ports.ctl_addr);
764} 763}
765 764
766/* 765/*
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
index a7a41bb82778..45ba71a7182f 100644
--- a/drivers/ide/pci/ns87415.c
+++ b/drivers/ide/pci/ns87415.c
@@ -76,7 +76,7 @@ static void superio_tf_read(ide_drive_t *drive, ide_task_t *task)
76 } 76 }
77 77
78 /* be sure we're looking at the low order bits */ 78 /* be sure we're looking at the low order bits */
79 outb(drive->ctl & ~0x80, io_ports->ctl_addr); 79 outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);
80 80
81 if (task->tf_flags & IDE_TFLAG_IN_NSECT) 81 if (task->tf_flags & IDE_TFLAG_IN_NSECT)
82 tf->nsect = inb(io_ports->nsect_addr); 82 tf->nsect = inb(io_ports->nsect_addr);
@@ -90,7 +90,7 @@ static void superio_tf_read(ide_drive_t *drive, ide_task_t *task)
90 tf->device = superio_ide_inb(io_ports->device_addr); 90 tf->device = superio_ide_inb(io_ports->device_addr);
91 91
92 if (task->tf_flags & IDE_TFLAG_LBA48) { 92 if (task->tf_flags & IDE_TFLAG_LBA48) {
93 outb(drive->ctl | 0x80, io_ports->ctl_addr); 93 outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr);
94 94
95 if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE) 95 if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE)
96 tf->hob_feature = inb(io_ports->feature_addr); 96 tf->hob_feature = inb(io_ports->feature_addr);
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c
index 32eb0877fce2..1584ebb6a185 100644
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -703,7 +703,7 @@ static void scc_tf_read(ide_drive_t *drive, ide_task_t *task)
703 } 703 }
704 704
705 /* be sure we're looking at the low order bits */ 705 /* be sure we're looking at the low order bits */
706 scc_ide_outb(drive->ctl & ~0x80, io_ports->ctl_addr); 706 scc_ide_outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);
707 707
708 if (task->tf_flags & IDE_TFLAG_IN_NSECT) 708 if (task->tf_flags & IDE_TFLAG_IN_NSECT)
709 tf->nsect = scc_ide_inb(io_ports->nsect_addr); 709 tf->nsect = scc_ide_inb(io_ports->nsect_addr);
@@ -717,7 +717,7 @@ static void scc_tf_read(ide_drive_t *drive, ide_task_t *task)
717 tf->device = scc_ide_inb(io_ports->device_addr); 717 tf->device = scc_ide_inb(io_ports->device_addr);
718 718
719 if (task->tf_flags & IDE_TFLAG_LBA48) { 719 if (task->tf_flags & IDE_TFLAG_LBA48) {
720 scc_ide_outb(drive->ctl | 0x80, io_ports->ctl_addr); 720 scc_ide_outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr);
721 721
722 if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE) 722 if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE)
723 tf->hob_feature = scc_ide_inb(io_ports->feature_addr); 723 tf->hob_feature = scc_ide_inb(io_ports->feature_addr);
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index c1b667c53f2b..24513e3dcd6b 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -111,7 +111,7 @@ sgiioc4_init_hwif_ports(hw_regs_t * hw, unsigned long data_port,
111static void 111static void
112sgiioc4_maskproc(ide_drive_t * drive, int mask) 112sgiioc4_maskproc(ide_drive_t * drive, int mask)
113{ 113{
114 writeb(mask ? (drive->ctl | 2) : (drive->ctl & ~2), 114 writeb(ATA_DEVCTL_OBS | (mask ? 2 : 0),
115 (void __iomem *)drive->hwif->io_ports.ctl_addr); 115 (void __iomem *)drive->hwif->io_ports.ctl_addr);
116} 116}
117 117