aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_artop.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_artop.c')
-rw-r--r--drivers/ata/pata_artop.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index ef51940c3adb..9861059dd673 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -414,7 +414,7 @@ static const struct ata_port_operations artop6260_ops = {
414static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id) 414static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
415{ 415{
416 static int printed_version; 416 static int printed_version;
417 static struct ata_port_info info_6210 = { 417 static const struct ata_port_info info_6210 = {
418 .sht = &artop_sht, 418 .sht = &artop_sht,
419 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, 419 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
420 .pio_mask = 0x1f, /* pio0-4 */ 420 .pio_mask = 0x1f, /* pio0-4 */
@@ -422,7 +422,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
422 .udma_mask = ATA_UDMA2, 422 .udma_mask = ATA_UDMA2,
423 .port_ops = &artop6210_ops, 423 .port_ops = &artop6210_ops,
424 }; 424 };
425 static struct ata_port_info info_626x = { 425 static const struct ata_port_info info_626x = {
426 .sht = &artop_sht, 426 .sht = &artop_sht,
427 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, 427 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
428 .pio_mask = 0x1f, /* pio0-4 */ 428 .pio_mask = 0x1f, /* pio0-4 */
@@ -430,7 +430,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
430 .udma_mask = ATA_UDMA4, 430 .udma_mask = ATA_UDMA4,
431 .port_ops = &artop6260_ops, 431 .port_ops = &artop6260_ops,
432 }; 432 };
433 static struct ata_port_info info_626x_fast = { 433 static const struct ata_port_info info_626x_fast = {
434 .sht = &artop_sht, 434 .sht = &artop_sht,
435 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, 435 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
436 .pio_mask = 0x1f, /* pio0-4 */ 436 .pio_mask = 0x1f, /* pio0-4 */
@@ -438,32 +438,30 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
438 .udma_mask = ATA_UDMA5, 438 .udma_mask = ATA_UDMA5,
439 .port_ops = &artop6260_ops, 439 .port_ops = &artop6260_ops,
440 }; 440 };
441 struct ata_port_info *port_info[2]; 441 const struct ata_port_info *ppi[] = { NULL, NULL };
442 struct ata_port_info *info = NULL;
443 int ports = 2;
444 442
445 if (!printed_version++) 443 if (!printed_version++)
446 dev_printk(KERN_DEBUG, &pdev->dev, 444 dev_printk(KERN_DEBUG, &pdev->dev,
447 "version " DRV_VERSION "\n"); 445 "version " DRV_VERSION "\n");
448 446
449 if (id->driver_data == 0) { /* 6210 variant */ 447 if (id->driver_data == 0) { /* 6210 variant */
450 info = &info_6210; 448 ppi[0] = &info_6210;
449 ppi[1] = &ata_dummy_port_info;
451 /* BIOS may have left us in UDMA, clear it before libata probe */ 450 /* BIOS may have left us in UDMA, clear it before libata probe */
452 pci_write_config_byte(pdev, 0x54, 0); 451 pci_write_config_byte(pdev, 0x54, 0);
453 /* For the moment (also lacks dsc) */ 452 /* For the moment (also lacks dsc) */
454 printk(KERN_WARNING "ARTOP 6210 requires serialize functionality not yet supported by libata.\n"); 453 printk(KERN_WARNING "ARTOP 6210 requires serialize functionality not yet supported by libata.\n");
455 printk(KERN_WARNING "Secondary ATA ports will not be activated.\n"); 454 printk(KERN_WARNING "Secondary ATA ports will not be activated.\n");
456 ports = 1;
457 } 455 }
458 else if (id->driver_data == 1) /* 6260 */ 456 else if (id->driver_data == 1) /* 6260 */
459 info = &info_626x; 457 ppi[0] = &info_626x;
460 else if (id->driver_data == 2) { /* 6260 or 6260 + fast */ 458 else if (id->driver_data == 2) { /* 6260 or 6260 + fast */
461 unsigned long io = pci_resource_start(pdev, 4); 459 unsigned long io = pci_resource_start(pdev, 4);
462 u8 reg; 460 u8 reg;
463 461
464 info = &info_626x; 462 ppi[0] = &info_626x;
465 if (inb(io) & 0x10) 463 if (inb(io) & 0x10)
466 info = &info_626x_fast; 464 ppi[0] = &info_626x_fast;
467 /* Mac systems come up with some registers not set as we 465 /* Mac systems come up with some registers not set as we
468 will need them */ 466 will need them */
469 467
@@ -484,10 +482,9 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
484 482
485 } 483 }
486 484
487 BUG_ON(info == NULL); 485 BUG_ON(ppi[0] == NULL);
488 486
489 port_info[0] = port_info[1] = info; 487 return ata_pci_init_one(pdev, ppi);
490 return ata_pci_init_one(pdev, port_info, ports);
491} 488}
492 489
493static const struct pci_device_id artop_pci_tbl[] = { 490static const struct pci_device_id artop_pci_tbl[] = {