diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-06 02:57:50 +0100 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-06 02:57:50 +0100 |
commit | 29dd59755a849cc6475faa6a75f3b804e23a6fc2 (patch) | |
tree | 007f73aed935c22438e69cb2d2438b93f249d955 /drivers/ide/legacy/falconide.c | |
parent | f2694b7e3bad75436b47b6840de352f7b7f53feb (diff) |
ide: remove ide_setup_ports()
ide-cris.c:
* Add cris_setup_ports() helper and use it instead of ide_setup_ports()
(fixes random value being set in ->io_ports[IDE_IRQ_OFFSET]).
buddha.c:
* Add buddha_setup_ports() helper and use it instead of ide_setup_ports().
falconide.c:
* Add falconide_setup_ports() helper and use it instead of ide_setup_ports(),
also fix return value of falconide_init() while at it.
gayle.c:
* Add gayle_setup_ports() helper and use it instead of ide_setup_ports().
macide.c:
* Add macide_setup_ports() helper and use it instead of ide_setup_ports()
(fixes incorrect value being set in ->io_ports[IDE_IRQ_OFFSET]).
q40ide.c:
* Fix q40_ide_setup_ports() comments.
ide.c:
* Remove no longer needed ide_setup_ports().
Cc: Mikael Starvik <starvik@axis.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/legacy/falconide.c')
-rw-r--r-- | drivers/ide/legacy/falconide.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c index 85b69a82825..f044048903b 100644 --- a/drivers/ide/legacy/falconide.c +++ b/drivers/ide/legacy/falconide.c @@ -33,22 +33,8 @@ * Offsets from the above base */ -#define ATA_HD_DATA 0x00 -#define ATA_HD_ERROR 0x05 /* see err-bits */ -#define ATA_HD_NSECTOR 0x09 /* nr of sectors to read/write */ -#define ATA_HD_SECTOR 0x0d /* starting sector */ -#define ATA_HD_LCYL 0x11 /* starting cylinder */ -#define ATA_HD_HCYL 0x15 /* high byte of starting cyl */ -#define ATA_HD_SELECT 0x19 /* 101dhhhh , d=drive, hhhh=head */ -#define ATA_HD_STATUS 0x1d /* see status-bits */ #define ATA_HD_CONTROL 0x39 -static int falconide_offsets[IDE_NR_PORTS] __initdata = { - ATA_HD_DATA, ATA_HD_ERROR, ATA_HD_NSECTOR, ATA_HD_SECTOR, ATA_HD_LCYL, - ATA_HD_HCYL, ATA_HD_SELECT, ATA_HD_STATUS, ATA_HD_CONTROL, -1 -}; - - /* * falconide_intr_lock is used to obtain access to the IDE interrupt, * which is shared between several drivers. @@ -57,6 +43,22 @@ static int falconide_offsets[IDE_NR_PORTS] __initdata = { int falconide_intr_lock; EXPORT_SYMBOL(falconide_intr_lock); +static void __init falconide_setup_ports(hw_regs_t *hw) +{ + int i; + + memset(hw, 0, sizeof(*hw)); + + hw->io_ports[IDE_DATA_OFFSET] = ATA_HD_BASE; + + for (i = 1; i < 8; i++) + hw->io_ports[i] = ATA_HD_BASE + 1 + i * 4; + + hw->io_ports[IDE_CONTROL_OFFSET] = ATA_HD_CONTROL; + + hw->irq = IRQ_MFP_IDE; + hw->ack_intr = NULL; +} /* * Probe for a Falcon IDE interface @@ -64,16 +66,15 @@ EXPORT_SYMBOL(falconide_intr_lock); static int __init falconide_init(void) { - if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) { hw_regs_t hw; ide_hwif_t *hwif; + if (!MACH_IS_ATARI || !ATARIHW_PRESENT(IDE)) + return 0; + printk(KERN_INFO "ide: Falcon IDE controller\n"); - ide_setup_ports(&hw, ATA_HD_BASE, falconide_offsets, - 0, 0, NULL, -// falconide_iops, - IRQ_MFP_IDE); + falconide_setup_ports(&hw); hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); if (hwif) { @@ -85,9 +86,8 @@ static int __init falconide_init(void) ide_device_add(idx, NULL); } - } - return 0; + return 0; } module_init(falconide_init); |