aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/delkin_cb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/delkin_cb.c')
-rw-r--r--drivers/ide/pci/delkin_cb.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c
index 33fe15db408a..5eb9d9325184 100644
--- a/drivers/ide/pci/delkin_cb.c
+++ b/drivers/ide/pci/delkin_cb.c
@@ -56,11 +56,10 @@ static const struct ide_port_info delkin_cb_port_info = {
56static int __devinit 56static int __devinit
57delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) 57delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
58{ 58{
59 struct ide_host *host;
59 unsigned long base; 60 unsigned long base;
60 ide_hwif_t *hwif = NULL;
61 int i, rc; 61 int i, rc;
62 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; 62 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
63 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
64 63
65 rc = pci_enable_device(dev); 64 rc = pci_enable_device(dev);
66 if (rc) { 65 if (rc) {
@@ -87,17 +86,13 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
87 hw.dev = &dev->dev; 86 hw.dev = &dev->dev;
88 hw.chipset = ide_pci; /* this enables IRQ sharing */ 87 hw.chipset = ide_pci; /* this enables IRQ sharing */
89 88
90 hwif = ide_find_port(); 89 host = ide_host_alloc(&delkin_cb_port_info, hws);
91 if (hwif == NULL) 90 if (host == NULL)
92 goto out_disable; 91 goto out_disable;
93 92
94 i = hwif->index; 93 ide_host_register(host, &delkin_cb_port_info, hws);
95 94
96 idx[0] = i; 95 pci_set_drvdata(dev, host);
97
98 ide_device_add(idx, &delkin_cb_port_info, hws);
99
100 pci_set_drvdata(dev, hwif);
101 96
102 return 0; 97 return 0;
103 98
@@ -110,9 +105,9 @@ out_disable:
110static void 105static void
111delkin_cb_remove (struct pci_dev *dev) 106delkin_cb_remove (struct pci_dev *dev)
112{ 107{
113 ide_hwif_t *hwif = pci_get_drvdata(dev); 108 struct ide_host *host = pci_get_drvdata(dev);
114 109
115 ide_unregister(hwif); 110 ide_host_remove(host);
116 111
117 pci_release_regions(dev); 112 pci_release_regions(dev);
118 pci_disable_device(dev); 113 pci_disable_device(dev);