aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ipr.c
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2007-06-08 18:46:36 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:02:10 -0400
commit44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (patch)
tree6e16d3ec80c87490dc743f72da086356f2906ace /drivers/scsi/ipr.c
parentb8a3a5214d7cc115f1ca3a3967b7229d97c46f4a (diff)
PCI: Change all drivers to use pci_device->revision
Instead of all drivers reading pci config space to get the revision ID, they can now use the pci_device->revision member. This exposes some issues where drivers where reading a word or a dword for the revision number, and adding useless error-handling around the read. Some drivers even just read it for no purpose of all. In devices where the revision ID is being copied over and used in what appears to be the equivalent of hotpath, I have left the copy code and the cached copy as not to influence the driver's performance. Compile tested with make all{yes,mod}config on x86_64 and i386. Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Acked-by: Dave Jones <davej@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r--drivers/scsi/ipr.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index fa6ff295e568..81330712048c 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -5367,18 +5367,12 @@ static const u16 ipr_blocked_processors[] = {
5367 **/ 5367 **/
5368static int ipr_invalid_adapter(struct ipr_ioa_cfg *ioa_cfg) 5368static int ipr_invalid_adapter(struct ipr_ioa_cfg *ioa_cfg)
5369{ 5369{
5370 u8 rev_id;
5371 int i; 5370 int i;
5372 5371
5373 if (ioa_cfg->type == 0x5702) { 5372 if ((ioa_cfg->type == 0x5702) && (ioa_cfg->pdev->revision < 4)) {
5374 if (pci_read_config_byte(ioa_cfg->pdev, PCI_REVISION_ID, 5373 for (i = 0; i < ARRAY_SIZE(ipr_blocked_processors); i++){
5375 &rev_id) == PCIBIOS_SUCCESSFUL) { 5374 if (__is_processor(ipr_blocked_processors[i]))
5376 if (rev_id < 4) { 5375 return 1;
5377 for (i = 0; i < ARRAY_SIZE(ipr_blocked_processors); i++){
5378 if (__is_processor(ipr_blocked_processors[i]))
5379 return 1;
5380 }
5381 }
5382 } 5376 }
5383 } 5377 }
5384 return 0; 5378 return 0;
@@ -7535,13 +7529,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev,
7535 else 7529 else
7536 ioa_cfg->transop_timeout = IPR_OPERATIONAL_TIMEOUT; 7530 ioa_cfg->transop_timeout = IPR_OPERATIONAL_TIMEOUT;
7537 7531
7538 rc = pci_read_config_byte(pdev, PCI_REVISION_ID, &ioa_cfg->revid); 7532 ioa_cfg->revid = pdev->revision;
7539
7540 if (rc != PCIBIOS_SUCCESSFUL) {
7541 dev_err(&pdev->dev, "Failed to read PCI revision ID\n");
7542 rc = -EIO;
7543 goto out_scsi_host_put;
7544 }
7545 7533
7546 ipr_regs_pci = pci_resource_start(pdev, 0); 7534 ipr_regs_pci = pci_resource_start(pdev, 0);
7547 7535