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/gayle.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/gayle.c')
-rw-r--r-- | drivers/ide/legacy/gayle.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c index fc29ce75aff..9d3851d2767 100644 --- a/drivers/ide/legacy/gayle.c +++ b/drivers/ide/legacy/gayle.c @@ -34,22 +34,8 @@ * Offsets from one of the above bases */ -#define GAYLE_DATA 0x00 -#define GAYLE_ERROR 0x06 /* see err-bits */ -#define GAYLE_NSECTOR 0x0a /* nr of sectors to read/write */ -#define GAYLE_SECTOR 0x0e /* starting sector */ -#define GAYLE_LCYL 0x12 /* starting cylinder */ -#define GAYLE_HCYL 0x16 /* high byte of starting cyl */ -#define GAYLE_SELECT 0x1a /* 101dhhhh , d=drive, hhhh=head */ -#define GAYLE_STATUS 0x1e /* see status-bits */ #define GAYLE_CONTROL 0x101a -static int gayle_offsets[IDE_NR_PORTS] __initdata = { - GAYLE_DATA, GAYLE_ERROR, GAYLE_NSECTOR, GAYLE_SECTOR, GAYLE_LCYL, - GAYLE_HCYL, GAYLE_SELECT, GAYLE_STATUS, -1, -1 -}; - - /* * These are at different offsets from the base */ @@ -106,6 +92,26 @@ static int gayle_ack_intr_a1200(ide_hwif_t *hwif) return 1; } +static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base, + unsigned long ctl, unsigned long irq_port, + ide_ack_intr_t *ack_intr); +{ + int i; + + memset(hw, 0, sizeof(*hw)); + + hw->io_ports[IDE_DATA_OFFSET] = base; + + for (i = 1; i < 8; i++) + hw->io_ports[i] = base + 2 + i * 4; + + hw->io_ports[IDE_CONTROL_OFFSET] = ctl; + hw->io_ports[IDE_IRQ_OFFSET] = irq_port; + + hw->irq = IRQ_AMIGA_PORTS; + hw->ack_intr = ack_intr; +} + /* * Probe for a Gayle IDE interface (and optionally for an IDE doubler) */ @@ -167,10 +173,7 @@ found: base = (unsigned long)ZTWO_VADDR(phys_base); ctrlport = GAYLE_HAS_CONTROL_REG ? (base + GAYLE_CONTROL) : 0; - ide_setup_ports(&hw, base, gayle_offsets, - ctrlport, irqport, ack_intr, -// &gayle_iops, - IRQ_AMIGA_PORTS); + gayle_setup_ports(&hw, base, ctrlport, irqport, ack_intr); hwif = ide_find_port(base); if (hwif) { |