ide: remove [ata_]select_t
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Mon, 13 Oct 2008 19:39:40 +0000 (21:39 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Mon, 13 Oct 2008 19:39:40 +0000 (21:39 +0200)
* Use 'drive->dn & 1' in ide_init_disk().

* remove [ata_]select_t.

While at it:

* Use ATA_DEVICE_OBS define in ide_port_init_devices_data().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/h8300/ide-h8300.c
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
drivers/ide/ide-probe.c
drivers/ide/ide.c
drivers/ide/legacy/ide-4drives.c
drivers/ide/pci/scc_pata.c
include/linux/ide.h

index bde7a585f1987e3488e318982754143399a3709e..e2cdd2e9cdecc70d388be220b3128d19efaf9de2 100644 (file)
@@ -80,7 +80,7 @@ static void h8300_tf_load(ide_drive_t *drive, ide_task_t *task)
                outb(tf->lbah, io_ports->lbah_addr);
 
        if (task->tf_flags & IDE_TFLAG_OUT_DEVICE)
-               outb((tf->device & HIHI) | drive->select.all,
+               outb((tf->device & HIHI) | drive->select,
                     io_ports->device_addr);
 }
 
index f8d8642903daf1f2569055c9a80386f7d88513c9..ecfb87c10097834d15013140e8524463d9ccb44f 100644 (file)
@@ -495,7 +495,7 @@ static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
        tf->lbal    = drive->sect;
        tf->lbam    = drive->cyl;
        tf->lbah    = drive->cyl >> 8;
-       tf->device  = (drive->head - 1) | drive->select.all;
+       tf->device  = (drive->head - 1) | drive->select;
        tf->command = ATA_CMD_INIT_DEV_PARAMS;
 }
 
index cec744cbbde0fe37724def1c53fa7ba1c6df1f4d..925fd037cdde7d5ec93e501cc073b824cd4c0ecc 100644 (file)
@@ -181,7 +181,7 @@ void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
                tf_outb(tf->lbah, io_ports->lbah_addr);
 
        if (task->tf_flags & IDE_TFLAG_OUT_DEVICE)
-               tf_outb((tf->device & HIHI) | drive->select.all,
+               tf_outb((tf->device & HIHI) | drive->select,
                         io_ports->device_addr);
 }
 EXPORT_SYMBOL_GPL(ide_tf_load);
index 58a2caf17903e6aab6ca5fe300a1aaaac8662dae..242cfd09e16b7e00093b852496a03ce0a66148b9 100644 (file)
@@ -446,7 +446,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
        SELECT_DRIVE(drive);
        msleep(50);
 
-       if (ide_read_device(drive) != drive->select.all && present == 0) {
+       if (ide_read_device(drive) != drive->select && present == 0) {
                if (drive->dn & 1) {
                        /* exit with drive0 selected */
                        SELECT_DRIVE(&hwif->drives[0]);
@@ -1211,7 +1211,7 @@ EXPORT_SYMBOL_GPL(ide_unregister_region);
 void ide_init_disk(struct gendisk *disk, ide_drive_t *drive)
 {
        ide_hwif_t *hwif = drive->hwif;
-       unsigned int unit = (drive->select.all >> 4) & 1;
+       unsigned int unit = drive->dn & 1;
 
        disk->major = hwif->major;
        disk->first_minor = unit << PARTN_BITS;
index 7624b937398a7c67f0474962ff5d048134b85dd1..9d3482d907c97249c16285ba4cb88bc118524e20 100644 (file)
@@ -114,7 +114,7 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
                memset(drive, 0, sizeof(*drive));
 
                drive->media                    = ide_disk;
-               drive->select.all               = (unit<<4)|0xa0;
+               drive->select                   = (unit << 4) | ATA_DEVICE_OBS;
                drive->hwif                     = hwif;
                drive->ready_stat               = ATA_DRDY;
                drive->bad_wstat                = BAD_W_STAT;
index c76d55de6996413496ddc9c8d725f3feb633c860..9e85b1ec9607604178a6a99419b2449516027f5d 100644 (file)
@@ -14,7 +14,7 @@ MODULE_PARM_DESC(probe, "probe for generic IDE chipset with 4 drives/port");
 static void ide_4drives_init_dev(ide_drive_t *drive)
 {
        if (drive->hwif->channel)
-               drive->select.all ^= 0x20;
+               drive->select ^= 0x20;
 }
 
 static const struct ide_port_ops ide_4drives_port_ops = {
index 0eced0ae2e86965b94faed6e512206a5d0b3d447..c2e85fc21b5a27cc4ed6d061b76729add65c48f5 100644 (file)
@@ -705,7 +705,7 @@ static void scc_tf_load(ide_drive_t *drive, ide_task_t *task)
                scc_ide_outb(tf->lbah, io_ports->lbah_addr);
 
        if (task->tf_flags & IDE_TFLAG_OUT_DEVICE)
-               scc_ide_outb((tf->device & HIHI) | drive->select.all,
+               scc_ide_outb((tf->device & HIHI) | drive->select,
                             io_ports->device_addr);
 }
 
index 02984f1f041af00a9871fa5e0d19576b0cc4455a..3e418b996ef5c402665b75971586b21239fccc0d 100644 (file)
@@ -278,36 +278,6 @@ typedef union {
        } b;
 } special_t;
 
-/*
- * ATA-IDE Select Register, aka Device-Head
- *
- * head                : always zeros here
- * unit                : drive select number: 0/1
- * bit5                : always 1
- * lba         : using LBA instead of CHS
- * bit7                : always 1
- */
-typedef union {
-       unsigned all                    : 8;
-       struct {
-#if defined(__LITTLE_ENDIAN_BITFIELD)
-               unsigned head           : 4;
-               unsigned unit           : 1;
-               unsigned bit5           : 1;
-               unsigned lba            : 1;
-               unsigned bit7           : 1;
-#elif defined(__BIG_ENDIAN_BITFIELD)
-               unsigned bit7           : 1;
-               unsigned lba            : 1;
-               unsigned bit5           : 1;
-               unsigned unit           : 1;
-               unsigned head           : 4;
-#else
-#error "Please fix <asm/byteorder.h>"
-#endif
-       } b;
-} select_t, ata_select_t;
-
 /*
  * Status returned from various ide_ functions
  */
@@ -529,8 +499,8 @@ struct ide_drive_s {
        unsigned long timeout;          /* max time to wait for irq */
 
        special_t       special;        /* special action flags */
-       select_t        select;         /* basic drive/head select reg value */
 
+       u8      select;                 /* basic drive/head select reg value */
        u8      retry_pio;              /* retrying dma capable host in pio */
        u8      waiting_for_dma;        /* dma currently in progress */