From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Subject: [PATCH 4/9] ide: convert do_rw_taskfile() to use ->data_phase
Date: Fri, 2 Nov 2007 23:05:27 +0100 [thread overview]
Message-ID: <200711022305.27131.bzolnier@gmail.com> (raw)
* Use task->data_phase in do_rw_taskfile() to decide what to do.
* task->prehandler is only used by TASKFILE[_MULTI]_OUT so just
use pre_task_out_intr() directly and remove no longer needed
'prehandler' field from ide_task_t.
* Remove no longer needed ide_pre_handler_t type.
There should be no functionality changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-taskfile.c | 25 +++++++++++++------------
include/linux/ide.h | 2 --
2 files changed, 13 insertions(+), 14 deletions(-)
Index: b/drivers/ide/ide-taskfile.c
===================================================================
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -170,23 +170,25 @@ ide_startstop_t do_rw_taskfile (ide_driv
ide_tf_load(drive, task);
- if (task->handler != NULL) {
- if (task->prehandler != NULL) {
- hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG);
- ndelay(400); /* FIXME */
- return task->prehandler(drive, task->rq);
- }
+ switch (task->data_phase) {
+ case TASKFILE_MULTI_OUT:
+ case TASKFILE_OUT:
+ hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG);
+ ndelay(400); /* FIXME */
+ return pre_task_out_intr(drive, task->rq);
+ case TASKFILE_MULTI_IN:
+ case TASKFILE_IN:
+ case TASKFILE_NO_DATA:
ide_execute_command(drive, tf->command, task->handler, WAIT_WORSTCASE, NULL);
return ide_started;
- }
-
- if (task_dma_ok(task) && drive->using_dma && !hwif->dma_setup(drive)) {
+ default:
+ if (task_dma_ok(task) == 0 || drive->using_dma == 0 ||
+ hwif->dma_setup(drive))
+ return ide_stopped;
hwif->dma_exec_cmd(drive, tf->command);
hwif->dma_start(drive);
return ide_started;
}
-
- return ide_stopped;
}
/*
@@ -665,7 +667,6 @@ int ide_taskfile_ioctl (ide_drive_t *dri
}
/* fall through */
case TASKFILE_OUT:
- args.prehandler = &pre_task_out_intr;
args.handler = &task_out_intr;
/* fall through */
case TASKFILE_OUT_DMAQ:
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -626,7 +626,6 @@ typedef struct hwif_s {
/*
* internal ide interrupt handler type
*/
-typedef ide_startstop_t (ide_pre_handler_t)(ide_drive_t *, struct request *);
typedef ide_startstop_t (ide_handler_t)(ide_drive_t *);
typedef int (ide_expiry_t)(ide_drive_t *);
@@ -957,7 +956,6 @@ typedef struct ide_task_s {
};
u32 tf_flags;
int data_phase;
- ide_pre_handler_t *prehandler;
ide_handler_t *handler;
struct request *rq; /* copy of request */
void *special; /* valid_t generally */
next reply other threads:[~2007-11-02 22:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-02 22:05 Bartlomiej Zolnierkiewicz [this message]
2007-11-09 17:40 ` [PATCH 4/9] ide: convert do_rw_taskfile() to use ->data_phase Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200711022305.27131.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.