]> err.no Git - linux-2.6/commitdiff
ide: remove drive->ctl
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 15 Jul 2008 19:21:50 +0000 (21:21 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 15 Jul 2008 19:21:50 +0000 (21:21 +0200)
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>
drivers/ide/h8300/ide-h8300.c
drivers/ide/ide-iops.c
drivers/ide/ide-probe.c
drivers/ide/ide.c
drivers/ide/pci/hpt366.c
drivers/ide/pci/ns87415.c
drivers/ide/pci/scc_pata.c
drivers/ide/pci/sgiioc4.c
include/linux/ide.h

index d5afc28eaae7e47a2c5633b0a1e0dbc5cbbb8977..ae37ee58bae27a474f80fc3e72edbafc6528cad2 100644 (file)
@@ -96,7 +96,7 @@ static void h8300_tf_read(ide_drive_t *drive, ide_task_t *task)
        }
 
        /* be sure we're looking at the low order bits */
-       outb(drive->ctl & ~0x80, io_ports->ctl_addr);
+       outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);
 
        if (task->tf_flags & IDE_TFLAG_IN_NSECT)
                tf->nsect  = inb(io_ports->nsect_addr);
@@ -110,7 +110,7 @@ static void h8300_tf_read(ide_drive_t *drive, ide_task_t *task)
                tf->device = inb(io_ports->device_addr);
 
        if (task->tf_flags & IDE_TFLAG_LBA48) {
-               outb(drive->ctl | 0x80, io_ports->ctl_addr);
+               outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr);
 
                if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE)
                        tf->hob_feature = inb(io_ports->feature_addr);
index 4c32cf0b623c60a08b672a00575c0e57a3a8eca0..80ad4f234f3f015a18537c4f65bf891c293bd1ea 100644 (file)
@@ -186,7 +186,7 @@ static void ide_tf_read(ide_drive_t *drive, ide_task_t *task)
        }
 
        /* be sure we're looking at the low order bits */
-       tf_outb(drive->ctl & ~0x80, io_ports->ctl_addr);
+       tf_outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);
 
        if (task->tf_flags & IDE_TFLAG_IN_NSECT)
                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)
                tf->device = tf_inb(io_ports->device_addr);
 
        if (task->tf_flags & IDE_TFLAG_LBA48) {
-               tf_outb(drive->ctl | 0x80, io_ports->ctl_addr);
+               tf_outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr);
 
                if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE)
                        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)
         * recover from reset very quickly, saving us the first 50ms wait time.
         */
        /* set SRST and nIEN */
-       hwif->OUTBSYNC(hwif, drive->ctl | 6, io_ports->ctl_addr);
+       hwif->OUTBSYNC(hwif, ATA_DEVCTL_OBS | 6, io_ports->ctl_addr);
        /* more than enough time */
        udelay(10);
        if (drive->quirk_list == 2)
-               ctl = drive->ctl;       /* clear SRST and nIEN */
+               ctl = ATA_DEVCTL_OBS;           /* clear SRST and nIEN */
        else
-               ctl = drive->ctl | 2;   /* clear SRST, leave nIEN */
+               ctl = ATA_DEVCTL_OBS | 2;       /* clear SRST, leave nIEN */
        hwif->OUTBSYNC(hwif, ctl, io_ports->ctl_addr);
        /* more than enough time */
        udelay(10);
index 809362b13c99bcc4dffb683057ff60028759c0df..d21e51a02c3e9c17579e64cf7a886b66dc77207c 100644 (file)
@@ -1065,7 +1065,7 @@ static int init_irq (ide_hwif_t *hwif)
 
                if (io_ports->ctl_addr)
                        /* clear nIEN */
-                       hwif->OUTBSYNC(hwif, 0x08, io_ports->ctl_addr);
+                       hwif->OUTBSYNC(hwif, ATA_DEVCTL_OBS, io_ports->ctl_addr);
 
                if (request_irq(hwif->irq,&ide_intr,sa,hwif->name,hwgroup))
                        goto out_unlink;
index 1defba3eefe7bec6a06d0039201f95d36cdee5ec..2b8453510e0900211b21ad6d742070fac1556151 100644 (file)
@@ -136,7 +136,6 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
                drive->media                    = ide_disk;
                drive->select.all               = (unit<<4)|0xa0;
                drive->hwif                     = hwif;
