aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/falconide.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-05 20:57:50 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-05 20:57:50 -0500
commit29dd59755a849cc6475faa6a75f3b804e23a6fc2 (patch)
tree007f73aed935c22438e69cb2d2438b93f249d955 /drivers/ide/legacy/falconide.c
parentf2694b7e3bad75436b47b6840de352f7b7f53feb (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.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c
index 85b69a82825f..f044048903b3 100644
--- a/drivers/ide/legacy/falconide.c
+++ b/drivers/ide/legacy/falconide.c
@@ -33,22 +33,8 @@
33 * Offsets from the above base 33 * Offsets from the above base
34 */ 34 */
35 35
36#define ATA_HD_DATA 0x00
37#define ATA_HD_ERROR 0x05 /* see err-bits */
38#define ATA_HD_NSECTOR 0x09 /* nr of sectors to read/write */
39#define ATA_HD_SECTOR 0x0d /* starting sector */
40#define ATA_HD_LCYL 0x11 /* starting cylinder */
41#define ATA_HD_HCYL 0x15 /* high byte of starting cyl */
42#define ATA_HD_SELECT 0x19 /* 101dhhhh , d=drive, hhhh=head */
43#define ATA_HD_STATUS 0x1d /* see status-bits */
44#define ATA_HD_CONTROL 0x39 36#define ATA_HD_CONTROL 0x39
45 37
46static int falconide_offsets[IDE_NR_PORTS] __initdata = {
47 ATA_HD_DATA, ATA_HD_ERROR, ATA_HD_NSECTOR, ATA_HD_SECTOR, ATA_HD_LCYL,
48 ATA_HD_HCYL, ATA_HD_SELECT, ATA_HD_STATUS, ATA_HD_CONTROL, -1
49};
50
51
52 /* 38 /*
53 * falconide_intr_lock is used to obtain access to the IDE interrupt, 39 * falconide_intr_lock is used to obtain access to the IDE interrupt,
54 * which is shared between several drivers. 40 * which is shared between several drivers.
@@ -57,6 +43,22 @@ static int falconide_offsets[IDE_NR_PORTS] __initdata = {
57int falconide_intr_lock; 43int falconide_intr_lock;
58EXPORT_SYMBOL(falconide_intr_lock); 44EXPORT_SYMBOL(falconide_intr_lock);
59 45
46static void __init falconide_setup_ports(hw_regs_t *hw)
47{
48 int i;
49
50 memset(hw, 0, sizeof(*hw));
51
52 hw->io_ports[IDE_DATA_OFFSET] = ATA_HD_BASE;
53
54 for (i = 1; i < 8; i++)
55 hw->io_ports[i] = ATA_HD_BASE + 1 + i * 4;
56
57 hw->io_ports[IDE_CONTROL_OFFSET] = ATA_HD_CONTROL;
58
59 hw->irq = IRQ_MFP_IDE;
60 hw->ack_intr = NULL;
61}
60 62
61 /* 63 /*
62 * Probe for a Falcon IDE interface 64 * Probe for a Falcon IDE interface
@@ -64,16 +66,15 @@ EXPORT_SYMBOL(falconide_intr_lock);
64 66
65static int __init falconide_init(void) 67static int __init falconide_init(void)
66{ 68{
67 if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) {
68 hw_regs_t hw; 69 hw_regs_t hw;
69 ide_hwif_t *hwif; 70 ide_hwif_t *hwif;
70 71
72 if (!MACH_IS_ATARI || !ATARIHW_PRESENT(IDE))
73 return 0;
74
71 printk(KERN_INFO "ide: Falcon IDE controller\n"); 75 printk(KERN_INFO "ide: Falcon IDE controller\n");
72 76
73 ide_setup_ports(&hw, ATA_HD_BASE, falconide_offsets, 77 falconide_setup_ports(&hw);
74 0, 0, NULL,
75// falconide_iops,
76 IRQ_MFP_IDE);
77 78
78 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 79 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
79 if (hwif) { 80 if (hwif) {
@@ -85,9 +86,8 @@ static int __init falconide_init(void)
85 86
86 ide_device_add(idx, NULL); 87 ide_device_add(idx, NULL);
87 } 88 }
88 }
89 89
90 return 0; 90 return 0;
91} 91}
92 92
93module_init(falconide_init); 93module_init(falconide_init);