aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2009-11-24 13:54:49 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-12-03 14:36:17 -0500
commit89d3b3603bfb648e0113d8682d4f84dd18a776bd (patch)
tree6b18d5664317092bb5e757daa21a3ca6536ec3df /drivers/ata
parent82beb5d89456a4c8329676985004b93a7ded5b5a (diff)
ata: use pci_dev->revision
Some places were using PCI_CLASS_REVISION instead of PCI_REVISION_ID, so they weren't converted by commit 44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (PCI: Change all drivers to use pci_device->revision). Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_cmd64x.c9
-rw-r--r--drivers/ata/pata_hpt366.c8
-rw-r--r--drivers/ata/pata_hpt37x.c21
-rw-r--r--drivers/ata/pata_hpt3x2n.c15
-rw-r--r--drivers/ata/pata_sil680.c6
5 files changed, 20 insertions, 39 deletions
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c
index e4d3a1e6b8c7..dadfc358ba1c 100644
--- a/drivers/ata/pata_cmd64x.c
+++ b/drivers/ata/pata_cmd64x.c
@@ -388,8 +388,6 @@ static struct ata_port_operations cmd648_port_ops = {
388 388
389static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 389static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
390{ 390{
391 u32 class_rev;
392
393 static const struct ata_port_info cmd_info[6] = { 391 static const struct ata_port_info cmd_info[6] = {
394 { /* CMD 643 - no UDMA */ 392 { /* CMD 643 - no UDMA */
395 .flags = ATA_FLAG_SLAVE_POSS, 393 .flags = ATA_FLAG_SLAVE_POSS,
@@ -440,18 +438,15 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
440 if (rc) 438 if (rc)
441 return rc; 439 return rc;
442 440
443 pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
444 class_rev &= 0xFF;
445
446 if (id->driver_data == 0) /* 643 */ 441 if (id->driver_data == 0) /* 643 */
447 ata_pci_bmdma_clear_simplex(pdev); 442 ata_pci_bmdma_clear_simplex(pdev);
448 443
449 if (pdev->device == PCI_DEVICE_ID_CMD_646) { 444 if (pdev->device == PCI_DEVICE_ID_CMD_646) {
450 /* Does UDMA work ? */ 445 /* Does UDMA work ? */
451 if (class_rev > 4) 446 if (pdev->revision > 4)
452 ppi[0] = &cmd_info[2]; 447 ppi[0] = &cmd_info[2];
453 /* Early rev with other problems ? */ 448 /* Early rev with other problems ? */
454 else if (class_rev == 1) 449 else if (pdev->revision == 1)
455 ppi[0] = &cmd_info[3]; 450 ppi[0] = &cmd_info[3];
456 } 451 }
457 452
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c
index 5bfae075968e..0bd48e8f21bd 100644
--- a/drivers/ata/pata_hpt366.c
+++ b/drivers/ata/pata_hpt366.c
@@ -342,7 +342,6 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
342 const struct ata_port_info *ppi[] = { &info_hpt366, NULL }; 342 const struct ata_port_info *ppi[] = { &info_hpt366, NULL };
343 343
344 void *hpriv = NULL; 344 void *hpriv = NULL;
345 u32 class_rev;
346 u32 reg1; 345 u32 reg1;
347 int rc; 346 int rc;
348 347
@@ -350,13 +349,10 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
350 if (rc) 349 if (rc)
351 return rc; 350 return rc;
352 351
353 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
354 class_rev &= 0xFF;
355
356 /* May be a later chip in disguise. Check */ 352 /* May be a later chip in disguise. Check */
357 /* Newer chips are not in the HPT36x driver. Ignore them */ 353 /* Newer chips are not in the HPT36x driver. Ignore them */
358 if (class_rev > 2) 354 if (dev->revision > 2)
359 return -ENODEV; 355 return -ENODEV;
360 356
361 hpt36x_init_chipset(dev); 357 hpt36x_init_chipset(dev);
362 358
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index defd9b8456ed..4224cfccedef 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -799,9 +799,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
799 static const int MHz[4] = { 33, 40, 50, 66 }; 799 static const int MHz[4] = { 33, 40, 50, 66 };
800 void *private_data = NULL; 800 void *private_data = NULL;
801 const struct ata_port_info *ppi[] = { NULL, NULL }; 801 const struct ata_port_info *ppi[] = { NULL, NULL };
802 802 u8 rev = dev->revision;
803 u8 irqmask; 803 u8 irqmask;
804 u32 class_rev;
805 u8 mcr1; 804 u8 mcr1;
806 u32 freq; 805 u32 freq;
807 int prefer_dpll = 1; 806 int prefer_dpll = 1;
@@ -816,19 +815,16 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
816 if (rc) 815 if (rc)
817 return rc; 816 return rc;
818 817
819 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
820 class_rev &= 0xFF;
821
822 if (dev->device == PCI_DEVICE_ID_TTI_HPT366) { 818 if (dev->device == PCI_DEVICE_ID_TTI_HPT366) {
823 /* May be a later chip in disguise. Check */ 819 /* May be a later chip in disguise. Check */
824 /* Older chips are in the HPT366 driver. Ignore them */ 820 /* Older chips are in the HPT366 driver. Ignore them */
825 if (class_rev < 3) 821 if (rev < 3)
826 return -ENODEV; 822 return -ENODEV;
827 /* N series chips have their own driver. Ignore */ 823 /* N series chips have their own driver. Ignore */
828 if (class_rev == 6) 824 if (rev == 6)
829 return -ENODEV; 825 return -ENODEV;
830 826
831 switch(class_rev) { 827 switch(rev) {
832 case 3: 828 case 3:
833 ppi[0] = &info_hpt370; 829 ppi[0] = &info_hpt370;
834 chip_table = &hpt370; 830 chip_table = &hpt370;
@@ -844,28 +840,29 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
844 chip_table = &hpt372; 840 chip_table = &hpt372;
845 break; 841 break;
846 default: 842 default:
847 printk(KERN_ERR "pata_hpt37x: Unknown HPT366 subtype please report (%d).\n", class_rev); 843 printk(KERN_ERR "pata_hpt37x: Unknown HPT366 "
844 "subtype, please report (%d).\n", rev);
848 return -ENODEV; 845 return -ENODEV;
849 } 846 }
850 } else { 847 } else {
851 switch(dev->device) { 848 switch(dev->device) {
852 case PCI_DEVICE_ID_TTI_HPT372: 849 case PCI_DEVICE_ID_TTI_HPT372:
853 /* 372N if rev >= 2*/ 850 /* 372N if rev >= 2*/
854 if (class_rev >= 2) 851 if (rev >= 2)
855 return -ENODEV; 852 return -ENODEV;
856 ppi[0] = &info_hpt372; 853 ppi[0] = &info_hpt372;
857 chip_table = &hpt372a; 854 chip_table = &hpt372a;
858 break; 855 break;
859 case PCI_DEVICE_ID_TTI_HPT302: 856 case PCI_DEVICE_ID_TTI_HPT302:
860 /* 302N if rev > 1 */ 857 /* 302N if rev > 1 */
861 if (class_rev > 1) 858 if (rev > 1)
862 return -ENODEV; 859 return -ENODEV;
863 ppi[0] = &info_hpt372; 860 ppi[0] = &info_hpt372;
864 /* Check this */ 861 /* Check this */
865 chip_table = &hpt302; 862 chip_table = &hpt302;
866 break; 863 break;
867 case PCI_DEVICE_ID_TTI_HPT371: 864 case PCI_DEVICE_ID_TTI_HPT371:
868 if (class_rev > 1) 865 if (rev > 1)
869 return -ENODEV; 866 return -ENODEV;
870 ppi[0] = &info_hpt372; 867 ppi[0] = &info_hpt372;
871 chip_table = &hpt371; 868 chip_table = &hpt371;
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
index 26f50af0ad89..d30da8072091 100644
--- a/drivers/ata/pata_hpt3x2n.c
+++ b/drivers/ata/pata_hpt3x2n.c
@@ -449,10 +449,8 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
449 .port_ops = &hpt3x2n_port_ops 449 .port_ops = &hpt3x2n_port_ops
450 }; 450 };
451 const struct ata_port_info *ppi[] = { &info, NULL }; 451 const struct ata_port_info *ppi[] = { &info, NULL };
452 452 u8 rev = dev->revision;
453 u8 irqmask; 453 u8 irqmask;
454 u32 class_rev;
455
456 unsigned int pci_mhz; 454 unsigned int pci_mhz;
457 unsigned int f_low, f_high; 455 unsigned int f_low, f_high;
458 int adjust; 456 int adjust;
@@ -464,26 +462,23 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
464 if (rc) 462 if (rc)
465 return rc; 463 return rc;
466 464
467 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
468 class_rev &= 0xFF;
469
470 switch(dev->device) { 465 switch(dev->device) {
471 case PCI_DEVICE_ID_TTI_HPT366: 466 case PCI_DEVICE_ID_TTI_HPT366:
472 if (class_rev < 6) 467 if (rev < 6)
473 return -ENODEV; 468 return -ENODEV;
474 break; 469 break;
475 case PCI_DEVICE_ID_TTI_HPT371: 470 case PCI_DEVICE_ID_TTI_HPT371:
476 if (class_rev < 2) 471 if (rev < 2)
477 return -ENODEV; 472 return -ENODEV;
478 /* 371N if rev > 1 */ 473 /* 371N if rev > 1 */
479 break; 474 break;
480 case PCI_DEVICE_ID_TTI_HPT372: 475 case PCI_DEVICE_ID_TTI_HPT372:
481 /* 372N if rev >= 2*/ 476 /* 372N if rev >= 2*/
482 if (class_rev < 2) 477 if (rev < 2)
483 return -ENODEV; 478 return -ENODEV;
484 break; 479 break;
485 case PCI_DEVICE_ID_TTI_HPT302: 480 case PCI_DEVICE_ID_TTI_HPT302:
486 if (class_rev < 2) 481 if (rev < 2)
487 return -ENODEV; 482 return -ENODEV;
488 break; 483 break;
489 case PCI_DEVICE_ID_TTI_HPT372N: 484 case PCI_DEVICE_ID_TTI_HPT372N:
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index 4cb649d8d38c..a2ace48a4610 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -212,13 +212,11 @@ static struct ata_port_operations sil680_port_ops = {
212 212
213static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio) 213static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
214{ 214{
215 u32 class_rev = 0;
216 u8 tmpbyte = 0; 215 u8 tmpbyte = 0;
217 216
218 pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
219 class_rev &= 0xff;
220 /* FIXME: double check */ 217 /* FIXME: double check */
221 pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, (class_rev) ? 1 : 255); 218 pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE,
219 pdev->revision ? 1 : 255);
222 220
223 pci_write_config_byte(pdev, 0x80, 0x00); 221 pci_write_config_byte(pdev, 0x80, 0x00);
224 pci_write_config_byte(pdev, 0x84, 0x00); 222 pci_write_config_byte(pdev, 0x84, 0x00);