diff options
author | Tejun Heo <tj@kernel.org> | 2009-05-07 09:24:39 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-05-11 03:50:54 -0400 |
commit | 83096ebf1263b2c1ee5e653ba37d993d02e3eb7b (patch) | |
tree | 2226b71a616ec1cb2d37511c6a09ba9507a1cd69 /drivers/mmc/card/block.c | |
parent | 5b93629b4509c03ffa87a9316412fedf6f58cb37 (diff) |
block: convert to pos and nr_sectors accessors
With recent cleanups, there is no place where low level driver
directly manipulates request fields. This means that the 'hard'
request fields always equal the !hard fields. Convert all
rq->sectors, nr_sectors and current_nr_sectors references to
accessors.
While at it, drop superflous blk_rq_pos() < 0 test in swim.c.
[ Impact: use pos and nr_sectors accessors ]
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Tested-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Acked-by: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Acked-by: Mike Miller <mike.miller@hp.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Borislav Petkov <petkovbb@googlemail.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Eric Moore <Eric.Moore@lsi.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Paul Clements <paul.clements@steeleye.com>
Cc: Tim Waugh <tim@cyberelk.net>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Dario Ballabio <ballabio_dario@emc.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: unsik Kim <donari75@gmail.com>
Cc: Laurent Vivier <Laurent@lvivier.info>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/mmc/card/block.c')
-rw-r--r-- | drivers/mmc/card/block.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index fe8041e619ea..949e99770ad6 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -243,7 +243,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
243 | brq.mrq.cmd = &brq.cmd; | 243 | brq.mrq.cmd = &brq.cmd; |
244 | brq.mrq.data = &brq.data; | 244 | brq.mrq.data = &brq.data; |
245 | 245 | ||
246 | brq.cmd.arg = req->sector; | 246 | brq.cmd.arg = blk_rq_pos(req); |
247 | if (!mmc_card_blockaddr(card)) | 247 | if (!mmc_card_blockaddr(card)) |
248 | brq.cmd.arg <<= 9; | 248 | brq.cmd.arg <<= 9; |
249 | brq.cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC; | 249 | brq.cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC; |
@@ -251,7 +251,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
251 | brq.stop.opcode = MMC_STOP_TRANSMISSION; | 251 | brq.stop.opcode = MMC_STOP_TRANSMISSION; |
252 | brq.stop.arg = 0; | 252 | brq.stop.arg = 0; |
253 | brq.stop.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC; | 253 | brq.stop.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC; |
254 | brq.data.blocks = req->nr_sectors; | 254 | brq.data.blocks = blk_rq_sectors(req); |
255 | 255 | ||
256 | /* | 256 | /* |
257 | * After a read error, we redo the request one sector at a time | 257 | * After a read error, we redo the request one sector at a time |
@@ -293,7 +293,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
293 | * Adjust the sg list so it is the same size as the | 293 | * Adjust the sg list so it is the same size as the |
294 | * request. | 294 | * request. |
295 | */ | 295 | */ |
296 | if (brq.data.blocks != req->nr_sectors) { | 296 | if (brq.data.blocks != blk_rq_sectors(req)) { |
297 | int i, data_size = brq.data.blocks << 9; | 297 | int i, data_size = brq.data.blocks << 9; |
298 | struct scatterlist *sg; | 298 | struct scatterlist *sg; |
299 | 299 | ||
@@ -344,8 +344,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
344 | printk(KERN_ERR "%s: error %d transferring data," | 344 | printk(KERN_ERR "%s: error %d transferring data," |
345 | " sector %u, nr %u, card status %#x\n", | 345 | " sector %u, nr %u, card status %#x\n", |
346 | req->rq_disk->disk_name, brq.data.error, | 346 | req->rq_disk->disk_name, brq.data.error, |
347 | (unsigned)req->sector, | 347 | (unsigned)blk_rq_pos(req), |
348 | (unsigned)req->nr_sectors, status); | 348 | (unsigned)blk_rq_sectors(req), status); |
349 | } | 349 | } |
350 | 350 | ||
351 | if (brq.stop.error) { | 351 | if (brq.stop.error) { |