diff options
Diffstat (limited to 'drivers/ide/legacy/ide-4drives.c')
-rw-r--r-- | drivers/ide/legacy/ide-4drives.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/ide/legacy/ide-4drives.c b/drivers/ide/legacy/ide-4drives.c index c352f12348af..17f94d0cb539 100644 --- a/drivers/ide/legacy/ide-4drives.c +++ b/drivers/ide/legacy/ide-4drives.c | |||
@@ -4,6 +4,8 @@ | |||
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <linux/ide.h> | 5 | #include <linux/ide.h> |
6 | 6 | ||
7 | #define DRV_NAME "ide-4drives" | ||
8 | |||
7 | int probe_4drives; | 9 | int probe_4drives; |
8 | 10 | ||
9 | module_param_named(probe, probe_4drives, bool, 0); | 11 | module_param_named(probe, probe_4drives, bool, 0); |
@@ -12,15 +14,29 @@ MODULE_PARM_DESC(probe, "probe for generic IDE chipset with 4 drives/port"); | |||
12 | static int __init ide_4drives_init(void) | 14 | static int __init ide_4drives_init(void) |
13 | { | 15 | { |
14 | ide_hwif_t *hwif, *mate; | 16 | ide_hwif_t *hwif, *mate; |
17 | unsigned long base = 0x1f0, ctl = 0x3f6; | ||
15 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 18 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
16 | hw_regs_t hw; | 19 | hw_regs_t hw; |
17 | 20 | ||
18 | if (probe_4drives == 0) | 21 | if (probe_4drives == 0) |
19 | return -ENODEV; | 22 | return -ENODEV; |
20 | 23 | ||
24 | if (!request_region(base, 8, DRV_NAME)) { | ||
25 | printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n", | ||
26 | DRV_NAME, base, base + 7); | ||
27 | return -EBUSY; | ||
28 | } | ||
29 | |||
30 | if (!request_region(ctl, 1, DRV_NAME)) { | ||
31 | printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n", | ||
32 | DRV_NAME, ctl); | ||
33 | release_region(base, 8); | ||
34 | return -EBUSY; | ||
35 | } | ||
36 | |||
21 | memset(&hw, 0, sizeof(hw)); | 37 | memset(&hw, 0, sizeof(hw)); |
22 | 38 | ||
23 | ide_std_init_ports(&hw, 0x1f0, 0x3f6); | 39 | ide_std_init_ports(&hw, base, ctl); |
24 | hw.irq = 14; | 40 | hw.irq = 14; |
25 | hw.chipset = ide_4drives; | 41 | hw.chipset = ide_4drives; |
26 | 42 | ||