summaryrefslogtreecommitdiffstats
path: root/sys/scsi/sd.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/sd.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/sd.c')
-rw-r--r--sys/scsi/sd.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index a78e727..edbce2c 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
*
- * $Id: sd.c,v 1.89 1996/05/02 22:20:52 phk Exp $
+ * $Id: sd.c,v 1.90 1996/06/14 11:02:20 asami Exp $
*/
#include "opt_bounce.h"
@@ -115,16 +115,11 @@ static d_strategy_t sdstrategy;
#define CDEV_MAJOR 13
#define BDEV_MAJOR 4
-extern struct cdevsw sd_cdevsw; /* hold off the complaints for a second */
+static struct cdevsw sd_cdevsw;
static struct bdevsw sd_bdevsw =
{ sdopen, sdclose, sdstrategy, sdioctl, /*4*/
sddump, sdsize, 0, "sd", &sd_cdevsw, -1 };
-static struct cdevsw sd_cdevsw =
- { sdopen, sdclose, rawread, rawwrite, /*13*/
- sdioctl, nostop, nullreset, nodevtotty,
- seltrue, nommap, sdstrategy, "sd",
- &sd_bdevsw, -1 };
SCSI_DEVICE_ENTRIES(sd)
@@ -1055,13 +1050,9 @@ static sd_devsw_installed = 0;
static void sd_drvinit(void *unused)
{
- dev_t dev;
if( ! sd_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&sd_cdevsw, NULL);
- dev = makedev(BDEV_MAJOR, 0);
- bdevsw_add(&dev,&sd_bdevsw, NULL);
+ bdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &sd_bdevsw);
sd_devsw_installed = 1;
}
}
OpenPOWER on IntegriCloud