From 9d2a5442fc039a43ca4374a8bcade3b90597e467 Mon Sep 17 00:00:00 2001 From: Coleman Kane Date: Fri, 23 Jun 2000 05:54:01 +0000 Subject: [PATCH] Finish up the fixing of the linux ioctl stuff. Add line to remove the dev entry upon unload. --- sys/dev/tdfx/tdfx_pci.c | 6 +++++- sys/dev/tdfx/tdfx_vars.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/tdfx/tdfx_pci.c b/sys/dev/tdfx/tdfx_pci.c index ad48f995503..9709fd59534 100644 --- a/sys/dev/tdfx/tdfx_pci.c +++ b/sys/dev/tdfx/tdfx_pci.c @@ -102,6 +102,7 @@ static device_method_t tdfx_methods[] = { MALLOC_DEFINE(M_TDFX,"TDFX Driver","3DFX Graphics[/2D]/3D Accelerator(s)"); #ifdef TDFX_LINUX +MODULE_DEPEND(tdfx, linux, 1, 1, 1); LINUX_IOCTL_SET(tdfx, LINUX_IOCTL_TDFX_MIN, LINUX_IOCTL_TDFX_MAX); #endif @@ -235,7 +236,8 @@ tdfx_attach(device_t dev) { * voodoo cards, for the mad. The user must set the link, or use MAKEDEV. * Why would we want that many voodoo cards anyhow? */ - make_dev(&tdfx_cdev, dev->unit, 0, 0, 02660, "3dfx%x", dev->unit); + tdfx_info->devt = make_dev(&tdfx_cdev, dev->unit, 0, 0, 02660, + "3dfx%x", dev->unit); return 0; } @@ -258,6 +260,8 @@ tdfx_detach(device_t dev) { if(retval != 0) printf("tdfx: For some reason, I couldn't clear the mtrr\n"); #endif + /* Remove device entry when it can no longer be accessed */ + destroy_dev(tdfx_info->devt); return(0); } diff --git a/sys/dev/tdfx/tdfx_vars.h b/sys/dev/tdfx/tdfx_vars.h index a369897eec4..bbfd3d37a94 100644 --- a/sys/dev/tdfx/tdfx_vars.h +++ b/sys/dev/tdfx/tdfx_vars.h @@ -89,6 +89,7 @@ struct tdfx_softc { unsigned char dv; struct file *curFile; device_t dev; + dev_t devt; struct mem_range_desc mrdesc; int busy; };