summaryrefslogtreecommitdiffstats
path: root/sys/pci/pci.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-08-23 20:59:21 +0000
committerphk <phk@FreeBSD.org>1999-08-23 20:59:21 +0000
commit663cbe4fc26065f7af7d10faaee492a626156145 (patch)
tree32e619fadb473bfb85ff8e06044176f2ff323cce /sys/pci/pci.c
parent2a5ff1f726f814a9e4717afe3f14250f8030cace (diff)
downloadFreeBSD-src-663cbe4fc26065f7af7d10faaee492a626156145.zip
FreeBSD-src-663cbe4fc26065f7af7d10faaee492a626156145.tar.gz
Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
Diffstat (limited to 'sys/pci/pci.c')
-rw-r--r--sys/pci/pci.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/sys/pci/pci.c b/sys/pci/pci.c
index 78b0cda..75f41e8 100644
--- a/sys/pci/pci.c
+++ b/sys/pci/pci.c
@@ -23,13 +23,12 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pci.c,v 1.113 1999/07/28 07:57:47 dfr Exp $
+ * $Id: pci.c,v 1.114 1999/07/29 01:03:03 mdodd Exp $
*
*/
#include "opt_bus.h"
-#include "opt_devfs.h"
#include "opt_simos.h"
#include <sys/param.h>
@@ -42,9 +41,6 @@
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/buf.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -916,22 +912,6 @@ static struct cdevsw pcicdev = {
/* bmaj */ -1
};
-#ifdef DEVFS
-static void *pci_devfs_token;
-#endif
-
-static void
-pci_cdevinit(void *dummy)
-{
- cdevsw_add(&pcicdev);
-#ifdef DEVFS
- pci_devfs_token = devfs_add_devswf(&pcicdev, 0, DV_CHR,
- UID_ROOT, GID_WHEEL, 0644, "pci");
-#endif
-}
-
-SYSINIT(pcidev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+PCI_CDEV, pci_cdevinit, NULL);
-
#include "pci_if.h"
/*
@@ -1109,9 +1089,14 @@ pci_add_children(device_t dev, int busno)
static int
pci_new_probe(device_t dev)
{
- device_set_desc(dev, "PCI bus");
+ static int once;
+ device_set_desc(dev, "PCI bus");
pci_add_children(dev, device_get_unit(dev));
+ if (!once) {
+ make_dev(&pcicdev, 0, UID_ROOT, GID_WHEEL, 0644, "pci");
+ once++;
+ }
return 0;
}
OpenPOWER on IntegriCloud