aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/sis5513.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/ide/pci/sis5513.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/ide/pci/sis5513.c')
-rw-r--r--drivers/ide/pci/sis5513.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index f875183ac8d..756a9b6eb46 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -659,9 +659,7 @@ static unsigned int __devinit init_chipset_sis5513 (struct pci_dev *dev, const c
659 659
660 /* Special case for SiS630 : 630S/ET is ATA_100a */ 660 /* Special case for SiS630 : 630S/ET is ATA_100a */
661 if (SiSHostChipInfo[i].host_id == PCI_DEVICE_ID_SI_630) { 661 if (SiSHostChipInfo[i].host_id == PCI_DEVICE_ID_SI_630) {
662 u8 hostrev; 662 if (host->revision >= 0x30)
663 pci_read_config_byte(host, PCI_REVISION_ID, &hostrev);
664 if (hostrev >= 0x30)
665 chipset_family = ATA_100a; 663 chipset_family = ATA_100a;
666 } 664 }
667 pci_dev_put(host); 665 pci_dev_put(host);
@@ -702,7 +700,6 @@ static unsigned int __devinit init_chipset_sis5513 (struct pci_dev *dev, const c
702 u16 trueid; 700 u16 trueid;
703 u8 prefctl; 701 u8 prefctl;
704 u8 idecfg; 702 u8 idecfg;
705 u8 sbrev;
706 703
707 pci_read_config_byte(dev, 0x4a, &idecfg); 704 pci_read_config_byte(dev, 0x4a, &idecfg);
708 pci_write_config_byte(dev, 0x4a, idecfg | 0x10); 705 pci_write_config_byte(dev, 0x4a, idecfg | 0x10);
@@ -712,11 +709,10 @@ static unsigned int __devinit init_chipset_sis5513 (struct pci_dev *dev, const c
712 if (trueid == 0x5517) { /* SiS 961/961B */ 709 if (trueid == 0x5517) { /* SiS 961/961B */
713 710
714 lpc_bridge = pci_get_slot(dev->bus, 0x10); /* Bus 0, Dev 2, Fn 0 */ 711 lpc_bridge = pci_get_slot(dev->bus, 0x10); /* Bus 0, Dev 2, Fn 0 */
715 pci_read_config_byte(lpc_bridge, PCI_REVISION_ID, &sbrev);
716 pci_read_config_byte(dev, 0x49, &prefctl); 712 pci_read_config_byte(dev, 0x49, &prefctl);
717 pci_dev_put(lpc_bridge); 713 pci_dev_put(lpc_bridge);
718 714
719 if (sbrev == 0x10 && (prefctl & 0x80)) { 715 if (lpc_bridge->revision == 0x10 && (prefctl & 0x80)) {
720 printk(KERN_INFO "SIS5513: SiS 961B MuTIOL IDE UDMA133 controller\n"); 716 printk(KERN_INFO "SIS5513: SiS 961B MuTIOL IDE UDMA133 controller\n");
721 chipset_family = ATA_133a; 717 chipset_family = ATA_133a;
722 } else { 718 } else {