aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_hpt37x.c
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/pata_hpt37x.c
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/pata_hpt37x.c')
-rw-r--r--drivers/ata/pata_hpt37x.c21
1 files changed, 9 insertions, 12 deletions
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;