aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/ht6560b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/legacy/ht6560b.c')
-rw-r--r--drivers/ide/legacy/ht6560b.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index 88fe9070c9c3..60f52f5158c9 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -35,6 +35,7 @@
35 * Try: http://www.maf.iki.fi/~maf/ht6560b/ 35 * Try: http://www.maf.iki.fi/~maf/ht6560b/
36 */ 36 */
37 37
38#define DRV_NAME "ht6560b"
38#define HT6560B_VERSION "v0.08" 39#define HT6560B_VERSION "v0.08"
39 40
40#include <linux/module.h> 41#include <linux/module.h>
@@ -339,16 +340,13 @@ static const struct ide_port_info ht6560b_port_info __initdata = {
339static int __init ht6560b_init(void) 340static int __init ht6560b_init(void)
340{ 341{
341 ide_hwif_t *hwif, *mate; 342 ide_hwif_t *hwif, *mate;
342 static u8 idx[4] = { 0, 1, 0xff, 0xff }; 343 static u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
343 hw_regs_t hw[2]; 344 hw_regs_t hw[2];
344 345
345 if (probe_ht6560b == 0) 346 if (probe_ht6560b == 0)
346 return -ENODEV; 347 return -ENODEV;
347 348
348 hwif = &ide_hwifs[0]; 349 if (!request_region(HT_CONFIG_PORT, 1, DRV_NAME)) {
349 mate = &ide_hwifs[1];
350
351 if (!request_region(HT_CONFIG_PORT, 1, hwif->name)) {
352 printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n", 350 printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n",
353 __FUNCTION__); 351 __FUNCTION__);
354 return -ENODEV; 352 return -ENODEV;
@@ -367,17 +365,23 @@ static int __init ht6560b_init(void)
367 ide_std_init_ports(&hw[1], 0x170, 0x376); 365 ide_std_init_ports(&hw[1], 0x170, 0x376);
368 hw[1].irq = 15; 366 hw[1].irq = 15;
369 367
370 ide_init_port_hw(hwif, &hw[0]); 368 hwif = ide_find_port();
371 ide_init_port_hw(mate, &hw[1]); 369 if (hwif) {
372 370 ide_init_port_hw(hwif, &hw[0]);
373 hwif->selectproc = &ht6560b_selectproc; 371 hwif->selectproc = ht6560b_selectproc;
374 hwif->set_pio_mode = &ht6560b_set_pio_mode; 372 hwif->set_pio_mode = ht6560b_set_pio_mode;
375 373 hwif->port_init_devs = ht6560b_port_init_devs;
376 mate->selectproc = &ht6560b_selectproc; 374 idx[0] = hwif->index;
377 mate->set_pio_mode = &ht6560b_set_pio_mode; 375 }
378 376
379 hwif->port_init_devs = ht6560b_port_init_devs; 377 mate = ide_find_port();
380 mate->port_init_devs = ht6560b_port_init_devs; 378 if (mate) {
379 ide_init_port_hw(mate, &hw[1]);
380 mate->selectproc = ht6560b_selectproc;
381 mate->set_pio_mode = ht6560b_set_pio_mode;
382 mate->port_init_devs = ht6560b_port_init_devs;
383 idx[1] = mate->index;
384 }
381 385
382 ide_device_add(idx, &ht6560b_port_info); 386 ide_device_add(idx, &ht6560b_port_info);
383 387