Commit b2e1ca59 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] paride cleanup and fixes (6/25)

Equivalent transformation:
	* new function: do_pd_io_start().  Checks pd_cmd and calls
	  do_pd_read_start() or do_pd_write_start().
	* do_pd_read() and do_pd_write() merged into do_pd_io(), which
	  schedules execution of do_pd_io_start().
parent 9f12c416
......@@ -265,9 +265,9 @@ static int pd_ioctl(struct inode *inode, struct file *file,
static int pd_release(struct inode *inode, struct file *file);
static int pd_revalidate(struct gendisk *p);
static int pd_detect(void);
static void do_pd_read(void);
static void do_pd_io(void);
static void do_pd_io_start(void);
static void do_pd_read_start(void);
static void do_pd_write(void);
static void do_pd_write_start(void);
static void do_pd_read_drq(void);
static void do_pd_write_done(void);
......@@ -762,10 +762,8 @@ static void do_pd_request1(request_queue_t * q)
pd_buf = pd_req->buffer;
pd_retries = 0;
if (pd_cmd == READ)
pi_do_claimed(pd_current->pi, do_pd_read);
else if (pd_cmd == WRITE)
pi_do_claimed(pd_current->pi, do_pd_write);
if (pd_cmd == READ || pd_cmd == WRITE)
pi_do_claimed(pd_current->pi, do_pd_io);
else {
end_request(pd_req, 0);
goto repeat;
......@@ -809,12 +807,21 @@ static inline void next_request(int success)
spin_unlock_irqrestore(&pd_lock, saved_flags);
}
static void do_pd_read(void)
static void do_pd_io(void)
{
ps_continuation = do_pd_read_start;
ps_continuation = do_pd_io_start;
ps_set_intr();
}
static void do_pd_io_start(void)
{
if (pd_cmd == READ) {
do_pd_read_start();
} else {
do_pd_write_start();
}
}
static void do_pd_read_start(void)
{
pi_connect(pd_current->pi);
......@@ -859,12 +866,6 @@ static void do_pd_read_drq(void)
next_request(1);
}
static void do_pd_write(void)
{
ps_continuation = do_pd_write_start;
ps_set_intr();
}
static void do_pd_write_start(void)
{
pi_connect(pd_current->pi);
......
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