From 663cbe4fc26065f7af7d10faaee492a626156145 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 23 Aug 1999 20:59:21 +0000 Subject: 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(). --- sys/pci/pci.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) (limited to 'sys/pci/pci.c') 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 @@ -42,9 +41,6 @@ #include #include #include -#ifdef DEVFS -#include -#endif /* DEVFS */ #include #include @@ -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; } -- cgit v1.1