-               drive->ctl                      = 0x08;
                drive->ready_stat               = READY_STAT;
                drive->bad_wstat                = BAD_W_STAT;
                drive->special.b.recalibrate    = 1;
index c929dadaaaffb02836cf6e66067f6862cd8c0dae..397c6cbe953c0e42fc8a7636b9eca36377a429b6 100644 (file)
@@ -759,8 +759,7 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
                                enable_irq (hwif->irq);
                }
        } else
-               outb(mask ? (drive->ctl | 2) : (drive->ctl & ~2),
-                    hwif->io_ports.ctl_addr);
+               outb(ATA_DEVCTL_OBS | (mask ? 2 : 0), hwif->io_ports.ctl_addr);
 }
 
 /*
index a7a41bb827783b7946ada332583e042a1c23338a..45ba71a7182fdf87a4d988a0c4eee66cb224c6d4 100644 (file)
@@ -76,7 +76,7 @@ static void superio_tf_read(ide_drive_t *drive, ide_task_t *task)
        }
 
        /* be sure we're looking at the low order bits */
-       outb(drive->ctl & ~0x80, io_ports->ctl_addr);
+       outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);
 
        if (task->tf_flags & IDE_TFLAG_IN_NSECT)
                tf->nsect  = inb(io_ports->nsect_addr);
@@ -90,7 +90,7 @@ static void superio_tf_read(ide_drive_t *drive, ide_task_t *task)
                tf->device = superio_ide_inb(io_ports->device_addr);
 
        if (task->tf_flags & IDE_TFLAG_LBA48) {
-               outb(drive->ctl | 0x80, io_ports->ctl_addr);
+               outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr);
 
                if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE)
                        tf->hob_feature = inb(io_ports->feature_addr);
index 32eb0877fce23bee6ac89ad01b475d4d177701b8..1584ebb6a185b6d8da78fa3b205c909c7d52464e 100644 (file)
@@ -703,7 +703,7 @@ static void scc_tf_read(ide_drive_t *drive, ide_task_t *task)
        }
 
        /* be sure we're looking at the low order bits */
-       scc_ide_outb(drive->ctl & ~0x80, io_ports->ctl_addr);
+       scc_ide_outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);
 
        if (task->tf_flags & IDE_TFLAG_IN_NSECT)
                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)
                tf->device = scc_ide_inb(io_ports->device_addr);
 
        if (task->tf_flags & IDE_TFLAG_LBA48) {
-               scc_ide_outb(drive->ctl | 0x80, io_ports->ctl_addr);
+               scc_ide_outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr);
 
                if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE)
                        tf->hob_feature = scc_ide_inb(io_ports->feature_addr);
index c1b667c53f2b7e769f998613eecc857f4afd8cb7..24513e3dcd6b81c0c1a159a5f5f37200f221268f 100644 (file)
@@ -111,7 +111,7 @@ sgiioc4_init_hwif_ports(hw_regs_t * hw, unsigned long data_port,
 static void
 sgiioc4_maskproc(ide_drive_t * drive, int mask)
 {
-       writeb(mask ? (drive->ctl | 2) : (drive->ctl & ~2),
+       writeb(ATA_DEVCTL_OBS | (mask ? 2 : 0),
               (void __iomem *)drive->hwif->io_ports.ctl_addr);
 }
 
index 4d1c9714f1d9769820a63dfe4279956cb9ca78f7..d8c86f0362c49c662842b4dc0c7cd19b76c08462 100644 (file)
@@ -364,7 +364,6 @@ typedef struct ide_drive_s {
         u8     wcache;         /* status of write cache */
        u8      acoustic;       /* acoustic management */
        u8      media;          /* disk, cdrom, tape, floppy, ... */
-       u8      ctl;            /* "normal" value for Control register */
        u8      ready_stat;     /* min status value for drive ready */
        u8      mult_count;     /* current multiple sector setting */
        u8      mult_req;       /* requested multiple sector setting */
@@ -1340,7 +1339,7 @@ static inline void ide_set_irq(ide_drive_t *drive, int on)
 {
        ide_hwif_t *hwif = drive->hwif;
 
-       hwif->OUTBSYNC(hwif, drive->ctl | (on ? 0 : 2),
+       hwif->OUTBSYNC(hwif, ATA_DEVCTL_OBS | (on ? 0 : 2),
                       hwif->io_ports.ctl_addr);
 }