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/dev/mcd/mcd.c | 39 +++++++++------------------------------ 1 file changed, 9 insertions(+), 30 deletions(-) (limited to 'sys/dev/mcd/mcd.c') diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c index 17e9b0c..0f50017 100644 --- a/sys/dev/mcd/mcd.c +++ b/sys/dev/mcd/mcd.c @@ -40,14 +40,12 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: mcd.c,v 1.107 1999/05/30 16:52:19 phk Exp $ + * $Id: mcd.c,v 1.108 1999/05/31 11:26:15 phk Exp $ */ static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; #include "mcd.h" #if NMCD > 0 -#include "opt_devfs.h" - #include #include #include @@ -57,9 +55,6 @@ static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; #include #include #include -#ifdef DEVFS -#include -#endif /*DEVFS*/ #include @@ -150,12 +145,6 @@ static struct mcd_data { short debug; struct buf_queue_head head; /* head of buf queue */ struct mcd_mbx mbx; -#ifdef DEVFS - void *ra_devfs_token; /* store the devfs handle here */ - void *rc_devfs_token; /* store the devfs handle here */ - void *a_devfs_token; /* store the devfs handle here */ - void *c_devfs_token; /* store the devfs handle here */ -#endif } mcd_data[NMCD]; /* reader state machine */ @@ -275,24 +264,14 @@ int mcd_attach(struct isa_device *dev) mcd_configure(cd); #endif /* name filled in probe */ -#ifdef DEVFS - cd->ra_devfs_token = - devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, 0), - DV_CHR, UID_ROOT, GID_OPERATOR, 0640, - "rmcd%da", unit); - cd->rc_devfs_token = - devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART), - DV_CHR, UID_ROOT, GID_OPERATOR, 0640, - "rmcd%dc", unit); - cd->a_devfs_token = - devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, 0), - DV_BLK, UID_ROOT, GID_OPERATOR, 0640, - "mcd%da", unit); - cd->c_devfs_token = - devfs_add_devswf(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART), - DV_BLK, UID_ROOT, GID_OPERATOR, 0640, - "mcd%dc", unit); -#endif + make_dev(&mcd_cdevsw, dkmakeminor(unit, 0, 0), + UID_ROOT, GID_OPERATOR, 0640, "rmcd%da", unit); + make_dev(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART), + UID_ROOT, GID_OPERATOR, 0640, "rmcd%dc", unit); + make_dev(&mcd_cdevsw, dkmakeminor(unit, 0, 0), + UID_ROOT, GID_OPERATOR, 0640, "mcd%da", unit); + make_dev(&mcd_cdevsw, dkmakeminor(unit, 0, RAW_PART), + UID_ROOT, GID_OPERATOR, 0640, "mcd%dc", unit); return 1; } -- cgit v1.1