diff options
Diffstat (limited to 'drivers/ide/ide-pnp.c')
-rw-r--r-- | drivers/ide/ide-pnp.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c index 03f2ef5470a3..bac9b392b689 100644 --- a/drivers/ide/ide-pnp.c +++ b/drivers/ide/ide-pnp.c | |||
@@ -29,9 +29,10 @@ static struct pnp_device_id idepnp_devices[] = { | |||
29 | 29 | ||
30 | static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) | 30 | static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) |
31 | { | 31 | { |
32 | hw_regs_t hw; | 32 | struct ide_host *host; |
33 | ide_hwif_t *hwif; | ||
34 | unsigned long base, ctl; | 33 | unsigned long base, ctl; |
34 | int rc; | ||
35 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; | ||
35 | 36 | ||
36 | printk(KERN_INFO DRV_NAME ": generic PnP IDE interface\n"); | 37 | printk(KERN_INFO DRV_NAME ": generic PnP IDE interface\n"); |
37 | 38 | ||
@@ -59,31 +60,25 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) | |||
59 | hw.irq = pnp_irq(dev, 0); | 60 | hw.irq = pnp_irq(dev, 0); |
60 | hw.chipset = ide_generic; | 61 | hw.chipset = ide_generic; |
61 | 62 | ||
62 | hwif = ide_find_port(); | 63 | rc = ide_host_add(NULL, hws, &host); |
63 | if (hwif) { | 64 | if (rc) |
64 | u8 index = hwif->index; | 65 | goto out; |
65 | u8 idx[4] = { index, 0xff, 0xff, 0xff }; | ||
66 | 66 | ||
67 | ide_init_port_hw(hwif, &hw); | 67 | pnp_set_drvdata(dev, host); |
68 | |||
69 | pnp_set_drvdata(dev, hwif); | ||
70 | |||
71 | ide_device_add(idx, NULL); | ||
72 | |||
73 | return 0; | ||
74 | } | ||
75 | 68 | ||
69 | return 0; | ||
70 | out: | ||
76 | release_region(ctl, 1); | 71 | release_region(ctl, 1); |
77 | release_region(base, 8); | 72 | release_region(base, 8); |
78 | 73 | ||
79 | return -1; | 74 | return rc; |
80 | } | 75 | } |
81 | 76 | ||
82 | static void idepnp_remove(struct pnp_dev *dev) | 77 | static void idepnp_remove(struct pnp_dev *dev) |
83 | { | 78 | { |
84 | ide_hwif_t *hwif = pnp_get_drvdata(dev); | 79 | struct ide_host *host = pnp_get_drvdata(dev); |
85 | 80 | ||
86 | ide_unregister(hwif); | 81 | ide_host_remove(host); |
87 | 82 | ||
88 | release_region(pnp_port_start(dev, 1), 1); | 83 | release_region(pnp_port_start(dev, 1), 1); |
89 | release_region(pnp_port_start(dev, 0), 8); | 84 | release_region(pnp_port_start(dev, 0), 8); |