summaryrefslogtreecommitdiffstats
path: root/sys/scsi/cd.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/scsi/cd.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/scsi/cd.c')
-rw-r--r--sys/scsi/cd.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index 1e2c56f..7a71341 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
- * $Id: cd.c,v 1.70 1996/06/12 05:10:51 gpalmer Exp $
+ * $Id: cd.c,v 1.71 1996/07/14 10:46:46 joerg Exp $
*/
#include "opt_bounce.h"
@@ -73,17 +73,11 @@ static d_strategy_t cdstrategy;
#define CDEV_MAJOR 15
#define BDEV_MAJOR 6
-extern struct cdevsw cd_cdevsw;
+static struct cdevsw cd_cdevsw;
static struct bdevsw cd_bdevsw =
{ cdopen, cdclose, cdstrategy, cdioctl, /*6*/
nodump, nopsize, 0, "cd", &cd_cdevsw, -1 };
-static struct cdevsw cd_cdevsw =
- { cdopen, cdclose, rawread, nowrite, /*15*/
- cdioctl, nostop, nullreset, nodevtotty,/* cd */
- seltrue, nommap, cdstrategy, "cd",
- &cd_bdevsw, -1 };
-
static int32_t cdstrats, cdqueues;
@@ -1417,13 +1411,9 @@ static cd_devsw_installed = 0;
static void cd_drvinit(void *unused)
{
- dev_t dev;
if( ! cd_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&cd_cdevsw, NULL);
- dev = makedev(BDEV_MAJOR, 0);
- bdevsw_add(&dev,&cd_bdevsw, NULL);
+ bdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &cd_bdevsw);
cd_devsw_installed = 1;
}
}
OpenPOWER on IntegriCloud