diff options
Diffstat (limited to 'drivers/ide/pci/delkin_cb.c')
-rw-r--r-- | drivers/ide/pci/delkin_cb.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c index b9e457996d0e..af0f30051d5a 100644 --- a/drivers/ide/pci/delkin_cb.c +++ b/drivers/ide/pci/delkin_cb.c | |||
@@ -47,13 +47,18 @@ static const struct ide_port_ops delkin_cb_port_ops = { | |||
47 | .quirkproc = ide_undecoded_slave, | 47 | .quirkproc = ide_undecoded_slave, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static const struct ide_port_info delkin_cb_port_info = { | ||
51 | .port_ops = &delkin_cb_port_ops, | ||
52 | .host_flags = IDE_HFLAG_IO_32BIT | IDE_HFLAG_UNMASK_IRQS | | ||
53 | IDE_HFLAG_NO_DMA, | ||
54 | }; | ||
55 | |||
50 | static int __devinit | 56 | static int __devinit |
51 | delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) | 57 | delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) |
52 | { | 58 | { |
53 | unsigned long base; | 59 | unsigned long base; |
54 | hw_regs_t hw; | 60 | hw_regs_t hw; |
55 | ide_hwif_t *hwif = NULL; | 61 | ide_hwif_t *hwif = NULL; |
56 | ide_drive_t *drive; | ||
57 | int i, rc; | 62 | int i, rc; |
58 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 63 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
59 | 64 | ||
@@ -79,6 +84,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) | |||
79 | memset(&hw, 0, sizeof(hw)); | 84 | memset(&hw, 0, sizeof(hw)); |
80 | ide_std_init_ports(&hw, base + 0x10, base + 0x1e); | 85 | ide_std_init_ports(&hw, base + 0x10, base + 0x1e); |
81 | hw.irq = dev->irq; | 86 | hw.irq = dev->irq; |
87 | hw.dev = &dev->dev; | ||
82 | hw.chipset = ide_pci; /* this enables IRQ sharing */ | 88 | hw.chipset = ide_pci; /* this enables IRQ sharing */ |
83 | 89 | ||
84 | hwif = ide_find_port(); | 90 | hwif = ide_find_port(); |
@@ -89,26 +95,16 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) | |||
89 | 95 | ||
90 | ide_init_port_data(hwif, i); | 96 | ide_init_port_data(hwif, i); |
91 | ide_init_port_hw(hwif, &hw); | 97 | ide_init_port_hw(hwif, &hw); |
92 | hwif->port_ops = &delkin_cb_port_ops; | ||
93 | 98 | ||
94 | idx[0] = i; | 99 | idx[0] = i; |
95 | 100 | ||
96 | ide_device_add(idx, NULL); | 101 | ide_device_add(idx, &delkin_cb_port_info); |
97 | |||
98 | if (!hwif->present) | ||
99 | goto out_disable; | ||
100 | 102 | ||
101 | pci_set_drvdata(dev, hwif); | 103 | pci_set_drvdata(dev, hwif); |
102 | hwif->dev = &dev->dev; | 104 | |
103 | drive = &hwif->drives[0]; | ||
104 | if (drive->present) { | ||
105 | drive->io_32bit = 1; | ||
106 | drive->unmask = 1; | ||
107 | } | ||
108 | return 0; | 105 | return 0; |
109 | 106 | ||
110 | out_disable: | 107 | out_disable: |
111 | printk(KERN_ERR "delkin_cb: no IDE devices found\n"); | ||
112 | pci_release_regions(dev); | 108 | pci_release_regions(dev); |
113 | pci_disable_device(dev); | 109 | pci_disable_device(dev); |
114 | return -ENODEV; | 110 | return -ENODEV; |
@@ -139,14 +135,12 @@ static struct pci_driver driver = { | |||
139 | .remove = delkin_cb_remove, | 135 | .remove = delkin_cb_remove, |
140 | }; | 136 | }; |
141 | 137 | ||
142 | static int | 138 | static int __init delkin_cb_init(void) |
143 | delkin_cb_init (void) | ||
144 | { | 139 | { |
145 | return pci_register_driver(&driver); | 140 | return pci_register_driver(&driver); |
146 | } | 141 | } |
147 | 142 | ||
148 | static void | 143 | static void __exit delkin_cb_exit(void) |
149 | delkin_cb_exit (void) | ||
150 | { | 144 | { |
151 | pci_unregister_driver(&driver); | 145 | pci_unregister_driver(&driver); |
152 | } | 146 | } |