aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sym53c8xx_2/sym_glue.c
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2007-10-05 15:55:05 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-10-23 15:10:55 -0400
commitbd678450bfbd4bb6543a7138d9ee3418c2a11e7c (patch)
tree75919bae5d5e4236166e68dda55ab3624bb05041 /drivers/scsi/sym53c8xx_2/sym_glue.c
parentd68cd75992f95d6977956fb227f02e6d532f3d26 (diff)
[SCSI] sym53c8xx: Use pdev->revision
Auke missed the sym2 driver in his initial sweep. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/sym53c8xx_2/sym_glue.c')
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_glue.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index 67a577db5d18..3ed3ed86d350 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -1254,8 +1254,8 @@ static int sym_host_info(struct sym_hcb *np, char *ptr, off_t offset, int len)
1254 info.pos = 0; 1254 info.pos = 0;
1255 1255
1256 copy_info(&info, "Chip " NAME53C "%s, device id 0x%x, " 1256 copy_info(&info, "Chip " NAME53C "%s, device id 0x%x, "
1257 "revision id 0x%x\n", 1257 "revision id 0x%x\n", np->s.chip_name,
1258 np->s.chip_name, np->device_id, np->revision_id); 1258 np->device_id, np->s.device->revision);
1259 copy_info(&info, "At PCI address %s, IRQ " IRQ_FMT "\n", 1259 copy_info(&info, "At PCI address %s, IRQ " IRQ_FMT "\n",
1260 pci_name(np->s.device), IRQ_PRM(np->s.device->irq)); 1260 pci_name(np->s.device), IRQ_PRM(np->s.device->irq));
1261 copy_info(&info, "Min. period factor %d, %s SCSI BUS%s\n", 1261 copy_info(&info, "Min. period factor %d, %s SCSI BUS%s\n",
@@ -1368,10 +1368,9 @@ static struct Scsi_Host * __devinit sym_attach(struct scsi_host_template *tpnt,
1368 unsigned long flags; 1368 unsigned long flags;
1369 struct sym_fw *fw; 1369 struct sym_fw *fw;
1370 1370
1371 printk(KERN_INFO 1371 printk(KERN_INFO "sym%d: <%s> rev 0x%x at pci %s irq " IRQ_FMT "\n",
1372 "sym%d: <%s> rev 0x%x at pci %s irq " IRQ_FMT "\n", 1372 unit, dev->chip.name, pdev->revision, pci_name(pdev),
1373 unit, dev->chip.name, dev->chip.revision_id, 1373 IRQ_PRM(pdev->irq));
1374 pci_name(pdev), IRQ_PRM(pdev->irq));
1375 1374
1376 /* 1375 /*
1377 * Get the firmware for this chip. 1376 * Get the firmware for this chip.
@@ -1412,7 +1411,6 @@ static struct Scsi_Host * __devinit sym_attach(struct scsi_host_template *tpnt,
1412 np->s.device = pdev; 1411 np->s.device = pdev;
1413 np->s.unit = unit; 1412 np->s.unit = unit;
1414 np->device_id = dev->chip.device_id; 1413 np->device_id = dev->chip.device_id;
1415 np->revision_id = dev->chip.revision_id;
1416 np->features = dev->chip.features; 1414 np->features = dev->chip.features;
1417 np->clock_divn = dev->chip.nr_divisor; 1415 np->clock_divn = dev->chip.nr_divisor;
1418 np->maxoffs = dev->chip.offset_max; 1416 np->maxoffs = dev->chip.offset_max;
@@ -1500,7 +1498,7 @@ static struct Scsi_Host * __devinit sym_attach(struct scsi_host_template *tpnt,
1500 instance->transportt = sym2_transport_template; 1498 instance->transportt = sym2_transport_template;
1501 1499
1502 /* 53c896 rev 1 errata: DMA may not cross 16MB boundary */ 1500 /* 53c896 rev 1 errata: DMA may not cross 16MB boundary */
1503 if (pdev->device == PCI_DEVICE_ID_NCR_53C896 && np->revision_id < 2) 1501 if (pdev->device == PCI_DEVICE_ID_NCR_53C896 && pdev->revision < 2)
1504 instance->dma_boundary = 0xFFFFFF; 1502 instance->dma_boundary = 0xFFFFFF;
1505 1503
1506 spin_unlock_irqrestore(instance->host_lock, flags); 1504 spin_unlock_irqrestore(instance->host_lock, flags);
@@ -1545,7 +1543,6 @@ static int __devinit sym_check_supported(struct sym_device *device)
1545{ 1543{
1546 struct sym_chip *chip; 1544 struct sym_chip *chip;
1547 struct pci_dev *pdev = device->pdev; 1545 struct pci_dev *pdev = device->pdev;
1548 u_char revision;
1549 unsigned long io_port = pci_resource_start(pdev, 0); 1546 unsigned long io_port = pci_resource_start(pdev, 0);
1550 int i; 1547 int i;
1551 1548
@@ -1565,14 +1562,12 @@ static int __devinit sym_check_supported(struct sym_device *device)
1565 * to our device structure so we can make it match the actual device 1562 * to our device structure so we can make it match the actual device
1566 * and options. 1563 * and options.
1567 */ 1564 */
1568 pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision); 1565 chip = sym_lookup_chip_table(pdev->device, pdev->revision);
1569 chip = sym_lookup_chip_table(pdev->device, revision);
1570 if (!chip) { 1566 if (!chip) {
1571 dev_info(&pdev->dev, "device not supported\n"); 1567 dev_info(&pdev->dev, "device not supported\n");
1572 return -ENODEV; 1568 return -ENODEV;
1573 } 1569 }
1574 memcpy(&device->chip, chip, sizeof(device->chip)); 1570 memcpy(&device->chip, chip, sizeof(device->chip));
1575 device->chip.revision_id = revision;
1576 1571
1577 return 0; 1572 return 0;
1578} 1573}
@@ -1613,7 +1608,7 @@ static int __devinit sym_set_workarounds(struct sym_device *device)
1613 * We must ensure the chip will use WRITE AND INVALIDATE. 1608 * We must ensure the chip will use WRITE AND INVALIDATE.
1614 * The revision number limit is for now arbitrary. 1609 * The revision number limit is for now arbitrary.
1615 */ 1610 */
1616 if (pdev->device == PCI_DEVICE_ID_NCR_53C896 && chip->revision_id < 0x4) { 1611 if (pdev->device == PCI_DEVICE_ID_NCR_53C896 && pdev->revision < 0x4) {
1617 chip->features |= (FE_WRIE | FE_CLSE); 1612 chip->features |= (FE_WRIE | FE_CLSE);
1618 } 1613 }
1619 1614
@@ -1905,12 +1900,10 @@ static pci_ers_result_t sym2_io_slot_dump(struct pci_dev *pdev)
1905 */ 1900 */
1906static void sym2_reset_workarounds(struct pci_dev *pdev) 1901static void sym2_reset_workarounds(struct pci_dev *pdev)
1907{ 1902{
1908 u_char revision;
1909 u_short status_reg; 1903 u_short status_reg;
1910 struct sym_chip *chip; 1904 struct sym_chip *chip;
1911 1905
1912 pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision); 1906 chip = sym_lookup_chip_table(pdev->device, pdev->revision);
1913 chip = sym_lookup_chip_table(pdev->device, revision);
1914 1907
1915 /* Work around for errant bit in 895A, in a fashion 1908 /* Work around for errant bit in 895A, in a fashion
1916 * similar to what is done in sym_set_workarounds(). 1909 * similar to what is done in sym_set_workarounds().