ide: remove [ata_]select_t

* 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: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 123995b9
...@@ -80,7 +80,7 @@ static void h8300_tf_load(ide_drive_t *drive, ide_task_t *task) ...@@ -80,7 +80,7 @@ static void h8300_tf_load(ide_drive_t *drive, ide_task_t *task)
outb(tf->lbah, io_ports->lbah_addr); outb(tf->lbah, io_ports->lbah_addr);
if (task->tf_flags & IDE_TFLAG_OUT_DEVICE) 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); io_ports->device_addr);
} }
......
...@@ -495,7 +495,7 @@ static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf) ...@@ -495,7 +495,7 @@ static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
tf->lbal = drive->sect; tf->lbal = drive->sect;
tf->lbam = drive->cyl; tf->lbam = drive->cyl;
tf->lbah = drive->cyl >> 8; 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; tf->command = ATA_CMD_INIT_DEV_PARAMS;
} }
......
...@@ -181,7 +181,7 @@ void ide_tf_load(ide_drive_t *drive, ide_task_t *task) ...@@ -181,7 +181,7 @@ void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
tf_outb(tf->lbah, io_ports->lbah_addr); tf_outb(tf->lbah, io_ports->lbah_addr);
if (task->tf_flags & IDE_TFLAG_OUT_DEVICE) 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); io_ports->device_addr);
} }
EXPORT_SYMBOL_GPL(ide_tf_load); EXPORT_SYMBOL_GPL(ide_tf_load);
......
...@@ -446,7 +446,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd) ...@@ -446,7 +446,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
SELECT_DRIVE(drive); SELECT_DRIVE(drive);
msleep(50); 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) { if (drive->dn & 1) {
/* exit with drive0 selected */ /* exit with drive0 selected */
SELECT_DRIVE(&hwif->drives[0]); SELECT_DRIVE(&hwif->drives[0]);
...@@ -1211,7 +1211,7 @@ EXPORT_SYMBOL_GPL(ide_unregister_region); ...@@ -1211,7 +1211,7 @@ EXPORT_SYMBOL_GPL(ide_unregister_region);
void ide_init_disk(struct gendisk *disk, ide_drive_t *drive) void ide_init_disk(struct gendisk *disk, ide_drive_t *drive)
{ {
ide_hwif_t *hwif = drive->hwif; 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->major = hwif->major;
disk->first_minor = unit << PARTN_BITS; disk->first_minor = unit << PARTN_BITS;
......
...@@ -114,7 +114,7 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif) ...@@ -114,7 +114,7 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
memset(drive, 0, sizeof(*drive)); memset(drive, 0, sizeof(*drive));
drive->media = ide_disk; drive->media = ide_disk;
drive->select.all = (unit<<4)|0xa0; drive->select = (unit << 4) | ATA_DEVICE_OBS;
drive->hwif = hwif; drive->hwif = hwif;
drive->ready_stat = ATA_DRDY; drive->ready_stat = ATA_DRDY;
drive->bad_wstat = BAD_W_STAT; drive->bad_wstat = BAD_W_STAT;
......
...@@ -14,7 +14,7 @@ MODULE_PARM_DESC(probe, "probe for generic IDE chipset with 4 drives/port"); ...@@ -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) static void ide_4drives_init_dev(ide_drive_t *drive)
{ {
if (drive->hwif->channel) if (drive->hwif->channel)
drive->select.all ^= 0x20; drive->select ^= 0x20;
} }
static const struct ide_port_ops ide_4drives_port_ops = { static const struct ide_port_ops ide_4drives_port_ops = {
......
...@@ -705,7 +705,7 @@ static void scc_tf_load(ide_drive_t *drive, ide_task_t *task) ...@@ -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); scc_ide_outb(tf->lbah, io_ports->lbah_addr);
if (task->tf_flags & IDE_TFLAG_OUT_DEVICE) 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); io_ports->device_addr);
} }
......
...@@ -278,36 +278,6 @@ typedef union { ...@@ -278,36 +278,6 @@ typedef union {
} b; } b;
} special_t; } 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 * Status returned from various ide_ functions
*/ */
...@@ -529,8 +499,8 @@ struct ide_drive_s { ...@@ -529,8 +499,8 @@ struct ide_drive_s {
unsigned long timeout; /* max time to wait for irq */ unsigned long timeout; /* max time to wait for irq */
special_t special; /* special action flags */ 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 retry_pio; /* retrying dma capable host in pio */
u8 waiting_for_dma; /* dma currently in progress */ u8 waiting_for_dma; /* dma currently in progress */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment