]> err.no Git - linux-2.6/blobdiff - drivers/ide/ide-tape.c
ide-tape: remove superfluous error message from idetape_pc_intr()
[linux-2.6] / drivers / ide / ide-tape.c
index 1e1f26331a24dd2c4aa3bc0028c216cd6f1c2c40..92fadd5a5f8a54decad895885c25b605be1b0ebe 100644 (file)
@@ -538,7 +538,7 @@ static void idetape_analyze_error(ide_drive_t *drive, u8 *sense)
        if (pc->flags & PC_FLAG_DMA_ERROR) {
                pc->xferred = pc->req_xfer -
                        tape->blk_size *
-                       be32_to_cpu(get_unaligned((u32 *)&sense[3]));
+                       get_unaligned_be32(&sense[3]);
                idetape_update_buffers(pc);
        }
 
@@ -688,9 +688,10 @@ static void idetape_queue_pc_head(ide_drive_t *drive, struct ide_atapi_pc *pc,
        struct ide_tape_obj *tape = drive->driver_data;
 
        idetape_init_rq(rq, REQ_IDETAPE_PC1);
+       rq->cmd_flags |= REQ_PREEMPT;
        rq->buffer = (char *) pc;
        rq->rq_disk = tape->disk;
-       (void) ide_do_drive_cmd(drive, rq, ide_preempt);
+       ide_do_drive_cmd(drive, rq);
 }
 
 /*
@@ -793,7 +794,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
                                " transferred\n", pc->xferred);
 
                pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
-               local_irq_enable();
+               local_irq_enable_in_hardirq();
 
 #if SIMULATE_ERRORS
                if ((pc->c[0] == WRITE_6 || pc->c[0] == READ_6) &&
@@ -841,7 +842,6 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
                pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
                printk(KERN_ERR "ide-tape: The tape wants to issue more "
                                "interrupts in DMA mode\n");
-               printk(KERN_ERR "ide-tape: DMA disabled, reverting to PIO\n");
                ide_dma_off(drive);
                return ide_do_reset(drive);
        }
@@ -1045,8 +1045,7 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive,
        if ((pc->flags & PC_FLAG_DMA_RECOMMENDED) && drive->using_dma)
                dma_ok = !hwif->dma_ops->dma_setup(drive);
 
-       ide_pktcmd_tf_load(drive, IDE_TFLAG_NO_SELECT_MASK |
-                          IDE_TFLAG_OUT_DEVICE, bcount, dma_ok);
+       ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_DEVICE, bcount, dma_ok);
 
        if (dma_ok)
                /* Will begin DMA later */
@@ -1518,12 +1517,16 @@ static void idetape_create_test_unit_ready_cmd(struct ide_atapi_pc *pc)
 static int idetape_queue_pc_tail(ide_drive_t *drive, struct ide_atapi_pc *pc)
 {
        struct ide_tape_obj *tape = drive->driver_data;
-       struct request rq;
+       struct request *rq;
+       int error;
 
-       idetape_init_rq(&rq, REQ_IDETAPE_PC1);
-       rq.buffer = (char *) pc;
-       rq.rq_disk = tape->disk;
-       return ide_do_drive_cmd(drive, &rq, ide_wait);
+       rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
+       rq->cmd_type = REQ_TYPE_SPECIAL;
+       rq->cmd[0] = REQ_IDETAPE_PC1;
+       rq->buffer = (char *)pc;
+       error = blk_execute_rq(drive->queue, tape->disk, rq, 0);
+       blk_put_request(rq);
+       return error;
 }
 
 static void idetape_create_load_unload_cmd(ide_drive_t *drive,
@@ -1700,26 +1703,33 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int blocks,
                                 struct idetape_bh *bh)
 {
        idetape_tape_t *tape = drive->driver_data;
-       struct request rq;
+       struct request *rq;
+       int ret, errors;
 
        debug_log(DBG_SENSE, "%s: cmd=%d\n", __func__, cmd);
 
-       idetape_init_rq(&rq, cmd);
-       rq.rq_disk = tape->disk;
-       rq.special = (void *)bh;
-       rq.sector = tape->first_frame;
-       rq.nr_sectors           = blocks;
-       rq.current_nr_sectors   = blocks;
-       (void) ide_do_drive_cmd(drive, &rq, ide_wait);
+       rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
+       rq->cmd_type = REQ_TYPE_SPECIAL;
+       rq->cmd[0] = cmd;
+       rq->rq_disk = tape->disk;
+       rq->special = (void *)bh;
+       rq->sector = tape->first_frame;
+       rq->nr_sectors = blocks;
+       rq->current_nr_sectors = blocks;
+       blk_execute_rq(drive->queue, tape->disk, rq, 0);
+
+       errors = rq->errors;
+       ret = tape->blk_size * (blocks - rq->current_nr_sectors);
+       blk_put_request(rq);
 
        if ((cmd & (REQ_IDETAPE_READ | REQ_IDETAPE_WRITE)) == 0)
                return 0;
 
        if (tape->merge_bh)
                idetape_init_merge_buffer(tape);
-       if (rq.errors == IDETAPE_ERROR_GENERAL)
+       if (errors == IDETAPE_ERROR_GENERAL)
                return -EIO;
-       return (tape->blk_size * (blocks-rq.current_nr_sectors));
+       return ret;
 }
 
 static void idetape_create_inquiry_cmd(struct ide_atapi_pc *pc)
@@ -2746,9 +2756,8 @@ static void idetape_setup(ide_drive_t *drive, idetape_tape_t *tape, int minor)
         * Ensure that the number we got makes sense; limit it within
         * IDETAPE_DSC_RW_MIN and IDETAPE_DSC_RW_MAX.
         */
-       tape->best_dsc_rw_freq = max_t(unsigned long,
-                               min_t(unsigned long, t, IDETAPE_DSC_RW_MAX),
-                               IDETAPE_DSC_RW_MIN);
+       tape->best_dsc_rw_freq = clamp_t(unsigned long, t, IDETAPE_DSC_RW_MIN,
+                                        IDETAPE_DSC_RW_MAX);
        printk(KERN_INFO "ide-tape: %s <-> %s: %dKBps, %d*%dkB buffer, "
                "%lums tDSC%s\n",
                drive->name, tape->name, *(u16 *)&tape->caps[14],