diff options
author | Jens Axboe <axboe@fb.com> | 2017-02-17 16:08:19 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-02-17 16:08:19 -0500 |
commit | 818551e2b2c662a1b26de6b4f7d6b8411a838d18 (patch) | |
tree | f38b4c951df4d33db81ae7b7765a56bce491c2a8 /drivers/block/paride | |
parent | 6010720da8aab51f33beee63b73cf88016e9b250 (diff) | |
parent | 7520872c0cf4d3df6d74242c6edfb9e70a47df4d (diff) |
Merge branch 'for-4.11/next' into for-4.11/linus-merge
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/paride')
-rw-r--r-- | drivers/block/paride/Kconfig | 1 | ||||
-rw-r--r-- | drivers/block/paride/pd.c | 15 |
2 files changed, 7 insertions, 9 deletions
diff --git a/drivers/block/paride/Kconfig b/drivers/block/paride/Kconfig index efefb5ac3004..3a15247942e4 100644 --- a/drivers/block/paride/Kconfig +++ b/drivers/block/paride/Kconfig | |||
@@ -25,6 +25,7 @@ config PARIDE_PD | |||
25 | config PARIDE_PCD | 25 | config PARIDE_PCD |
26 | tristate "Parallel port ATAPI CD-ROMs" | 26 | tristate "Parallel port ATAPI CD-ROMs" |
27 | depends on PARIDE | 27 | depends on PARIDE |
28 | select BLK_SCSI_REQUEST # only for the generic cdrom code | ||
28 | ---help--- | 29 | ---help--- |
29 | This option enables the high-level driver for ATAPI CD-ROM devices | 30 | This option enables the high-level driver for ATAPI CD-ROM devices |
30 | connected through a parallel port. If you chose to build PARIDE | 31 | connected through a parallel port. If you chose to build PARIDE |
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index c3ed2fc72daa..644ba0888bd4 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c | |||
@@ -439,18 +439,16 @@ static int pd_retries = 0; /* i/o error retry count */ | |||
439 | static int pd_block; /* address of next requested block */ | 439 | static int pd_block; /* address of next requested block */ |
440 | static int pd_count; /* number of blocks still to do */ | 440 | static int pd_count; /* number of blocks still to do */ |
441 | static int pd_run; /* sectors in current cluster */ | 441 | static int pd_run; /* sectors in current cluster */ |
442 | static int pd_cmd; /* current command READ/WRITE */ | ||
443 | static char *pd_buf; /* buffer for request in progress */ | 442 | static char *pd_buf; /* buffer for request in progress */ |
444 | 443 | ||
445 | static enum action do_pd_io_start(void) | 444 | static enum action do_pd_io_start(void) |
446 | { | 445 | { |
447 | if (pd_req->cmd_type == REQ_TYPE_DRV_PRIV) { | 446 | switch (req_op(pd_req)) { |
447 | case REQ_OP_DRV_IN: | ||
448 | phase = pd_special; | 448 | phase = pd_special; |
449 | return pd_special(); | 449 | return pd_special(); |
450 | } | 450 | case REQ_OP_READ: |
451 | 451 | case REQ_OP_WRITE: | |
452 | pd_cmd = rq_data_dir(pd_req); | ||
453 | if (pd_cmd == READ || pd_cmd == WRITE) { | ||
454 | pd_block = blk_rq_pos(pd_req); | 452 | pd_block = blk_rq_pos(pd_req); |
455 | pd_count = blk_rq_cur_sectors(pd_req); | 453 | pd_count = blk_rq_cur_sectors(pd_req); |
456 | if (pd_block + pd_count > get_capacity(pd_req->rq_disk)) | 454 | if (pd_block + pd_count > get_capacity(pd_req->rq_disk)) |
@@ -458,7 +456,7 @@ static enum action do_pd_io_start(void) | |||
458 | pd_run = blk_rq_sectors(pd_req); | 456 | pd_run = blk_rq_sectors(pd_req); |
459 | pd_buf = bio_data(pd_req->bio); | 457 | pd_buf = bio_data(pd_req->bio); |
460 | pd_retries = 0; | 458 | pd_retries = 0; |
461 | if (pd_cmd == READ) | 459 | if (req_op(pd_req) == REQ_OP_READ) |
462 | return do_pd_read_start(); | 460 | return do_pd_read_start(); |
463 | else | 461 | else |
464 | return do_pd_write_start(); | 462 | return do_pd_write_start(); |
@@ -723,11 +721,10 @@ static int pd_special_command(struct pd_unit *disk, | |||
723 | struct request *rq; | 721 | struct request *rq; |
724 | int err = 0; | 722 | int err = 0; |
725 | 723 | ||
726 | rq = blk_get_request(disk->gd->queue, READ, __GFP_RECLAIM); | 724 | rq = blk_get_request(disk->gd->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); |
727 | if (IS_ERR(rq)) | 725 | if (IS_ERR(rq)) |
728 | return PTR_ERR(rq); | 726 | return PTR_ERR(rq); |
729 | 727 | ||
730 | rq->cmd_type = REQ_TYPE_DRV_PRIV; | ||
731 | rq->special = func; | 728 | rq->special = func; |
732 | 729 | ||
733 | err = blk_execute_rq(disk->gd->queue, disk->gd, rq, 0); | 730 | err = blk_execute_rq(disk->gd->queue, disk->gd, rq, 0); |