summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/scd.c
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/scd.c
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/scd.c')
-rw-r--r--sys/i386/isa/scd.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/sys/i386/isa/scd.c b/sys/i386/isa/scd.c
index df219c7..454cd5b 100644
--- a/sys/i386/isa/scd.c
+++ b/sys/i386/isa/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.22 1996/06/18 01:22:30 bde Exp $ */
+/* $Id: scd.c,v 1.23 1996/07/12 04:11:25 bde Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -194,18 +194,11 @@ static d_strategy_t scdstrategy;
#define CDEV_MAJOR 45
#define BDEV_MAJOR 16
-extern struct cdevsw scd_cdevsw;
+static struct cdevsw scd_cdevsw;
static struct bdevsw scd_bdevsw =
{ scdopen, scdclose, scdstrategy, scdioctl, /*16*/
nodump, nopsize, 0, "scd", &scd_cdevsw, -1 };
-static struct cdevsw scd_cdevsw =
- { scdopen, scdclose, rawread, nowrite, /*45*/
- scdioctl, nostop, nullreset, nodevtotty,/* sony cd */
- seltrue, nommap, scdstrategy, "scd",
- &scd_bdevsw, -1 };
-
-
static struct kern_devconf kdc_scd[NSCD] = { {
0, 0, 0, /* filled in by dev_attach */
"scd", 0, { MDDT_ISA, 0, "bio" },
@@ -1550,13 +1543,9 @@ static scd_devsw_installed = 0;
static void scd_drvinit(void *unused)
{
- dev_t dev;
if( ! scd_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&scd_cdevsw, NULL);
- dev = makedev(BDEV_MAJOR, 0);
- bdevsw_add(&dev,&scd_bdevsw, NULL);
+ bdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &scd_bdevsw);
scd_devsw_installed = 1;
}
}
OpenPOWER on IntegriCloud