diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:37 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:37 -0400 |
commit | 22aa4b32a19b1f231d4ce7e9af6354b577a22a35 (patch) | |
tree | 3e773e7102e4ea6bb6b4c00edce442c4e8f37edb /drivers/ide/tx4939ide.c | |
parent | e6830a86c260d73c6f370aa7ed17ee6c71e5ee05 (diff) |
ide: remove ide_task_t typedef
While at it:
- rename struct ide_task_s to struct ide_cmd
- remove stale comments from idedisk_{read_native,set}_max_address()
- drop unused 'cmd' argument from ide_{cmd,task}_ioctl()
- drop unused 'task' argument from tx4939ide_tf_load_fixup()
- rename ide_complete_task() to ide_complete_cmd()
- use consistent naming for struct ide_cmd variables
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/tx4939ide.c')
-rw-r--r-- | drivers/ide/tx4939ide.c | 75 |
1 files changed, 38 insertions, 37 deletions
diff --git a/drivers/ide/tx4939ide.c b/drivers/ide/tx4939ide.c index ee86688d8461..bf11791476f0 100644 --- a/drivers/ide/tx4939ide.c +++ b/drivers/ide/tx4939ide.c | |||
@@ -435,7 +435,7 @@ static int tx4939ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d) | |||
435 | return ide_allocate_dma_engine(hwif); | 435 | return ide_allocate_dma_engine(hwif); |
436 | } | 436 | } |
437 | 437 | ||
438 | static void tx4939ide_tf_load_fixup(ide_drive_t *drive, ide_task_t *task) | 438 | static void tx4939ide_tf_load_fixup(ide_drive_t *drive) |
439 | { | 439 | { |
440 | ide_hwif_t *hwif = drive->hwif; | 440 | ide_hwif_t *hwif = drive->hwif; |
441 | void __iomem *base = TX4939IDE_BASE(hwif); | 441 | void __iomem *base = TX4939IDE_BASE(hwif); |
@@ -463,59 +463,59 @@ static void tx4939ide_outb(u8 value, unsigned long port) | |||
463 | __raw_writeb(value, (void __iomem *)port); | 463 | __raw_writeb(value, (void __iomem *)port); |
464 | } | 464 | } |
465 | 465 | ||
466 | static void tx4939ide_tf_load(ide_drive_t *drive, ide_task_t *task) | 466 | static void tx4939ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) |
467 | { | 467 | { |
468 | ide_hwif_t *hwif = drive->hwif; | 468 | ide_hwif_t *hwif = drive->hwif; |
469 | struct ide_io_ports *io_ports = &hwif->io_ports; | 469 | struct ide_io_ports *io_ports = &hwif->io_ports; |
470 | struct ide_taskfile *tf = &task->tf; | 470 | struct ide_taskfile *tf = &cmd->tf; |
471 | u8 HIHI = task->tf_flags & IDE_TFLAG_LBA48 ? 0xE0 : 0xEF; | 471 | u8 HIHI = cmd->tf_flags & IDE_TFLAG_LBA48 ? 0xE0 : 0xEF; |
472 | 472 | ||
473 | if (task->ftf_flags & IDE_FTFLAG_FLAGGED) | 473 | if (cmd->ftf_flags & IDE_FTFLAG_FLAGGED) |
474 | HIHI = 0xFF; | 474 | HIHI = 0xFF; |
475 | 475 | ||
476 | if (task->ftf_flags & IDE_FTFLAG_OUT_DATA) { | 476 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { |
477 | u16 data = (tf->hob_data << 8) | tf->data; | 477 | u16 data = (tf->hob_data << 8) | tf->data; |
478 | 478 | ||
479 | /* no endian swap */ | 479 | /* no endian swap */ |
480 | __raw_writew(data, (void __iomem *)io_ports->data_addr); | 480 | __raw_writew(data, (void __iomem *)io_ports->data_addr); |
481 | } | 481 | } |
482 | 482 | ||
483 | if (task->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) | 483 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) |
484 | tx4939ide_outb(tf->hob_feature, io_ports->feature_addr); | 484 | tx4939ide_outb(tf->hob_feature, io_ports->feature_addr); |
485 | if (task->tf_flags & IDE_TFLAG_OUT_HOB_NSECT) | 485 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_NSECT) |
486 | tx4939ide_outb(tf->hob_nsect, io_ports->nsect_addr); | 486 | tx4939ide_outb(tf->hob_nsect, io_ports->nsect_addr); |
487 | if (task->tf_flags & IDE_TFLAG_OUT_HOB_LBAL) | 487 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_LBAL) |
488 | tx4939ide_outb(tf->hob_lbal, io_ports->lbal_addr); | 488 | tx4939ide_outb(tf->hob_lbal, io_ports->lbal_addr); |
489 | if (task->tf_flags & IDE_TFLAG_OUT_HOB_LBAM) | 489 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_LBAM) |
490 | tx4939ide_outb(tf->hob_lbam, io_ports->lbam_addr); | 490 | tx4939ide_outb(tf->hob_lbam, io_ports->lbam_addr); |
491 | if (task->tf_flags & IDE_TFLAG_OUT_HOB_LBAH) | 491 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_LBAH) |
492 | tx4939ide_outb(tf->hob_lbah, io_ports->lbah_addr); | 492 | tx4939ide_outb(tf->hob_lbah, io_ports->lbah_addr); |
493 | 493 | ||
494 | if (task->tf_flags & IDE_TFLAG_OUT_FEATURE) | 494 | if (cmd->tf_flags & IDE_TFLAG_OUT_FEATURE) |
495 | tx4939ide_outb(tf->feature, io_ports->feature_addr); | 495 | tx4939ide_outb(tf->feature, io_ports->feature_addr); |
496 | if (task->tf_flags & IDE_TFLAG_OUT_NSECT) | 496 | if (cmd->tf_flags & IDE_TFLAG_OUT_NSECT) |
497 | tx4939ide_outb(tf->nsect, io_ports->nsect_addr); | 497 | tx4939ide_outb(tf->nsect, io_ports->nsect_addr); |
498 | if (task->tf_flags & IDE_TFLAG_OUT_LBAL) | 498 | if (cmd->tf_flags & IDE_TFLAG_OUT_LBAL) |
499 | tx4939ide_outb(tf->lbal, io_ports->lbal_addr); | 499 | tx4939ide_outb(tf->lbal, io_ports->lbal_addr); |
500 | if (task->tf_flags & IDE_TFLAG_OUT_LBAM) | 500 | if (cmd->tf_flags & IDE_TFLAG_OUT_LBAM) |
501 | tx4939ide_outb(tf->lbam, io_ports->lbam_addr); | 501 | tx4939ide_outb(tf->lbam, io_ports->lbam_addr); |
502 | if (task->tf_flags & IDE_TFLAG_OUT_LBAH) | 502 | if (cmd->tf_flags & IDE_TFLAG_OUT_LBAH) |
503 | tx4939ide_outb(tf->lbah, io_ports->lbah_addr); | 503 | tx4939ide_outb(tf->lbah, io_ports->lbah_addr); |
504 | 504 | ||
505 | if (task->tf_flags & IDE_TFLAG_OUT_DEVICE) { | 505 | if (cmd->tf_flags & IDE_TFLAG_OUT_DEVICE) { |
506 | tx4939ide_outb((tf->device & HIHI) | drive->select, | 506 | tx4939ide_outb((tf->device & HIHI) | drive->select, |
507 | io_ports->device_addr); | 507 | io_ports->device_addr); |
508 | tx4939ide_tf_load_fixup(drive, task); | 508 | tx4939ide_tf_load_fixup(drive); |
509 | } | 509 | } |
510 | } | 510 | } |
511 | 511 | ||
512 | static void tx4939ide_tf_read(ide_drive_t *drive, ide_task_t *task) | 512 | static void tx4939ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) |
513 | { | 513 | { |
514 | ide_hwif_t *hwif = drive->hwif; | 514 | ide_hwif_t *hwif = drive->hwif; |
515 | struct ide_io_ports *io_ports = &hwif->io_ports; | 515 | struct ide_io_ports *io_ports = &hwif->io_ports; |
516 | struct ide_taskfile *tf = &task->tf; | 516 | struct ide_taskfile *tf = &cmd->tf; |
517 | 517 | ||
518 | if (task->ftf_flags & IDE_FTFLAG_IN_DATA) { | 518 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { |
519 | u16 data; | 519 | u16 data; |
520 | 520 | ||
521 | /* no endian swap */ | 521 | /* no endian swap */ |
@@ -527,32 +527,32 @@ static void tx4939ide_tf_read(ide_drive_t *drive, ide_task_t *task) | |||
527 | /* be sure we're looking at the low order bits */ | 527 | /* be sure we're looking at the low order bits */ |
528 | tx4939ide_outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr); | 528 | tx4939ide_outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr); |
529 | 529 | ||
530 | if (task->tf_flags & IDE_TFLAG_IN_FEATURE) | 530 | if (cmd->tf_flags & IDE_TFLAG_IN_FEATURE) |
531 | tf->feature = tx4939ide_inb(io_ports->feature_addr); | 531 | tf->feature = tx4939ide_inb(io_ports->feature_addr); |
532 | if (task->tf_flags & IDE_TFLAG_IN_NSECT) | 532 | if (cmd->tf_flags & IDE_TFLAG_IN_NSECT) |
533 | tf->nsect = tx4939ide_inb(io_ports->nsect_addr); | 533 | tf->nsect = tx4939ide_inb(io_ports->nsect_addr); |
534 | if (task->tf_flags & IDE_TFLAG_IN_LBAL) | 534 | if (cmd->tf_flags & IDE_TFLAG_IN_LBAL) |
535 | tf->lbal = tx4939ide_inb(io_ports->lbal_addr); | 535 | tf->lbal = tx4939ide_inb(io_ports->lbal_addr); |
536 | if (task->tf_flags & IDE_TFLAG_IN_LBAM) | 536 | if (cmd->tf_flags & IDE_TFLAG_IN_LBAM) |
537 | tf->lbam = tx4939ide_inb(io_ports->lbam_addr); | 537 | tf->lbam = tx4939ide_inb(io_ports->lbam_addr); |
538 | if (task->tf_flags & IDE_TFLAG_IN_LBAH) | 538 | if (cmd->tf_flags & IDE_TFLAG_IN_LBAH) |
539 | tf->lbah = tx4939ide_inb(io_ports->lbah_addr); | 539 | tf->lbah = tx4939ide_inb(io_ports->lbah_addr); |
540 | if (task->tf_flags & IDE_TFLAG_IN_DEVICE) | 540 | if (cmd->tf_flags & IDE_TFLAG_IN_DEVICE) |
541 | tf->device = tx4939ide_inb(io_ports->device_addr); | 541 | tf->device = tx4939ide_inb(io_ports->device_addr); |
542 | 542 | ||
543 | if (task->tf_flags & IDE_TFLAG_LBA48) { | 543 | if (cmd->tf_flags & IDE_TFLAG_LBA48) { |
544 | tx4939ide_outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr); | 544 | tx4939ide_outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr); |
545 | 545 | ||
546 | if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE) | 546 | if (cmd->tf_flags & IDE_TFLAG_IN_HOB_FEATURE) |
547 | tf->hob_feature = | 547 | tf->hob_feature = |
548 | tx4939ide_inb(io_ports->feature_addr); | 548 | tx4939ide_inb(io_ports->feature_addr); |
549 | if (task->tf_flags & IDE_TFLAG_IN_HOB_NSECT) | 549 | if (cmd->tf_flags & IDE_TFLAG_IN_HOB_NSECT) |
550 | tf->hob_nsect = tx4939ide_inb(io_ports->nsect_addr); | 550 | tf->hob_nsect = tx4939ide_inb(io_ports->nsect_addr); |
551 | if (task->tf_flags & IDE_TFLAG_IN_HOB_LBAL) | 551 | if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAL) |
552 | tf->hob_lbal = tx4939ide_inb(io_ports->lbal_addr); | 552 | tf->hob_lbal = tx4939ide_inb(io_ports->lbal_addr); |
553 | if (task->tf_flags & IDE_TFLAG_IN_HOB_LBAM) | 553 | if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAM) |
554 | tf->hob_lbam = tx4939ide_inb(io_ports->lbam_addr); | 554 | tf->hob_lbam = tx4939ide_inb(io_ports->lbam_addr); |
555 | if (task->tf_flags & IDE_TFLAG_IN_HOB_LBAH) | 555 | if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAH) |
556 | tf->hob_lbah = tx4939ide_inb(io_ports->lbah_addr); | 556 | tf->hob_lbah = tx4939ide_inb(io_ports->lbah_addr); |
557 | } | 557 | } |
558 | } | 558 | } |
@@ -599,11 +599,12 @@ static const struct ide_tp_ops tx4939ide_tp_ops = { | |||
599 | 599 | ||
600 | #else /* __LITTLE_ENDIAN */ | 600 | #else /* __LITTLE_ENDIAN */ |
601 | 601 | ||
602 | static void tx4939ide_tf_load(ide_drive_t *drive, ide_task_t *task) | 602 | static void tx4939ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) |
603 | { | 603 | { |
604 | ide_tf_load(drive, task); | 604 | ide_tf_load(drive, cmd); |
605 | if (task->tf_flags & IDE_TFLAG_OUT_DEVICE) | 605 | |
606 | tx4939ide_tf_load_fixup(drive, task); | 606 | if (cmd->tf_flags & IDE_TFLAG_OUT_DEVICE) |
607 | tx4939ide_tf_load_fixup(drive); | ||
607 | } | 608 | } |
608 | 609 | ||
609 | static const struct ide_tp_ops tx4939ide_tp_ops = { | 610 | static const struct ide_tp_ops tx4939ide_tp_ops = { |