diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-05 20:57:50 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-05 20:57:50 -0500 |
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 fc29ce75aff1..9d3851d27677 100644 --- a/drivers/ide/legacy/gayle.c +++ b/drivers/ide/legacy/gayle.c | |||
@@ -34,22 +34,8 @@ | |||
34 | * Offsets from one of the above bases | 34 | * Offsets from one of the above bases |
35 | */ | 35 | */ |
36 | 36 | ||
37 | #define GAYLE_DATA 0x00 | ||
38 | #define GAYLE_ERROR 0x06 /* see err-bits */ | ||
39 | #define GAYLE_NSECTOR 0x0a /* nr of sectors to read/write */ | ||
40 | #define GAYLE_SECTOR 0x0e /* starting sector */ | ||
41 | #define GAYLE_LCYL 0x12 /* starting cylinder */ | ||
42 | #define GAYLE_HCYL 0x16 /* high byte of starting cyl */ | ||
43 | #define GAYLE_SELECT 0x1a /* 101dhhhh , d=drive, hhhh=head */ | ||
44 | #define GAYLE_STATUS 0x1e /* see status-bits */ | ||
45 | #define GAYLE_CONTROL 0x101a | 37 | #define GAYLE_CONTROL 0x101a |
46 | 38 | ||
47 | static int gayle_offsets[IDE_NR_PORTS] __initdata = { | ||
48 | GAYLE_DATA, GAYLE_ERROR, GAYLE_NSECTOR, GAYLE_SECTOR, GAYLE_LCYL, | ||
49 | GAYLE_HCYL, GAYLE_SELECT, GAYLE_STATUS, -1, -1 | ||
50 | }; | ||
51 | |||
52 | |||
53 | /* | 39 | /* |
54 | * These are at different offsets from the base | 40 | * These are at different offsets from the base |
55 | */ | 41 | */ |
@@ -106,6 +92,26 @@ static int gayle_ack_intr_a1200(ide_hwif_t *hwif) | |||
106 | return 1; | 92 | return 1; |
107 | } | 93 | } |
108 | 94 | ||
95 | static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base, | ||
96 | unsigned long ctl, unsigned long irq_port, | ||
97 | ide_ack_intr_t *ack_intr); | ||
98 | { | ||
99 | int i; | ||
100 | |||
101 | memset(hw, 0, sizeof(*hw)); | ||
102 | |||
103 | hw->io_ports[IDE_DATA_OFFSET] = base; | ||
104 | |||
105 | for (i = 1; i < 8; i++) | ||
106 | hw->io_ports[i] = base + 2 + i * 4; | ||
107 | |||
108 | hw->io_ports[IDE_CONTROL_OFFSET] = ctl; | ||
109 | hw->io_ports[IDE_IRQ_OFFSET] = irq_port; | ||
110 | |||
111 | hw->irq = IRQ_AMIGA_PORTS; | ||
112 | hw->ack_intr = ack_intr; | ||
113 | } | ||
114 | |||
109 | /* | 115 | /* |
110 | * Probe for a Gayle IDE interface (and optionally for an IDE doubler) | 116 | * Probe for a Gayle IDE interface (and optionally for an IDE doubler) |
111 | */ | 117 | */ |
@@ -167,10 +173,7 @@ found: | |||
167 | base = (unsigned long)ZTWO_VADDR(phys_base); | 173 | base = (unsigned long)ZTWO_VADDR(phys_base); |
168 | ctrlport = GAYLE_HAS_CONTROL_REG ? (base + GAYLE_CONTROL) : 0; | 174 | ctrlport = GAYLE_HAS_CONTROL_REG ? (base + GAYLE_CONTROL) : 0; |
169 | 175 | ||
170 | ide_setup_ports(&hw, base, gayle_offsets, | 176 | gayle_setup_ports(&hw, base, ctrlport, irqport, ack_intr); |
171 | ctrlport, irqport, ack_intr, | ||
172 | // &gayle_iops, | ||
173 | IRQ_AMIGA_PORTS); | ||
174 | 177 | ||
175 | hwif = ide_find_port(base); | 178 | hwif = ide_find_port(base); |
176 | if (hwif) { | 179 | if (hwif) { |