diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:26 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:26 -0400 |
commit | 23579a2a170265aacf78069f4817a41c1d6e9323 (patch) | |
tree | a20db3f337b64b13e482a2cb2f41e03b13d52e66 /drivers/ide/cris | |
parent | 7616c0ad2087c7d244b8985390c63059a6223c45 (diff) |
ide: remove IDE_*_REG macros
* Add IDE_{ALTSTATUS,IREASON,BCOUNTL,BCOUNTH}_OFFSET defines.
* Remove IDE_*_REG macros - this results in more readable
and slightly smaller code.
There should be no functional changes caused by this patch.
Cc: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/cris')
-rw-r--r-- | drivers/ide/cris/ide-cris.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c index c8ffbaf29a88..31266d278095 100644 --- a/drivers/ide/cris/ide-cris.c +++ b/drivers/ide/cris/ide-cris.c | |||
@@ -228,7 +228,10 @@ cris_ide_fill_descriptor(cris_dma_descr_type *d, void* buf, unsigned int len, in | |||
228 | static void | 228 | static void |
229 | cris_ide_start_dma(ide_drive_t *drive, cris_dma_descr_type *d, int dir,int type,int len) | 229 | cris_ide_start_dma(ide_drive_t *drive, cris_dma_descr_type *d, int dir,int type,int len) |
230 | { | 230 | { |
231 | reg_ata_rw_ctrl2 ctrl2 = REG_TYPE_CONV(reg_ata_rw_ctrl2, int, IDE_DATA_REG); | 231 | ide_hwif_t *hwif = drive->hwif; |
232 | |||
233 | reg_ata_rw_ctrl2 ctrl2 = REG_TYPE_CONV(reg_ata_rw_ctrl2, int, | ||
234 | hwif->io_ports[IDE_DATA_OFFSET]); | ||
232 | reg_ata_rw_trf_cnt trf_cnt = {0}; | 235 | reg_ata_rw_trf_cnt trf_cnt = {0}; |
233 | 236 | ||
234 | mycontext.saved_data = (dma_descr_data*)virt_to_phys(d); | 237 | mycontext.saved_data = (dma_descr_data*)virt_to_phys(d); |
@@ -264,8 +267,12 @@ cris_ide_wait_dma(int dir) | |||
264 | 267 | ||
265 | static int cris_dma_test_irq(ide_drive_t *drive) | 268 | static int cris_dma_test_irq(ide_drive_t *drive) |
266 | { | 269 | { |
270 | ide_hwif_t *hwif = drive->hwif; | ||
267 | int intr = REG_RD_INT(ata, regi_ata, r_intr); | 271 | int intr = REG_RD_INT(ata, regi_ata, r_intr); |
268 | reg_ata_rw_ctrl2 ctrl2 = REG_TYPE_CONV(reg_ata_rw_ctrl2, int, IDE_DATA_REG); | 272 | |
273 | reg_ata_rw_ctrl2 ctrl2 = REG_TYPE_CONV(reg_ata_rw_ctrl2, int, | ||
274 | hwif->io_ports[IDE_DATA_OFFSET]); | ||
275 | |||
269 | return intr & (1 << ctrl2.sel) ? 1 : 0; | 276 | return intr & (1 << ctrl2.sel) ? 1 : 0; |
270 | } | 277 | } |
271 | 278 | ||
@@ -523,7 +530,8 @@ static void cris_ide_start_dma(ide_drive_t *drive, cris_dma_descr_type *d, int d | |||
523 | IO_STATE(R_ATA_CTRL_DATA, handsh, dma); | 530 | IO_STATE(R_ATA_CTRL_DATA, handsh, dma); |
524 | *R_ATA_CTRL_DATA = | 531 | *R_ATA_CTRL_DATA = |
525 | cmd | | 532 | cmd | |
526 | IO_FIELD(R_ATA_CTRL_DATA, data, IDE_DATA_REG) | | 533 | IO_FIELD(R_ATA_CTRL_DATA, data, |
534 | drive->hwif->io_ports[IDE_DATA_OFFSET]) | | ||
527 | IO_STATE(R_ATA_CTRL_DATA, src_dst, dma) | | 535 | IO_STATE(R_ATA_CTRL_DATA, src_dst, dma) | |
528 | IO_STATE(R_ATA_CTRL_DATA, multi, on) | | 536 | IO_STATE(R_ATA_CTRL_DATA, multi, on) | |
529 | IO_STATE(R_ATA_CTRL_DATA, dma_size, word); | 537 | IO_STATE(R_ATA_CTRL_DATA, dma_size, word); |
@@ -541,7 +549,9 @@ cris_ide_wait_dma(int dir) | |||
541 | static int cris_dma_test_irq(ide_drive_t *drive) | 549 | static int cris_dma_test_irq(ide_drive_t *drive) |
542 | { | 550 | { |
543 | int intr = *R_IRQ_MASK0_RD; | 551 | int intr = *R_IRQ_MASK0_RD; |
544 | int bus = IO_EXTRACT(R_ATA_CTRL_DATA, sel, IDE_DATA_REG); | 552 | int bus = IO_EXTRACT(R_ATA_CTRL_DATA, sel, |
553 | drive->hwif->io_ports[IDE_DATA_OFFSET]); | ||
554 | |||
545 | return intr & (1 << (bus + IO_BITNR(R_IRQ_MASK0_RD, ata_irq0))) ? 1 : 0; | 555 | return intr & (1 << (bus + IO_BITNR(R_IRQ_MASK0_RD, ata_irq0))) ? 1 : 0; |
546 | } | 556 | } |
547 | 557 | ||