From 70cd7713375b9351501f68831aea1c52a7b9be47 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sat, 27 Sep 2003 12:01:01 +0000 Subject: The present defaults for the open and close for device drivers which provide no methods does not make any sense, and is not used by any driver. It is a pretty hard to come up with even a theoretical concept of a device driver which would always fail open and close with ENODEV. Change the defaults to be nullopen() and nullclose() which simply does nothing. Remove explicit initializations to these from the drivers which already used them. --- sys/dev/adlink/adlink.c | 1 - sys/dev/ata/ata-all.c | 2 -- sys/dev/isp/isp_freebsd.c | 2 -- sys/dev/md/md.c | 2 -- sys/dev/null/null.c | 4 ---- sys/dev/ofw/openfirmio.c | 2 -- 6 files changed, 13 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/adlink/adlink.c b/sys/dev/adlink/adlink.c index 53c81de45e0e..909f2ba9a28c 100644 --- a/sys/dev/adlink/adlink.c +++ b/sys/dev/adlink/adlink.c @@ -394,7 +394,6 @@ adlink_intr(void *arg) static struct cdevsw adlink_cdevsw = { .d_open = adlink_open, - .d_close = nullclose, .d_ioctl = adlink_ioctl, .d_mmap = adlink_mmap, .d_name = "adlink", diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 010c2c2a7f76..580f1ea44b75 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$"); /* device structures */ static d_ioctl_t ata_ioctl; static struct cdevsw ata_cdevsw = { - .d_open = nullopen, - .d_close = nullclose, .d_ioctl = ata_ioctl, .d_name = "ata", .d_maj = 159, diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index ad1dab61495c..bd41b7029b0c 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -54,8 +54,6 @@ static void isp_action(struct cam_sim *, union ccb *); #define ISP_CDEV_MAJOR 248 static struct cdevsw isp_cdevsw = { - .d_open = nullopen, - .d_close = nullclose, .d_ioctl = ispioctl, .d_name = "isp", .d_maj = ISP_CDEV_MAJOR, diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index d79a4accc40b..58090ff97166 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -116,8 +116,6 @@ static dev_t status_dev = 0; static d_ioctl_t mdctlioctl; static struct cdevsw mdctl_cdevsw = { - .d_open = nullopen, - .d_close = nullclose, .d_ioctl = mdctlioctl, .d_name = MD_NAME, .d_maj = CDEV_MAJOR diff --git a/sys/dev/null/null.c b/sys/dev/null/null.c index 6afa67eaa691..4044bc7ef83c 100644 --- a/sys/dev/null/null.c +++ b/sys/dev/null/null.c @@ -53,8 +53,6 @@ static d_read_t null_read; #define ZERO_MINOR 12 static struct cdevsw null_cdevsw = { - .d_open = nullopen, - .d_close = nullclose, .d_read = null_read, .d_write = null_write, .d_ioctl = null_ioctl, @@ -64,8 +62,6 @@ static struct cdevsw null_cdevsw = { }; static struct cdevsw zero_cdevsw = { - .d_open = nullopen, - .d_close = nullclose, .d_read = zero_read, .d_write = null_write, .d_name = "zero", diff --git a/sys/dev/ofw/openfirmio.c b/sys/dev/ofw/openfirmio.c index cdf2a09eb890..37f10b5202a9 100644 --- a/sys/dev/ofw/openfirmio.c +++ b/sys/dev/ofw/openfirmio.c @@ -67,8 +67,6 @@ static d_ioctl_t openfirm_ioctl; #define OPENFIRM_MINOR 0 static struct cdevsw openfirm_cdevsw = { - .d_open = nullopen, - .d_close = nullclose, .d_ioctl = openfirm_ioctl, .d_name = "openfirm", }; -- cgit v1.3