aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/delkin_cb.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-06-10 14:56:37 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-06-10 14:56:37 -0400
commit1c4d4ad50ac5cc74c605c4a467db42c961ec7a69 (patch)
treefd6c6d0189238750065501eae807243487f5df1a /drivers/ide/pci/delkin_cb.c
parent8a7dbb9761d59996e4a037c969eabd8e93f3be1c (diff)
delkin_cb: use struct ide_port_info
Convert the driver to use struct ide_port_info - as a nice side-effect this fixes racy setup of ->io_32bit/unmask settings (after ide_device_add() call device can be already in use). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/delkin_cb.c')
-rw-r--r--drivers/ide/pci/delkin_cb.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c
index 5cf59333ef33..1b69e4dd5522 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
50static 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
50static int __devinit 56static int __devinit
51delkin_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)
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
@@ -90,22 +95,16 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
90 95
91 ide_init_port_data(hwif, i); 96 ide_init_port_data(hwif, i);
92 ide_init_port_hw(hwif, &hw); 97 ide_init_port_hw(hwif, &hw);
93 hwif->port_ops = &delkin_cb_port_ops;
94 98
95 idx[0] = i; 99 idx[0] = i;
96 100
97 ide_device_add(idx, NULL); 101 ide_device_add(idx, &delkin_cb_port_info);
98 102
99 if (!hwif->present) 103 if (!hwif->present)
100 goto out_disable; 104 goto out_disable;
101 105
102 pci_set_drvdata(dev, hwif); 106 pci_set_drvdata(dev, hwif);
103 107
104 drive = &hwif->drives[0];
105 if (drive->present) {
106 drive->io_32bit = 1;
107 drive->unmask = 1;
108 }
109 return 0; 108 return 0;
110 109
111out_disable: 110out_disable: