mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
ata: use pci_dev->revision
Some places were using PCI_CLASS_REVISION instead of PCI_REVISION_ID, so
they weren't converted by commit 44c10138fd
(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>
This commit is contained in:
parent
82beb5d894
commit
89d3b3603b
5 changed files with 20 additions and 39 deletions
|
@ -388,8 +388,6 @@ static struct ata_port_operations cmd648_port_ops = {
|
||||||
|
|
||||||
static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||||
{
|
{
|
||||||
u32 class_rev;
|
|
||||||
|
|
||||||
static const struct ata_port_info cmd_info[6] = {
|
static const struct ata_port_info cmd_info[6] = {
|
||||||
{ /* CMD 643 - no UDMA */
|
{ /* CMD 643 - no UDMA */
|
||||||
.flags = ATA_FLAG_SLAVE_POSS,
|
.flags = ATA_FLAG_SLAVE_POSS,
|
||||||
|
@ -440,18 +438,15 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
|
|
||||||
class_rev &= 0xFF;
|
|
||||||
|
|
||||||
if (id->driver_data == 0) /* 643 */
|
if (id->driver_data == 0) /* 643 */
|
||||||
ata_pci_bmdma_clear_simplex(pdev);
|
ata_pci_bmdma_clear_simplex(pdev);
|
||||||
|
|
||||||
if (pdev->device == PCI_DEVICE_ID_CMD_646) {
|
if (pdev->device == PCI_DEVICE_ID_CMD_646) {
|
||||||
/* Does UDMA work ? */
|
/* Does UDMA work ? */
|
||||||
if (class_rev > 4)
|
if (pdev->revision > 4)
|
||||||
ppi[0] = &cmd_info[2];
|
ppi[0] = &cmd_info[2];
|
||||||
/* Early rev with other problems ? */
|
/* Early rev with other problems ? */
|
||||||
else if (class_rev == 1)
|
else if (pdev->revision == 1)
|
||||||
ppi[0] = &cmd_info[3];
|
ppi[0] = &cmd_info[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -342,7 +342,6 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
||||||
const struct ata_port_info *ppi[] = { &info_hpt366, NULL };
|
const struct ata_port_info *ppi[] = { &info_hpt366, NULL };
|
||||||
|
|
||||||
void *hpriv = NULL;
|
void *hpriv = NULL;
|
||||||
u32 class_rev;
|
|
||||||
u32 reg1;
|
u32 reg1;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -350,12 +349,9 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
|
|
||||||
class_rev &= 0xFF;
|
|
||||||
|
|
||||||
/* May be a later chip in disguise. Check */
|
/* May be a later chip in disguise. Check */
|
||||||
/* Newer chips are not in the HPT36x driver. Ignore them */
|
/* Newer chips are not in the HPT36x driver. Ignore them */
|
||||||
if (class_rev > 2)
|
if (dev->revision > 2)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
hpt36x_init_chipset(dev);
|
hpt36x_init_chipset(dev);
|
||||||
|
|
|
@ -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 };
|
static const int MHz[4] = { 33, 40, 50, 66 };
|
||||||
void *private_data = NULL;
|
void *private_data = NULL;
|
||||||
const struct ata_port_info *ppi[] = { NULL, NULL };
|
const struct ata_port_info *ppi[] = { NULL, NULL };
|
||||||
|
u8 rev = dev->revision;
|
||||||
u8 irqmask;
|
u8 irqmask;
|
||||||
u32 class_rev;
|
|
||||||
u8 mcr1;
|
u8 mcr1;
|
||||||
u32 freq;
|
u32 freq;
|
||||||
int prefer_dpll = 1;
|
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)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
|
|
||||||
class_rev &= 0xFF;
|
|
||||||
|
|
||||||
if (dev->device == PCI_DEVICE_ID_TTI_HPT366) {
|
if (dev->device == PCI_DEVICE_ID_TTI_HPT366) {
|
||||||
/* May be a later chip in disguise. Check */
|
/* May be a later chip in disguise. Check */
|
||||||
/* Older chips are in the HPT366 driver. Ignore them */
|
/* Older chips are in the HPT366 driver. Ignore them */
|
||||||
if (class_rev < 3)
|
if (rev < 3)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
/* N series chips have their own driver. Ignore */
|
/* N series chips have their own driver. Ignore */
|
||||||
if (class_rev == 6)
|
if (rev == 6)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
switch(class_rev) {
|
switch(rev) {
|
||||||
case 3:
|
case 3:
|
||||||
ppi[0] = &info_hpt370;
|
ppi[0] = &info_hpt370;
|
||||||
chip_table = &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;
|
chip_table = &hpt372;
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch(dev->device) {
|
switch(dev->device) {
|
||||||
case PCI_DEVICE_ID_TTI_HPT372:
|
case PCI_DEVICE_ID_TTI_HPT372:
|
||||||
/* 372N if rev >= 2*/
|
/* 372N if rev >= 2*/
|
||||||
if (class_rev >= 2)
|
if (rev >= 2)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
ppi[0] = &info_hpt372;
|
ppi[0] = &info_hpt372;
|
||||||
chip_table = &hpt372a;
|
chip_table = &hpt372a;
|
||||||
break;
|
break;
|
||||||
case PCI_DEVICE_ID_TTI_HPT302:
|
case PCI_DEVICE_ID_TTI_HPT302:
|
||||||
/* 302N if rev > 1 */
|
/* 302N if rev > 1 */
|
||||||
if (class_rev > 1)
|
if (rev > 1)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
ppi[0] = &info_hpt372;
|
ppi[0] = &info_hpt372;
|
||||||
/* Check this */
|
/* Check this */
|
||||||
chip_table = &hpt302;
|
chip_table = &hpt302;
|
||||||
break;
|
break;
|
||||||
case PCI_DEVICE_ID_TTI_HPT371:
|
case PCI_DEVICE_ID_TTI_HPT371:
|
||||||
if (class_rev > 1)
|
if (rev > 1)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
ppi[0] = &info_hpt372;
|
ppi[0] = &info_hpt372;
|
||||||
chip_table = &hpt371;
|
chip_table = &hpt371;
|
||||||
|
|
|
@ -449,10 +449,8 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
||||||
.port_ops = &hpt3x2n_port_ops
|
.port_ops = &hpt3x2n_port_ops
|
||||||
};
|
};
|
||||||
const struct ata_port_info *ppi[] = { &info, NULL };
|
const struct ata_port_info *ppi[] = { &info, NULL };
|
||||||
|
u8 rev = dev->revision;
|
||||||
u8 irqmask;
|
u8 irqmask;
|
||||||
u32 class_rev;
|
|
||||||
|
|
||||||
unsigned int pci_mhz;
|
unsigned int pci_mhz;
|
||||||
unsigned int f_low, f_high;
|
unsigned int f_low, f_high;
|
||||||
int adjust;
|
int adjust;
|
||||||
|
@ -464,26 +462,23 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
|
|
||||||
class_rev &= 0xFF;
|
|
||||||
|
|
||||||
switch(dev->device) {
|
switch(dev->device) {
|
||||||
case PCI_DEVICE_ID_TTI_HPT366:
|
case PCI_DEVICE_ID_TTI_HPT366:
|
||||||
if (class_rev < 6)
|
if (rev < 6)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
break;
|
break;
|
||||||
case PCI_DEVICE_ID_TTI_HPT371:
|
case PCI_DEVICE_ID_TTI_HPT371:
|
||||||
if (class_rev < 2)
|
if (rev < 2)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
/* 371N if rev > 1 */
|
/* 371N if rev > 1 */
|
||||||
break;
|
break;
|
||||||
case PCI_DEVICE_ID_TTI_HPT372:
|
case PCI_DEVICE_ID_TTI_HPT372:
|
||||||
/* 372N if rev >= 2*/
|
/* 372N if rev >= 2*/
|
||||||
if (class_rev < 2)
|
if (rev < 2)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
break;
|
break;
|
||||||
case PCI_DEVICE_ID_TTI_HPT302:
|
case PCI_DEVICE_ID_TTI_HPT302:
|
||||||
if (class_rev < 2)
|
if (rev < 2)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
break;
|
break;
|
||||||
case PCI_DEVICE_ID_TTI_HPT372N:
|
case PCI_DEVICE_ID_TTI_HPT372N:
|
||||||
|
|
|
@ -212,13 +212,11 @@ static struct ata_port_operations sil680_port_ops = {
|
||||||
|
|
||||||
static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
|
static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
|
||||||
{
|
{
|
||||||
u32 class_rev = 0;
|
|
||||||
u8 tmpbyte = 0;
|
u8 tmpbyte = 0;
|
||||||
|
|
||||||
pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
|
|
||||||
class_rev &= 0xff;
|
|
||||||
/* FIXME: double check */
|
/* FIXME: double check */
|
||||||
pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, (class_rev) ? 1 : 255);
|
pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE,
|
||||||
|
pdev->revision ? 1 : 255);
|
||||||
|
|
||||||
pci_write_config_byte(pdev, 0x80, 0x00);
|
pci_write_config_byte(pdev, 0x80, 0x00);
|
||||||
pci_write_config_byte(pdev, 0x84, 0x00);
|
pci_write_config_byte(pdev, 0x84, 0x00);
|
||||||
|
|
Loading…
Reference in a new issue