Commit 4ede0350 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] Kill dups of read_24(), rename it to ide_read_24().

 - kill dups in ide.c and ide-disk.c
 - read_24() is exported so rename it to ide_read_24()
 - add it ide.h
parent ce24e848
......@@ -72,14 +72,6 @@
#include "legacy/pdc4030.h"
static inline u32 idedisk_read_24 (ide_drive_t *drive)
{
u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG);
u8 lcyl = HWIF(drive)->INB(IDE_LCYL_REG);
u8 sect = HWIF(drive)->INB(IDE_SECTOR_REG);
return (hcyl<<16)|(lcyl<<8)|sect;
}
/*
* lba_capacity_is_ok() performs a sanity check on the claimed "lba_capacity"
* value for this drive (from its reported identification information).
......@@ -812,9 +804,9 @@ static u8 idedisk_dump_status (ide_drive_t *drive, const char *msg, u8 stat)
if (drive->addressing == 1) {
__u64 sectors = 0;
u32 low = 0, high = 0;
low = idedisk_read_24(drive);
low = ide_read_24(drive);
hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG);
high = idedisk_read_24(drive);
high = ide_read_24(drive);
sectors = ((__u64)high << 24) | low;
printk(", LBAsect=%llu, high=%d, low=%d",
(unsigned long long) sectors,
......
......@@ -263,7 +263,7 @@ void default_hwif_transport (ide_hwif_t *hwif)
EXPORT_SYMBOL(default_hwif_transport);
u32 read_24 (ide_drive_t *drive)
u32 ide_read_24 (ide_drive_t *drive)
{
u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG);
u8 lcyl = HWIF(drive)->INB(IDE_LCYL_REG);
......@@ -271,7 +271,7 @@ u32 read_24 (ide_drive_t *drive)
return (hcyl<<16)|(lcyl<<8)|sect;
}
EXPORT_SYMBOL(read_24);
EXPORT_SYMBOL(ide_read_24);
void SELECT_DRIVE (ide_drive_t *drive)
{
......
......@@ -359,13 +359,6 @@ unsigned long current_capacity (ide_drive_t *drive)
EXPORT_SYMBOL(current_capacity);
static inline u32 read_24 (ide_drive_t *drive)
{
return (HWIF(drive)->INB(IDE_HCYL_REG)<<16) |
(HWIF(drive)->INB(IDE_LCYL_REG)<<8) |
HWIF(drive)->INB(IDE_SECTOR_REG);
}
/*
* Error reporting, in human readable form (luxurious, but a memory hog).
*/
......@@ -412,9 +405,9 @@ u8 ide_dump_status (ide_drive_t *drive, const char *msg, u8 stat)
(drive->addressing == 1)) {
u64 sectors = 0;
u32 high = 0;
u32 low = read_24(drive);
u32 low = ide_read_24(drive);
hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG);
high = read_24(drive);
high = ide_read_24(drive);
sectors = ((u64)high << 24) | low;
printk(", LBAsect=%llu, high=%d, low=%d",
......
......@@ -1408,6 +1408,8 @@ typedef struct pkt_task_s {
void *special;
} pkt_task_t;
extern inline u32 ide_read_24(ide_drive_t *);
extern inline void SELECT_DRIVE(ide_drive_t *);
extern inline void SELECT_INTERRUPT(ide_drive_t *);
extern inline void SELECT_MASK(ide_drive_t *, int);
......
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