]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-disk.c
ide: add ->fixup method to ide_hwif_t
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-disk.c
index eba1adbc1b6a0733137085f67a6933ccb4ebba13..2722d9165b6bee75abfd066536deda80b0ce4707 100644 (file)
@@ -169,7 +169,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
 
        nsectors.all            = (u16) rq->nr_sectors;
 
-       if (hwif->no_lba48_dma && lba48 && dma) {
+       if ((hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA) && lba48 && dma) {
                if (block + rq->nr_sectors > 1ULL << 28)
                        dma = 0;
                else
@@ -487,6 +487,7 @@ static inline int idedisk_supports_lba48(const struct hd_driveid *id)
  */
 static const struct drive_list_entry hpa_list[] = {
        { "ST340823A",  NULL },
+       { "ST320413A",  NULL },
        { NULL,         NULL }
 };
 
@@ -715,32 +716,6 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
        rq->buffer = rq->cmd;
 }
 
-static int idedisk_issue_flush(struct request_queue *q, struct gendisk *disk,
-                              sector_t *error_sector)
-{
-       ide_drive_t *drive = q->queuedata;
-       struct request *rq;
-       int ret;
-
-       if (!drive->wcache)
-               return 0;
-
-       rq = blk_get_request(q, WRITE, __GFP_WAIT);
-
-       idedisk_prepare_flush(q, rq);
-
-       ret = blk_execute_rq(q, disk, rq, 0);
-
-       /*
-        * if we failed and caller wants error offset, get it
-        */
-       if (ret && error_sector)
-               *error_sector = ide_get_error_location(drive, rq->cmd);
-
-       blk_put_request(rq);
-       return ret;
-}
-
 /*
  * This is tightly woven into the driver->do_special can not touch.
  * DON'T do it again until a total personality rewrite is committed.
@@ -780,7 +755,6 @@ static void update_ordered(ide_drive_t *drive)
        struct hd_driveid *id = drive->id;
        unsigned ordered = QUEUE_ORDERED_NONE;
        prepare_flush_fn *prep_fn = NULL;
-       issue_flush_fn *issue_fn = NULL;
 
        if (drive->wcache) {
                unsigned long long capacity;
@@ -804,13 +778,11 @@ static void update_ordered(ide_drive_t *drive)
                if (barrier) {
                        ordered = QUEUE_ORDERED_DRAIN_FLUSH;
                        prep_fn = idedisk_prepare_flush;
-                       issue_fn = idedisk_issue_flush;
                }
        } else
                ordered = QUEUE_ORDERED_DRAIN;
 
        blk_queue_ordered(drive->queue, ordered, prep_fn);
-       blk_queue_issue_flush_fn(drive->queue, issue_fn);
 }
 
 static int write_cache(ide_drive_t *drive, int arg)
@@ -884,7 +856,7 @@ static int set_lba_addressing(ide_drive_t *drive, int arg)
 
        drive->addressing =  0;
 
-       if (HWIF(drive)->no_lba48)
+       if (drive->hwif->host_flags & IDE_HFLAG_NO_LBA48)
                return 0;
 
        if (!idedisk_supports_lba48(drive->id))
@@ -917,6 +889,7 @@ static inline void idedisk_add_settings(ide_drive_t *drive) { ; }
 
 static void idedisk_setup (ide_drive_t *drive)
 {
+       ide_hwif_t *hwif = drive->hwif;
        struct hd_driveid *id = drive->id;
        unsigned long long capacity;
 
@@ -937,7 +910,6 @@ static void idedisk_setup (ide_drive_t *drive)
        (void)set_lba_addressing(drive, 1);
 
        if (drive->addressing == 1) {
-               ide_hwif_t *hwif = HWIF(drive);
                int max_s = 2048;
 
                if (max_s > hwif->rqsize)
@@ -960,7 +932,7 @@ static void idedisk_setup (ide_drive_t *drive)
                drive->capacity64 = 1ULL << 28;
        }
 
-       if (drive->hwif->no_lba48_dma && drive->addressing) {
+       if ((hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA) && drive->addressing) {
                if (drive->capacity64 > 1ULL << 28) {
                        printk(KERN_INFO "%s: cannot use LBA48 DMA - PIO mode will"
                                         " be used for accessing sectors > %u\n",