|
@@ -799,9 +799,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
|
|
static const int MHz[4] = { 33, 40, 50, 66 };
|
|
|
void *private_data = NULL;
|
|
|
const struct ata_port_info *ppi[] = { NULL, NULL };
|
|
|
-
|
|
|
+ u8 rev = dev->revision;
|
|
|
u8 irqmask;
|
|
|
- u32 class_rev;
|
|
|
u8 mcr1;
|
|
|
u32 freq;
|
|
|
int prefer_dpll = 1;
|
|
@@ -816,19 +815,16 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
|
|
if (rc)
|
|
|
return rc;
|
|
|
|
|
|
- pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
|
|
|
- class_rev &= 0xFF;
|
|
|
-
|
|
|
if (dev->device == PCI_DEVICE_ID_TTI_HPT366) {
|
|
|
/* May be a later chip in disguise. Check */
|
|
|
/* Older chips are in the HPT366 driver. Ignore them */
|
|
|
- if (class_rev < 3)
|
|
|
+ if (rev < 3)
|
|
|
return -ENODEV;
|
|
|
/* N series chips have their own driver. Ignore */
|
|
|
- if (class_rev == 6)
|
|
|
+ if (rev == 6)
|
|
|
return -ENODEV;
|
|
|
|
|
|
- switch(class_rev) {
|
|
|
+ switch(rev) {
|
|
|
case 3:
|
|
|
ppi[0] = &info_hpt370;
|
|
|
chip_table = &hpt370;
|
|
@@ -844,28 +840,29 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
|
|
chip_table = &hpt372;
|
|
|
break;
|
|
|
default:
|
|
|
- printk(KERN_ERR "pata_hpt37x: Unknown HPT366 subtype please report (%d).\n", class_rev);
|
|
|
+ printk(KERN_ERR "pata_hpt37x: Unknown HPT366 "
|
|
|
+ "subtype, please report (%d).\n", rev);
|
|
|
return -ENODEV;
|
|
|
}
|
|
|
} else {
|
|
|
switch(dev->device) {
|
|
|
case PCI_DEVICE_ID_TTI_HPT372:
|
|
|
/* 372N if rev >= 2*/
|
|
|
- if (class_rev >= 2)
|
|
|
+ if (rev >= 2)
|
|
|
return -ENODEV;
|
|
|
ppi[0] = &info_hpt372;
|
|
|
chip_table = &hpt372a;
|
|
|
break;
|
|
|
case PCI_DEVICE_ID_TTI_HPT302:
|
|
|
/* 302N if rev > 1 */
|
|
|
- if (class_rev > 1)
|
|
|
+ if (rev > 1)
|
|
|
return -ENODEV;
|
|
|
ppi[0] = &info_hpt372;
|
|
|
/* Check this */
|
|
|
chip_table = &hpt302;
|
|
|
break;
|
|
|
case PCI_DEVICE_ID_TTI_HPT371:
|
|
|
- if (class_rev > 1)
|
|
|
+ if (rev > 1)
|
|
|
return -ENODEV;
|
|
|
ppi[0] = &info_hpt372;
|
|
|
chip_table = &hpt371;
|