diff options
Diffstat (limited to 'drivers/ide/ide-pnp.c')
-rw-r--r-- | drivers/ide/ide-pnp.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c index e245521af7b5..cbbb0f75be92 100644 --- a/drivers/ide/ide-pnp.c +++ b/drivers/ide/ide-pnp.c | |||
@@ -31,7 +31,6 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id | |||
31 | { | 31 | { |
32 | hw_regs_t hw; | 32 | hw_regs_t hw; |
33 | ide_hwif_t *hwif; | 33 | ide_hwif_t *hwif; |
34 | int index; | ||
35 | 34 | ||
36 | if (!(pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) && pnp_irq_valid(dev, 0))) | 35 | if (!(pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) && pnp_irq_valid(dev, 0))) |
37 | return -1; | 36 | return -1; |
@@ -41,11 +40,19 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id | |||
41 | pnp_port_start(dev, 1)); | 40 | pnp_port_start(dev, 1)); |
42 | hw.irq = pnp_irq(dev, 0); | 41 | hw.irq = pnp_irq(dev, 0); |
43 | 42 | ||
44 | index = ide_register_hw(&hw, NULL, 1, &hwif); | 43 | hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); |
44 | if (hwif) { | ||
45 | u8 index = hwif->index; | ||
46 | u8 idx[4] = { index, 0xff, 0xff, 0xff }; | ||
47 | |||
48 | ide_init_port_data(hwif, index); | ||
49 | ide_init_port_hw(hwif, &hw); | ||
45 | 50 | ||
46 | if (index != -1) { | 51 | printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index); |
47 | printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index); | ||
48 | pnp_set_drvdata(dev,hwif); | 52 | pnp_set_drvdata(dev,hwif); |
53 | |||
54 | ide_device_add(idx); | ||
55 | |||
49 | return 0; | 56 | return 0; |
50 | } | 57 | } |
51 | 58 | ||
@@ -68,12 +75,15 @@ static struct pnp_driver idepnp_driver = { | |||
68 | .remove = idepnp_remove, | 75 | .remove = idepnp_remove, |
69 | }; | 76 | }; |
70 | 77 | ||
71 | void __init pnpide_init(void) | 78 | static int __init pnpide_init(void) |
72 | { | 79 | { |
73 | pnp_register_driver(&idepnp_driver); | 80 | return pnp_register_driver(&idepnp_driver); |
74 | } | 81 | } |
75 | 82 | ||
76 | void __exit pnpide_exit(void) | 83 | static void __exit pnpide_exit(void) |
77 | { | 84 | { |
78 | pnp_unregister_driver(&idepnp_driver); | 85 | pnp_unregister_driver(&idepnp_driver); |
79 | } | 86 | } |
87 | |||
88 | module_init(pnpide_init); | ||
89 | module_exit(pnpide_exit); | ||