ide: move drive_is_ready() to ide-io.c
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 24 Mar 2009 22:22:43 +0000 (23:22 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 24 Mar 2009 22:22:43 +0000 (23:22 +0100)
Move drive_is_ready() to ide-io.c, then make it static.

Also make some minor CodingStyle fixups while at it.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
include/linux/ide.h

index d90cf5d0814246e8518da9670bdfce8bb0c722fb..835cf646bb07b465d4c0f3559ec0a63c513ec7c4 100644 (file)
@@ -887,6 +887,29 @@ static void ide_plug_device(ide_drive_t *drive)
        spin_unlock_irqrestore(q->queue_lock, flags);
 }
 
+static int drive_is_ready(ide_drive_t *drive)
+{
+       ide_hwif_t *hwif = drive->hwif;
+       u8 stat = 0;
+
+       if (drive->waiting_for_dma)
+               return hwif->dma_ops->dma_test_irq(drive);
+
+       if (hwif->io_ports.ctl_addr &&
+           (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0)
+               stat = hwif->tp_ops->read_altstatus(hwif);
+       else
+               /* Note: this may clear a pending IRQ!! */
+               stat = hwif->tp_ops->read_status(hwif);
+
+       if (stat & ATA_BUSY)
+               /* drive busy: definitely not interrupting */
+               return 0;
+
+       /* drive ready: *might* be interrupting */
+       return 1;
+}
+
 /**
  *     ide_timer_expiry        -       handle lack of an IDE interrupt
  *     @data: timer callback magic (hwif)
index cd1f2e464c4b00a96dc8508040b6484c9fa4210d..ee9c603427876e5376e38f12f1f4cf745549f07b 100644 (file)
@@ -438,31 +438,6 @@ void ide_fixstring (u8 *s, const int bytecount, const int byteswap)
 
 EXPORT_SYMBOL(ide_fixstring);
 
-int drive_is_ready (ide_drive_t *drive)
-{
-       ide_hwif_t *hwif        = drive->hwif;
-       u8 stat                 = 0;
-
-       if (drive->waiting_for_dma)
-               return hwif->dma_ops->dma_test_irq(drive);
-
-       if (hwif->io_ports.ctl_addr &&
-           (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0)
-               stat = hwif->tp_ops->read_altstatus(hwif);
-       else
-               /* Note: this may clear a pending IRQ!! */
-               stat = hwif->tp_ops->read_status(hwif);
-
-       if (stat & ATA_BUSY)
-               /* drive busy:  definitely not interrupting */
-               return 0;
-
-       /* drive ready: *might* be interrupting */
-       return 1;
-}
-
-EXPORT_SYMBOL(drive_is_ready);
-
 /*
  * This routine busy-waits for the drive status to be not "busy".
  * It then checks the status for all of the "good" bits and none
index 6bb104f4e3415e9465def2672cac93dfc1a41031..2e95adeedff48e6f2a8c3d33d36fd0ebc302deb9 100644 (file)
@@ -1200,8 +1200,6 @@ void SELECT_MASK(ide_drive_t *, int);
 u8 ide_read_error(ide_drive_t *);
 void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *);
 
-extern int drive_is_ready(ide_drive_t *);
-
 int ide_check_atapi_device(ide_drive_t *, const char *);
 
 void ide_init_pc(struct ide_atapi_pc *);