aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-18 18:30:08 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-18 18:30:08 -0400
commitdf95f5ab5834a543ddef0e85785e17347cf4c89d (patch)
treedc3b7a742c468ffc18cc58ad051f214cc4c579dd /drivers/ide/pci
parent31e8a465a265886a207427e5652aafb9a591c3fa (diff)
aec62xx: remove ->init_setup
Merge init_setup_{aec62xx,aec6x80}() into aec62xx_init_one(). While at it: * Use id->driver_data instead of dev->device. * Use ATA_UDMA6 define. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci')
-rw-r--r--drivers/ide/pci/aec62xx.c39
1 files changed, 14 insertions, 25 deletions
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index 4906f00cc0c4..3f03acea5987 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -217,28 +217,9 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
217 } 217 }
218} 218}
219 219
220static int __devinit init_setup_aec62xx(struct pci_dev *dev, ide_pci_device_t *d)
221{
222 return ide_setup_pci_device(dev, d);
223}
224
225static int __devinit init_setup_aec6x80(struct pci_dev *dev, ide_pci_device_t *d)
226{
227 unsigned long dma_base = pci_resource_start(dev, 4);
228
229 if (inb(dma_base + 2) & 0x10) {
230 d->name = (dev->device == PCI_DEVICE_ID_ARTOP_ATP865R) ?
231 "AEC6880R" : "AEC6880";
232 d->udma_mask = 0x7f; /* udma0-6 */
233 }
234
235 return ide_setup_pci_device(dev, d);
236}
237
238static ide_pci_device_t aec62xx_chipsets[] __devinitdata = { 220static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
239 { /* 0 */ 221 { /* 0 */
240 .name = "AEC6210", 222 .name = "AEC6210",
241 .init_setup = init_setup_aec62xx,
242 .init_chipset = init_chipset_aec62xx, 223 .init_chipset = init_chipset_aec62xx,
243 .init_hwif = init_hwif_aec62xx, 224 .init_hwif = init_hwif_aec62xx,
244 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, 225 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
@@ -248,7 +229,6 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
248 .udma_mask = ATA_UDMA2, 229 .udma_mask = ATA_UDMA2,
249 },{ /* 1 */ 230 },{ /* 1 */
250 .name = "AEC6260", 231 .name = "AEC6260",
251 .init_setup = init_setup_aec62xx,
252 .init_chipset = init_chipset_aec62xx, 232 .init_chipset = init_chipset_aec62xx,
253 .init_hwif = init_hwif_aec62xx, 233 .init_hwif = init_hwif_aec62xx,
254 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA | 234 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA |
@@ -258,7 +238,6 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
258 .udma_mask = ATA_UDMA4, 238 .udma_mask = ATA_UDMA4,
259 },{ /* 2 */ 239 },{ /* 2 */
260 .name = "AEC6260R", 240 .name = "AEC6260R",
261 .init_setup = init_setup_aec62xx,
262 .init_chipset = init_chipset_aec62xx, 241 .init_chipset = init_chipset_aec62xx,
263 .init_hwif = init_hwif_aec62xx, 242 .init_hwif = init_hwif_aec62xx,
264 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, 243 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
@@ -268,7 +247,6 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
268 .udma_mask = ATA_UDMA4, 247 .udma_mask = ATA_UDMA4,
269 },{ /* 3 */ 248 },{ /* 3 */
270 .name = "AEC6280", 249 .name = "AEC6280",
271 .init_setup = init_setup_aec6x80,
272 .init_chipset = init_chipset_aec62xx, 250 .init_chipset = init_chipset_aec62xx,
273 .init_hwif = init_hwif_aec62xx, 251 .init_hwif = init_hwif_aec62xx,
274 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD, 252 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
@@ -277,7 +255,6 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
277 .udma_mask = ATA_UDMA5, 255 .udma_mask = ATA_UDMA5,
278 },{ /* 4 */ 256 },{ /* 4 */
279 .name = "AEC6280R", 257 .name = "AEC6280R",
280 .init_setup = init_setup_aec6x80,
281 .init_chipset = init_chipset_aec62xx, 258 .init_chipset = init_chipset_aec62xx,
282 .init_hwif = init_hwif_aec62xx, 259 .init_hwif = init_hwif_aec62xx,
283 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, 260 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
@@ -302,9 +279,21 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
302 279
303static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) 280static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
304{ 281{
305 ide_pci_device_t d = aec62xx_chipsets[id->driver_data]; 282 ide_pci_device_t d;
283 u8 idx = id->driver_data;
284
285 d = aec62xx_chipsets[idx];
286
287 if (idx == 3 || idx == 4) {
288 unsigned long dma_base = pci_resource_start(dev, 4);
289
290 if (inb(dma_base + 2) & 0x10) {
291 d.name = (idx == 4) ? "AEC6880R" : "AEC6880";
292 d.udma_mask = ATA_UDMA6;
293 }
294 }
306 295
307 return d.init_setup(dev, &d); 296 return ide_setup_pci_device(dev, &d);
308} 297}
309 298
310static const struct pci_device_id aec62xx_pci_tbl[] = { 299static const struct pci_device_id aec62xx_pci_tbl[] = {