diff options
Diffstat (limited to 'drivers/ide/ide-pnp.c')
-rw-r--r-- | drivers/ide/ide-pnp.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c index 89cd5cbe8573..4458ca61897a 100644 --- a/drivers/ide/ide-pnp.c +++ b/drivers/ide/ide-pnp.c | |||
@@ -29,7 +29,7 @@ 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 | ide_hwif_t *hwif; | 32 | struct ide_host *host; |
33 | unsigned long base, ctl; | 33 | unsigned long base, ctl; |
34 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; | 34 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; |
35 | 35 | ||
@@ -59,14 +59,11 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) | |||
59 | hw.irq = pnp_irq(dev, 0); | 59 | hw.irq = pnp_irq(dev, 0); |
60 | hw.chipset = ide_generic; | 60 | hw.chipset = ide_generic; |
61 | 61 | ||
62 | hwif = ide_find_port(); | 62 | host = ide_host_alloc(NULL, hws); |
63 | if (hwif) { | 63 | if (host) { |
64 | u8 index = hwif->index; | 64 | pnp_set_drvdata(dev, host); |
65 | u8 idx[4] = { index, 0xff, 0xff, 0xff }; | ||
66 | 65 | ||
67 | pnp_set_drvdata(dev, hwif); | 66 | ide_host_register(host, NULL, hws); |
68 | |||
69 | ide_device_add(idx, NULL, hws); | ||
70 | 67 | ||
71 | return 0; | 68 | return 0; |
72 | } | 69 | } |
@@ -79,9 +76,9 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) | |||
79 | 76 | ||
80 | static void idepnp_remove(struct pnp_dev *dev) | 77 | static void idepnp_remove(struct pnp_dev *dev) |
81 | { | 78 | { |
82 | ide_hwif_t *hwif = pnp_get_drvdata(dev); | 79 | struct ide_host *host = pnp_get_drvdata(dev); |
83 | 80 | ||
84 | ide_unregister(hwif); | 81 | ide_host_remove(host); |
85 | 82 | ||
86 | release_region(pnp_port_start(dev, 1), 1); | 83 | release_region(pnp_port_start(dev, 1), 1); |
87 | release_region(pnp_port_start(dev, 0), 8); | 84 | release_region(pnp_port_start(dev, 0), 8); |