summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/matcd
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-07-23 21:52:43 +0000
committerphk <phk@FreeBSD.org>1996-07-23 21:52:43 +0000
commit507c8709748944c310d7a558ec0e27130fadb6f4 (patch)
treeb7107b6c401f05c3026e9bfb11ea285a7b376aba /sys/i386/isa/matcd
parentb27f4b2c811818ccd3f03bd1aad99a231b5b2b18 (diff)
downloadFreeBSD-src-507c8709748944c310d7a558ec0e27130fadb6f4.zip
FreeBSD-src-507c8709748944c310d7a558ec0e27130fadb6f4.tar.gz
Make a "DWIM" function for adding [bc]devsw entries for bdev drivers.
Saves about 280 butes of source per driver, 56 bytes in object size and another 56 bytes moves from data to bss. No functional change intended nor expected. GENERIC should be about one k smaller now :-)
Diffstat (limited to 'sys/i386/isa/matcd')
-rw-r--r--sys/i386/isa/matcd/matcd.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c
index 362acda..70c0a12 100644
--- a/sys/i386/isa/matcd/matcd.c
+++ b/sys/i386/isa/matcd/matcd.c
@@ -337,7 +337,7 @@ static char MATCDVERSION[]="Version 1(26) 18-Oct-95";
static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank Durda IV";
/* The proceeding strings may not be changed*/
-/* $Id: matcd.c,v 1.17 1996/05/03 16:49:14 phk Exp $ */
+/* $Id: matcd.c,v 1.18 1996/06/08 09:17:51 bde Exp $ */
/*---------------------------------------------------------------------------
Include declarations
@@ -534,20 +534,12 @@ static d_strategy_t matcdstrategy;
#define CDEV_MAJOR 46
#define BDEV_MAJOR 17
-extern struct cdevsw matcd_cdevsw;
+static struct cdevsw matcd_cdevsw;
static struct bdevsw matcd_bdevsw =
{ matcdopen, matcdclose, matcdstrategy, matcdioctl, /*17*/
nodump, matcdsize, 0, "matcd",
&matcd_cdevsw, -1 };
-static struct cdevsw matcd_cdevsw =
- { matcdopen, matcdclose, rawread, nowrite, /*46*/
- matcdioctl, nostop, nullreset, nodevtotty,/* SB cd */
- seltrue, nommap, matcdstrategy, "matcd",
- &matcd_bdevsw, -1};
-
-
-
/*---------------------------------------------------------------------------
Internal function declarations
---------------------------------------------------------------------------*/
@@ -2689,13 +2681,9 @@ static matcd_devsw_installed = 0;
static void
matcd_drvinit(void *unused)
{
- dev_t dev;
if( ! matcd_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&matcd_cdevsw,NULL);
- dev = makedev(BDEV_MAJOR,0);
- bdevsw_add(&dev,&matcd_bdevsw,NULL);
+ bdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &matcd_bdevsw);
matcd_devsw_installed = 1;
}
}
OpenPOWER on IntegriCloud