aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_sis.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/ata/pata_sis.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/ata/pata_sis.c')
-rw-r--r--drivers/ata/pata_sis.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index 2b4508206a6c..74a021124f3c 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -928,9 +928,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
928 if (host != NULL) { 928 if (host != NULL) {
929 chipset = sets; /* Match found */ 929 chipset = sets; /* Match found */
930 if (sets->device == 0x630) { /* SIS630 */ 930 if (sets->device == 0x630) { /* SIS630 */
931 u8 host_rev; 931 if (host->revision >= 0x30) /* 630 ET */
932 pci_read_config_byte(host, PCI_REVISION_ID, &host_rev);
933 if (host_rev >= 0x30) /* 630 ET */
934 chipset = &sis100_early; 932 chipset = &sis100_early;
935 } 933 }
936 break; 934 break;
@@ -974,7 +972,6 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
974 u16 trueid; 972 u16 trueid;
975 u8 prefctl; 973 u8 prefctl;
976 u8 idecfg; 974 u8 idecfg;
977 u8 sbrev;
978 975
979 /* Try the second unmasking technique */ 976 /* Try the second unmasking technique */
980 pci_read_config_byte(pdev, 0x4a, &idecfg); 977 pci_read_config_byte(pdev, 0x4a, &idecfg);
@@ -987,11 +984,10 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
987 lpc_bridge = pci_get_slot(pdev->bus, 0x10); /* Bus 0 Dev 2 Fn 0 */ 984 lpc_bridge = pci_get_slot(pdev->bus, 0x10); /* Bus 0 Dev 2 Fn 0 */
988 if (lpc_bridge == NULL) 985 if (lpc_bridge == NULL)
989 break; 986 break;
990 pci_read_config_byte(lpc_bridge, PCI_REVISION_ID, &sbrev);
991 pci_read_config_byte(pdev, 0x49, &prefctl); 987 pci_read_config_byte(pdev, 0x49, &prefctl);
992 pci_dev_put(lpc_bridge); 988 pci_dev_put(lpc_bridge);
993 989
994 if (sbrev == 0x10 && (prefctl & 0x80)) { 990 if (lpc_bridge->revision == 0x10 && (prefctl & 0x80)) {
995 chipset = &sis133_early; 991 chipset = &sis133_early;
996 break; 992 break;
997 } 993 }