summaryrefslogtreecommitdiffstats
path: root/sys/scsi/od.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/od.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/od.c')
-rw-r--r--sys/scsi/od.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/sys/scsi/od.c b/sys/scsi/od.c
index 610fe9a..643357f 100644
--- a/sys/scsi/od.c
+++ b/sys/scsi/od.c
@@ -28,7 +28,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: od.c,v 1.15.1.3 1996/05/06 15:14:57 shun Exp $
+ * $Id: od.c,v 1.18 1996/06/16 19:58:24 joerg Exp $
*/
/*
@@ -150,16 +150,11 @@ static d_strategy_t odstrategy;
#define CDEV_MAJOR 70
#define BDEV_MAJOR 20
-extern struct cdevsw od_cdevsw;
+static struct cdevsw od_cdevsw;
static struct bdevsw od_bdevsw =
{ odopen, odclose, odstrategy, odioctl, /*20*/
nodump, nopsize, 0, "od", &od_cdevsw, -1 };
-static struct cdevsw od_cdevsw =
- { odopen, odclose, rawread, rawwrite, /*70*/
- odioctl, nostop, nullreset, nodevtotty,
- seltrue, nommap, odstrategy, "od",
- &od_bdevsw, -1 };
/*
* Actually include the interface routines
@@ -983,13 +978,9 @@ static od_devsw_installed = 0;
static void od_drvinit(void *unused)
{
- dev_t dev;
if( ! od_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&od_cdevsw, NULL);
- dev = makedev(BDEV_MAJOR, 0);
- bdevsw_add(&dev,&od_bdevsw, NULL);
+ bdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &od_bdevsw);
od_devsw_installed = 1;
}
}
OpenPOWER on IntegriCloud