aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/atiixp.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 /sound/pci/atiixp.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 'sound/pci/atiixp.c')
-rw-r--r--sound/pci/atiixp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 7d8053b5e8d5..89184a424140 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -1639,15 +1639,12 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
1639{ 1639{
1640 struct snd_card *card; 1640 struct snd_card *card;
1641 struct atiixp *chip; 1641 struct atiixp *chip;
1642 unsigned char revision;
1643 int err; 1642 int err;
1644 1643
1645 card = snd_card_new(index, id, THIS_MODULE, 0); 1644 card = snd_card_new(index, id, THIS_MODULE, 0);
1646 if (card == NULL) 1645 if (card == NULL)
1647 return -ENOMEM; 1646 return -ENOMEM;
1648 1647
1649 pci_read_config_byte(pci, PCI_REVISION_ID, &revision);
1650
1651 strcpy(card->driver, spdif_aclink ? "ATIIXP" : "ATIIXP-SPDMA"); 1648 strcpy(card->driver, spdif_aclink ? "ATIIXP" : "ATIIXP-SPDMA");
1652 strcpy(card->shortname, "ATI IXP"); 1649 strcpy(card->shortname, "ATI IXP");
1653 if ((err = snd_atiixp_create(card, pci, &chip)) < 0) 1650 if ((err = snd_atiixp_create(card, pci, &chip)) < 0)
@@ -1670,7 +1667,8 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
1670 snd_atiixp_chip_start(chip); 1667 snd_atiixp_chip_start(chip);
1671 1668
1672 snprintf(card->longname, sizeof(card->longname), 1669 snprintf(card->longname, sizeof(card->longname),
1673 "%s rev %x with %s at %#lx, irq %i", card->shortname, revision, 1670 "%s rev %x with %s at %#lx, irq %i", card->shortname,
1671 pci->revision,
1674 chip->ac97[0] ? snd_ac97_get_short_name(chip->ac97[0]) : "?", 1672 chip->ac97[0] ? snd_ac97_get_short_name(chip->ac97[0]) : "?",
1675 chip->addr, chip->irq); 1673 chip->addr, chip->irq);
1676 1674