[ide] fix build for built-in hpt366 and modular ide-disk

* 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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 4c048bd9
......@@ -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);
}
/*
......
......@@ -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);
}
/*
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment