]> git.neil.brown.name Git - history.git/commitdiff
[ide] fix build for built-in hpt366 and modular ide-disk
authorBartlomiej Zolnierkiewicz <bzolnier@trik.(none)>
Thu, 24 Feb 2005 12:14:08 +0000 (13:14 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@trik.(none)>
Thu, 24 Feb 2005 12:14:08 +0000 (13:14 +0100)
* always call __ide_do_rw_disk() in ide_do_rw_disk()
* modify ide_hwif_t->rw_disk hook accordingly
* update and cleanup hpt372n_rw_disk()
  (the only user of ide_hwif_t->rw_disk hook)
* make __ide_do_rw_disk() static + fix comment

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-disk.c
drivers/ide/pci/hpt366.c
include/linux/ide.h

index 0c7632c7374b06ad15b889896b3904e27f4f3879..db55f241f76ffa6c440c3bdd048b6cfccf153358 100644 (file)
@@ -119,9 +119,8 @@ static int lba_capacity_is_ok (struct hd_driveid *id)
 /*
  * __ide_do_rw_disk() issues READ and WRITE commands to a disk,
  * using LBA if supported, or CHS otherwise, to address sectors.
- * It also takes care of issuing special DRIVE_CMDs.
  */
-ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector_t block)
+static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, sector_t block)
 {
        ide_hwif_t *hwif        = HWIF(drive);
        unsigned int dma        = drive->using_dma;
@@ -256,7 +255,6 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector
                return pre_task_out_intr(drive, rq);
        }
 }
-EXPORT_SYMBOL_GPL(__ide_do_rw_disk);
 
 /*
  * 268435455  == 137439 MB or 28bit limit
@@ -281,9 +279,9 @@ static ide_startstop_t ide_do_rw_disk (ide_drive_t *drive, struct request *rq, s
                 block, rq->nr_sectors, (unsigned long)rq->buffer);
 
        if (hwif->rw_disk)
-               return hwif->rw_disk(drive, rq, block);
-       else
-               return __ide_do_rw_disk(drive, rq, block);
+               hwif->rw_disk(drive, rq);
+
+       return __ide_do_rw_disk(drive, rq, block);
 }
 
 /*
index f3594e458b769b08323e7fd5637d2920c50f56ee..c8ee0b8c0292606b518ad4d3c848d77208df2b95 100644 (file)
@@ -1018,32 +1018,25 @@ static void hpt372n_set_clock(ide_drive_t *drive, int mode)
 }
 
 /**
- *     hpt372n_rw_disk         -       wrapper for I/O
+ *     hpt372n_rw_disk         -       prepare for I/O
  *     @drive: drive for command
  *     @rq: block request structure
- *     @block: block number
- *
- *     This is called when a disk I/O is issued to the 372N instead
- *     of the default functionality. We need it because of the clock
- *     switching
  *
+ *     This is called when a disk I/O is issued to the 372N.
+ *     We need it because of the clock switching.
  */
-static ide_startstop_t hpt372n_rw_disk(ide_drive_t *drive, struct request *rq, sector_t block)
+
+static void hpt372n_rw_disk(ide_drive_t *drive, struct request *rq)
 {
+       ide_hwif_t *hwif = drive->hwif;
        int wantclock;
-       
-       if(rq_data_dir(rq) == READ)
-               wantclock = 0x21;
-       else
-               wantclock = 0x23;
-               
-       if(HWIF(drive)->config_data != wantclock)
-       {
+
+       wantclock = rq_data_dir(rq) ? 0x23 : 0x21;
+
+       if (hwif->config_data != wantclock) {
                hpt372n_set_clock(drive, wantclock);
-               HWIF(drive)->config_data = wantclock;
+               hwif->config_data = wantclock;
        }
-       return __ide_do_rw_disk(drive, rq, block);
 }
 
 /*
index da450b7068f556cd4e522a9cce0c22a7da0e52ba..28f35bc8ba7e33e7043ed23dd9f46beb5e9242a6 100644 (file)
@@ -797,7 +797,7 @@ typedef struct hwif_s {
        struct pci_dev  *pci_dev;       /* for pci chipsets */
        struct ide_pci_device_s *cds;   /* chipset device struct */
 
-       ide_startstop_t (*rw_disk)(ide_drive_t *, struct request *, sector_t);
+       void (*rw_disk)(ide_drive_t *, struct request *);
 
 #if 0
        ide_hwif_ops_t  *hwifops;
@@ -1318,7 +1318,6 @@ extern int set_transfer(ide_drive_t *, ide_task_t *);
 extern int taskfile_lib_get_identify(ide_drive_t *drive, u8 *);
 
 extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout);
-ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, sector_t block);
 
 /*
  * ide_stall_queue() can be used by a drive to give excess bandwidth back