summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2008-07-29 08:49:36 +0000
committeryongari <yongari@FreeBSD.org>2008-07-29 08:49:36 +0000
commit3a922a1bb6a50e26c42012394348abc524fe48cc (patch)
treefc38ca64b82c68a81dec8e5f5ad3b51f957d3109 /sys/dev
parent9c99165a6fcce58d2053b788e2039c8036525df7 (diff)
downloadFreeBSD-src-3a922a1bb6a50e26c42012394348abc524fe48cc.zip
FreeBSD-src-3a922a1bb6a50e26c42012394348abc524fe48cc.tar.gz
Cache PCI vendor/device ids to avoid unnecessary PCI configuration
space access in device probe. Also nuke referencing softc in device probe.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/bfe/if_bfe.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/dev/bfe/if_bfe.c b/sys/dev/bfe/if_bfe.c
index 4c3adf4..60e6317 100644
--- a/sys/dev/bfe/if_bfe.c
+++ b/sys/dev/bfe/if_bfe.c
@@ -171,17 +171,14 @@ static int
bfe_probe(device_t dev)
{
struct bfe_type *t;
- struct bfe_softc *sc;
+ uint16_t vendor, devid;
t = bfe_devs;
-
- sc = device_get_softc(dev);
- bzero(sc, sizeof(struct bfe_softc));
- sc->bfe_dev = dev;
+ vendor = pci_get_vendor(dev);
+ devid = pci_get_device(dev);
while(t->bfe_name != NULL) {
- if ((pci_get_vendor(dev) == t->bfe_vid) &&
- (pci_get_device(dev) == t->bfe_did)) {
+ if (vendor == t->bfe_vid && devid == t->bfe_did) {
device_set_desc_copy(dev, t->bfe_name);
return (BUS_PROBE_DEFAULT);
}
OpenPOWER on IntegriCloud