Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci In configure_bus() return early if there are no ...



details:   https://anonhg.NetBSD.org/src/rev/ce6e4d6c9562
branches:  trunk
changeset: 539832:ce6e4d6c9562
user:      simonb <simonb%NetBSD.org@localhost>
date:      Wed Nov 27 02:53:10 2002 +0000

description:
In configure_bus() return early if there are no devices on the bus to
configure.

diffstat:

 sys/dev/pci/pciconf.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r b2b5be0d3dcc -r ce6e4d6c9562 sys/dev/pci/pciconf.c
--- a/sys/dev/pci/pciconf.c     Wed Nov 27 00:43:12 2002 +0000
+++ b/sys/dev/pci/pciconf.c     Wed Nov 27 02:53:10 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pciconf.c,v 1.19 2002/11/25 05:25:00 thorpej Exp $     */
+/*     $NetBSD: pciconf.c,v 1.20 2002/11/27 02:53:10 simonb Exp $      */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pciconf.c,v 1.19 2002/11/25 05:25:00 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciconf.c,v 1.20 2002/11/27 02:53:10 simonb Exp $");
 
 #include "opt_pci.h"
 
@@ -927,6 +927,11 @@
        pciconf_dev_t   *pd;
        int             def_ltim, max_ltim, band, bus_mhz;
 
+       if (pb->ndevs == 0) {
+               if (pci_conf_debug)
+                       printf("PCI bus %d - no devices\n", pb->busno);
+               return (1);
+       }
        bus_mhz = pb->freq_66 ? 66 : 33;
        max_ltim = pb->max_mingnt * bus_mhz / 4;        /* cvt to cycle count */
        band = 40000000;                        /* 0.25us cycles/sec */



Home | Main Index | Thread Index | Old Index