ide-tape: factor out DSC handling from idetape_pc_intr()
[deliverable/linux.git] / drivers / ide / ide-tape.c
index 0fec58ebee857dda1267624ec79c99b6a33d5bcb..b224823a8ae7f9f29e46ef9f83c77a37ba6accd0 100644 (file)
@@ -768,6 +768,18 @@ static void idetape_postpone_request(ide_drive_t *drive)
        ide_stall_queue(drive, tape->dsc_poll_freq);
 }
 
+static void ide_tape_handle_dsc(ide_drive_t *drive)
+{
+       idetape_tape_t *tape = drive->driver_data;
+
+       /* Media access command */
+       tape->dsc_polling_start = jiffies;
+       tape->dsc_poll_freq = IDETAPE_DSC_MA_FAST;
+       tape->dsc_timeout = jiffies + IDETAPE_DSC_MA_TIMEOUT;
+       /* Allow ide.c to handle other requests */
+       idetape_postpone_request(drive);
+}
+
 typedef void idetape_io_buf(ide_drive_t *, struct ide_atapi_pc *, unsigned int);
 
 /*
@@ -833,12 +845,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
                pc->error = 0;
                if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) &&
                    (stat & SEEK_STAT) == 0) {
-                       /* Media access command */
-                       tape->dsc_polling_start = jiffies;
-                       tape->dsc_poll_freq = IDETAPE_DSC_MA_FAST;
-                       tape->dsc_timeout = jiffies + IDETAPE_DSC_MA_TIMEOUT;
-                       /* Allow ide.c to handle other requests */
-                       idetape_postpone_request(drive);
+                       ide_tape_handle_dsc(drive);
                        return ide_stopped;
                }
                /* Command finished - Call the callback function */
This page took 0.024329 seconds and 5 git commands to generate.