diff options
Diffstat (limited to 'drivers/block/paride')
-rw-r--r-- | drivers/block/paride/pd.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index 570f3b70dce7..5fdfa7c888ce 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c | |||
@@ -712,19 +712,17 @@ static void do_pd_request(struct request_queue * q) | |||
712 | static int pd_special_command(struct pd_unit *disk, | 712 | static int pd_special_command(struct pd_unit *disk, |
713 | enum action (*func)(struct pd_unit *disk)) | 713 | enum action (*func)(struct pd_unit *disk)) |
714 | { | 714 | { |
715 | DECLARE_COMPLETION_ONSTACK(wait); | 715 | struct request *rq; |
716 | struct request rq; | ||
717 | int err = 0; | 716 | int err = 0; |
718 | 717 | ||
719 | blk_rq_init(NULL, &rq); | 718 | rq = blk_get_request(disk->gd->queue, READ, __GFP_WAIT); |
720 | rq.rq_disk = disk->gd; | 719 | |
721 | rq.end_io_data = &wait; | 720 | rq->cmd_type = REQ_TYPE_SPECIAL; |
722 | rq.end_io = blk_end_sync_rq; | 721 | rq->special = func; |
723 | blk_insert_request(disk->gd->queue, &rq, 0, func); | 722 | |
724 | wait_for_completion(&wait); | 723 | err = blk_execute_rq(disk->gd->queue, disk->gd, rq, 0); |
725 | if (rq.errors) | 724 | |
726 | err = -EIO; | 725 | blk_put_request(rq); |
727 | blk_put_request(&rq); | ||
728 | return err; | 726 | return err; |
729 | } | 727 | } |
730 | 728 | ||