aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/swim3.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/swim3.c')
-rw-r--r--drivers/block/swim3.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 424855945b9b..c1b9a4dc11ba 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -312,14 +312,14 @@ static void start_request(struct floppy_state *fs)
312 } 312 }
313 while (fs->state == idle && (req = elv_next_request(swim3_queue))) { 313 while (fs->state == idle && (req = elv_next_request(swim3_queue))) {
314#if 0 314#if 0
315 printk("do_fd_req: dev=%s cmd=%d sec=%ld nr_sec=%ld buf=%p\n", 315 printk("do_fd_req: dev=%s cmd=%d sec=%ld nr_sec=%u buf=%p\n",
316 req->rq_disk->disk_name, req->cmd, 316 req->rq_disk->disk_name, req->cmd,
317 (long)req->sector, req->nr_sectors, req->buffer); 317 (long)blk_rq_pos(req), blk_rq_sectors(req), req->buffer);
318 printk(" errors=%d current_nr_sectors=%ld\n", 318 printk(" errors=%d current_nr_sectors=%u\n",
319 req->errors, req->current_nr_sectors); 319 req->errors, blk_rq_cur_sectors(req));
320#endif 320#endif
321 321
322 if (req->sector >= fs->total_secs) { 322 if (blk_rq_pos(req) >= fs->total_secs) {
323 __blk_end_request_cur(req, -EIO); 323 __blk_end_request_cur(req, -EIO);
324 continue; 324 continue;
325 } 325 }
@@ -337,13 +337,14 @@ static void start_request(struct floppy_state *fs)
337 } 337 }
338 } 338 }
339 339
340 /* Do not remove the cast. req->sector is now a sector_t and 340 /* Do not remove the cast. blk_rq_pos(req) is now a
341 * can be 64 bits, but it will never go past 32 bits for this 341 * sector_t and can be 64 bits, but it will never go
342 * driver anyway, so we can safely cast it down and not have 342 * past 32 bits for this driver anyway, so we can
343 * to do a 64/32 division 343 * safely cast it down and not have to do a 64/32
344 * division
344 */ 345 */
345 fs->req_cyl = ((long)req->sector) / fs->secpercyl; 346 fs->req_cyl = ((long)blk_rq_pos(req)) / fs->secpercyl;
346 x = ((long)req->sector) % fs->secpercyl; 347 x = ((long)blk_rq_pos(req)) % fs->secpercyl;
347 fs->head = x / fs->secpertrack; 348 fs->head = x / fs->secpertrack;
348 fs->req_sector = x % fs->secpertrack + 1; 349 fs->req_sector = x % fs->secpertrack + 1;
349 fd_req = req; 350 fd_req = req;
@@ -420,7 +421,7 @@ static inline void setup_transfer(struct floppy_state *fs)
420 struct dbdma_cmd *cp = fs->dma_cmd; 421 struct dbdma_cmd *cp = fs->dma_cmd;
421 struct dbdma_regs __iomem *dr = fs->dma; 422 struct dbdma_regs __iomem *dr = fs->dma;
422 423
423 if (fd_req->current_nr_sectors <= 0) { 424 if (blk_rq_cur_sectors(fd_req) <= 0) {
424 printk(KERN_ERR "swim3: transfer 0 sectors?\n"); 425 printk(KERN_ERR "swim3: transfer 0 sectors?\n");
425 return; 426 return;
426 } 427 }
@@ -428,8 +429,8 @@ static inline void setup_transfer(struct floppy_state *fs)
428 n = 1; 429 n = 1;
429 else { 430 else {
430 n = fs->secpertrack - fs->req_sector + 1; 431 n = fs->secpertrack - fs->req_sector + 1;
431 if (n > fd_req->current_nr_sectors) 432 if (n > blk_rq_cur_sectors(fd_req))
432 n = fd_req->current_nr_sectors; 433 n = blk_rq_cur_sectors(fd_req);
433 } 434 }
434 fs->scount = n; 435 fs->scount = n;
435 swim3_select(fs, fs->head? READ_DATA_1: READ_DATA_0); 436 swim3_select(fs, fs->head? READ_DATA_1: READ_DATA_0);
@@ -600,7 +601,8 @@ static void xfer_timeout(unsigned long data)
600 out_8(&sw->control_bic, WRITE_SECTORS | DO_ACTION); 601 out_8(&sw->control_bic, WRITE_SECTORS | DO_ACTION);
601 out_8(&sw->select, RELAX); 602 out_8(&sw->select, RELAX);
602 printk(KERN_ERR "swim3: timeout %sing sector %ld\n", 603 printk(KERN_ERR "swim3: timeout %sing sector %ld\n",
603 (rq_data_dir(fd_req)==WRITE? "writ": "read"), (long)fd_req->sector); 604 (rq_data_dir(fd_req)==WRITE? "writ": "read"),
605 (long)blk_rq_pos(fd_req));
604 __blk_end_request_cur(fd_req, -EIO); 606 __blk_end_request_cur(fd_req, -EIO);
605 fs->state = idle; 607 fs->state = idle;
606 start_request(fs); 608 start_request(fs);
@@ -714,7 +716,7 @@ static irqreturn_t swim3_interrupt(int irq, void *dev_id)
714 } else { 716 } else {
715 printk("swim3: error %sing block %ld (err=%x)\n", 717 printk("swim3: error %sing block %ld (err=%x)\n",
716 rq_data_dir(fd_req) == WRITE? "writ": "read", 718 rq_data_dir(fd_req) == WRITE? "writ": "read",
717 (long)fd_req->sector, err); 719 (long)blk_rq_pos(fd_req), err);
718 __blk_end_request_cur(fd_req, -EIO); 720 __blk_end_request_cur(fd_req, -EIO);
719 fs->state = idle; 721 fs->state = idle;
720 } 722 }