From 10a3d3c73f6e7a9cf5bc215cb44bc4e60dde0766 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Wed, 13 Jul 2005 17:01:31 +0000 Subject: [PATCH] Change to common PCI probe style. Submitted-by: Sepherosa Ziehau --- sys/dev/netif/xl/if_xl.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sys/dev/netif/xl/if_xl.c b/sys/dev/netif/xl/if_xl.c index b0b6e05656..cea4069ebb 100644 --- a/sys/dev/netif/xl/if_xl.c +++ b/sys/dev/netif/xl/if_xl.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_xl.c,v 1.72.2.28 2003/10/08 06:01:57 murray Exp $ - * $DragonFly: src/sys/dev/netif/xl/if_xl.c,v 1.28 2005/07/13 17:00:34 joerg Exp $ + * $DragonFly: src/sys/dev/netif/xl/if_xl.c,v 1.29 2005/07/13 17:01:31 joerg Exp $ */ /* @@ -1122,22 +1122,19 @@ xl_reset(sc) * IDs against our list and return a device name if we find a match. */ static int -xl_probe(dev) - device_t dev; +xl_probe(device_t dev) { - struct xl_type *t; - - t = xl_devs; + struct xl_type *t; + uint16_t vid, did; - while(t->xl_name != NULL) { - if ((pci_get_vendor(dev) == t->xl_vid) && - (pci_get_device(dev) == t->xl_did)) { + vid = pci_get_vendor(dev); + did = pci_get_device(dev); + for (t = xl_devs; t->xl_name != NULL; t++) { + if (vid == t->xl_vid && did == t->xl_did) { device_set_desc(dev, t->xl_name); return(0); } - t++; } - return(ENXIO); } -- 2.41.0