Remove cmaj and bmaj args from DEV_DRIVER_MODULE.

This commit is contained in:
Poul-Henning Kamp 1999-07-04 14:58:56 +00:00
parent 1168ab0815
commit 03016f421b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=48557
27 changed files with 50 additions and 93 deletions

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: zs_tlsb.c,v 1.12 1999/05/10 14:01:35 dfr Exp $
* $Id: zs_tlsb.c,v 1.13 1999/05/30 16:50:54 phk Exp $
*/
/*
* This driver is a hopeless hack to get the SimOS console working. A real
@ -390,8 +390,7 @@ zsdevtotty(dev_t dev)
return (&sc->tty);
}
DEV_DRIVER_MODULE(zs, zsc, zs_driver, zs_devclass,
CDEV_MAJOR, NOMAJ, zs_cdevsw, 0, 0);
DEV_DRIVER_MODULE(zs, zsc, zs_driver, zs_devclass, zs_cdevsw, 0, 0);
/*
* The zsc bus holds two zs devices, one for channel A, one for channel B.

View File

@ -20,7 +20,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: psm.c,v 1.10 1999/05/30 16:52:47 phk Exp $
* $Id: psm.c,v 1.11 1999/06/03 12:40:53 yokota Exp $
*/
/*
@ -2292,7 +2292,6 @@ psmresume(void *dummy)
}
#endif /* PSM_HOOKAPM */
DEV_DRIVER_MODULE(psm, atkbdc, psm_driver, psm_devclass,
CDEV_MAJOR, NOMAJ, psm_cdevsw, 0, 0);
DEV_DRIVER_MODULE(psm, atkbdc, psm_driver, psm_devclass, psm_cdevsw, 0, 0);
#endif /* NPSM > 0 */

View File

@ -1,4 +1,4 @@
/* $Id: brooktree848.c,v 1.86 1999/06/13 16:05:00 roger Exp $ */
/* $Id: brooktree848.c,v 1.87 1999/07/03 20:17:00 peter Exp $ */
/* BT848 Driver for Brooktree's Bt848, Bt848A, Bt849A, Bt878, Bt879 based cards.
The Brooktree BT848 Driver driver is based upon Mark Tinguely and
Jim Lowe's driver for the Matrox Meteor PCI card . The
@ -613,8 +613,7 @@ static struct cdevsw bktr_cdevsw = {
/* bmaj */ -1
};
DEV_DRIVER_MODULE(bktr, pci, bktr_driver, bktr_devclass, CDEV_MAJOR, NOMAJ,
bktr_cdevsw, 0, 0);
DEV_DRIVER_MODULE(bktr, pci, bktr_driver, bktr_devclass, bktr_cdevsw, 0, 0);
#endif /* __FreeBSD__ */

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: fb.c,v 1.5 1999/05/31 11:24:38 phk Exp $
* $Id: fb.c,v 1.6 1999/06/22 14:13:22 yokota Exp $
*/
#include "fb.h"
@ -508,8 +508,7 @@ fbmmap(dev_t dev, vm_offset_t offset, int nprot)
}
#if experimental
DEV_DRIVER_MODULE(fb, ???, fb_driver, fb_devclass,
CDEV_MAJOR, NOMAJ, fb_cdevsw, 0, 0);
DEV_DRIVER_MODULE(fb, ???, fb_driver, fb_devclass, fb_cdevsw, 0, 0);
#endif
/*

View File

@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
* $Id: fd.c,v 1.146 1999/05/31 18:39:16 dfr Exp $
* $Id: fd.c,v 1.147 1999/06/26 02:46:52 mckusick Exp $
*
*/
@ -2384,8 +2384,7 @@ static driver_t fd_driver = {
sizeof(struct fd_data)
};
DEV_DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, CDEV_MAJOR, BDEV_MAJOR,
fd_cdevsw, 0, 0);
DEV_DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, fd_cdevsw, 0, 0);
#endif /* NFDC > 0 */

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: ida_disk.c,v 1.1 1999/06/24 03:31:57 jlemon Exp $
*/
/*
@ -327,5 +327,4 @@ idattach(device_t dev)
return (0);
}
DEV_DRIVER_MODULE(id, ida, id_driver, id_devclass,
ID_CDEV_MAJOR, ID_BDEV_MAJOR, id_cdevsw, 0, 0);
DEV_DRIVER_MODULE(id, ida, id_driver, id_devclass, id_cdevsw, 0, 0);

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: iic.c,v 1.11 1999/05/30 16:51:28 phk Exp $
* $Id: iic.c,v 1.12 1999/05/31 11:24:43 phk Exp $
*
*/
#include <sys/param.h>
@ -283,5 +283,4 @@ iicioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
return (error);
}
DEV_DRIVER_MODULE(iic, iicbus, iic_driver, iic_devclass, CDEV_MAJOR,
NOMAJ, iic_cdevsw, 0, 0);
DEV_DRIVER_MODULE(iic, iicbus, iic_driver, iic_devclass, iic_cdevsw, 0, 0);

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: sio.c,v 1.249 1999/06/20 13:10:09 peter Exp $
* $Id: sio.c,v 1.251 1999/06/29 17:34:16 yokota Exp $
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* from: i386/isa sio.c,v 1.234
*/
@ -3197,5 +3197,4 @@ siopnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
}
#endif
DEV_DRIVER_MODULE(sio, isa, sio_driver, sio_devclass,
CDEV_MAJOR, NOMAJ, sio_cdevsw, 0, 0);
DEV_DRIVER_MODULE(sio, isa, sio_driver, sio_devclass, sio_cdevsw, 0, 0);

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: smb.c,v 1.12 1999/05/30 16:51:37 phk Exp $
* $Id: smb.c,v 1.13 1999/05/31 11:25:05 phk Exp $
*
*/
#include <sys/param.h>
@ -276,5 +276,4 @@ smbioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
return (error);
}
DEV_DRIVER_MODULE(smb, smbus, smb_driver, smb_devclass, CDEV_MAJOR, NOMAJ,
smb_cdevsw, 0, 0);
DEV_DRIVER_MODULE(smb, smbus, smb_driver, smb_devclass, smb_cdevsw, 0, 0);

View File

@ -1012,6 +1012,5 @@ ugen_detach(device_t self)
return 0;
}
DEV_DRIVER_MODULE(ugen, uhub, ugen_driver, ugen_devclass,
UGEN_CDEV_MAJOR, NOMAJ, ugen_cdevsw, usbd_driver_load, 0);
DEV_DRIVER_MODULE(ugen, uhub, ugen_driver, ugen_devclass, ugen_cdevsw, usbd_driver_load, 0);
#endif

View File

@ -577,6 +577,6 @@ uhidpoll(dev, events, p)
}
#if defined(__FreeBSD__)
DEV_DRIVER_MODULE(uhid, uhub, uhid_driver, uhid_devclass,
UHID_CDEV_MAJOR, NOMAJ, uhid_cdevsw, usbd_driver_load, 0);
DEV_DRIVER_MODULE(uhid, uhub, uhid_driver, uhid_devclass,
uhid_cdevsw, usbd_driver_load, 0);
#endif

View File

@ -453,6 +453,5 @@ ulpt_detach(device_t self)
return 0;
}
DEV_DRIVER_MODULE(ulpt, uhub, ulpt_driver, ulpt_devclass,
ULPT_CDEV_MAJOR, NOMAJ, ulpt_cdevsw, usbd_driver_load, 0);
DEV_DRIVER_MODULE(ulpt, uhub, ulpt_driver, ulpt_devclass, ulpt_cdevsw, usbd_driver_load, 0);
#endif

View File

@ -846,6 +846,6 @@ ums_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
#endif
#if defined(__FreeBSD__)
DEV_DRIVER_MODULE(ums, uhub, ums_driver, ums_devclass,
UMS_CDEV_MAJOR, NOMAJ, ums_cdevsw, usbd_driver_load, 0);
DEV_DRIVER_MODULE(ums, uhub, ums_driver, ums_devclass,
ums_cdevsw, usbd_driver_load, 0);
#endif

View File

@ -15,7 +15,7 @@
*
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
* $Id: apm.c,v 1.87 1999/05/30 16:52:01 phk Exp $
* $Id: apm.c,v 1.88 1999/06/01 18:17:50 jlemon Exp $
*/
#include "opt_devfs.h"
@ -1074,5 +1074,4 @@ static driver_t apm_driver = {
static devclass_t apm_devclass;
DEV_DRIVER_MODULE(apm, nexus, apm_driver, apm_devclass,
CDEV_MAJOR, NOMAJ, apm_cdevsw, 0, 0);
DEV_DRIVER_MODULE(apm, nexus, apm_driver, apm_devclass, apm_cdevsw, 0, 0);

View File

@ -15,7 +15,7 @@
*
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
* $Id: apm.c,v 1.87 1999/05/30 16:52:01 phk Exp $
* $Id: apm.c,v 1.88 1999/06/01 18:17:50 jlemon Exp $
*/
#include "opt_devfs.h"
@ -1074,5 +1074,4 @@ static driver_t apm_driver = {
static devclass_t apm_devclass;
DEV_DRIVER_MODULE(apm, nexus, apm_driver, apm_devclass,
CDEV_MAJOR, NOMAJ, apm_cdevsw, 0, 0);
DEV_DRIVER_MODULE(apm, nexus, apm_driver, apm_devclass, apm_cdevsw, 0, 0);

View File

@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
* $Id: fd.c,v 1.146 1999/05/31 18:39:16 dfr Exp $
* $Id: fd.c,v 1.147 1999/06/26 02:46:52 mckusick Exp $
*
*/
@ -2384,8 +2384,7 @@ static driver_t fd_driver = {
sizeof(struct fd_data)
};
DEV_DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, CDEV_MAJOR, BDEV_MAJOR,
fd_cdevsw, 0, 0);
DEV_DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, fd_cdevsw, 0, 0);
#endif /* NFDC > 0 */

View File

@ -20,7 +20,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: psm.c,v 1.10 1999/05/30 16:52:47 phk Exp $
* $Id: psm.c,v 1.11 1999/06/03 12:40:53 yokota Exp $
*/
/*
@ -2292,7 +2292,6 @@ psmresume(void *dummy)
}
#endif /* PSM_HOOKAPM */
DEV_DRIVER_MODULE(psm, atkbdc, psm_driver, psm_devclass,
CDEV_MAJOR, NOMAJ, psm_cdevsw, 0, 0);
DEV_DRIVER_MODULE(psm, atkbdc, psm_driver, psm_devclass, psm_cdevsw, 0, 0);
#endif /* NPSM > 0 */

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: sio.c,v 1.249 1999/06/20 13:10:09 peter Exp $
* $Id: sio.c,v 1.251 1999/06/29 17:34:16 yokota Exp $
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* from: i386/isa sio.c,v 1.234
*/
@ -3197,5 +3197,4 @@ siopnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
}
#endif
DEV_DRIVER_MODULE(sio, isa, sio_driver, sio_devclass,
CDEV_MAJOR, NOMAJ, sio_cdevsw, 0, 0);
DEV_DRIVER_MODULE(sio, isa, sio_driver, sio_devclass, sio_cdevsw, 0, 0);

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: kern_conf.c,v 1.45 1999/06/26 11:39:27 dfr Exp $
* $Id: kern_conf.c,v 1.46 1999/07/03 08:22:30 phk Exp $
*/
#include <sys/param.h>
@ -157,23 +157,9 @@ devsw_module_handler(module_t mod, int what, void* arg)
struct devsw_module_data* data = (struct devsw_module_data*) arg;
int error = 0;
if (data->cmaj == NOMAJ)
data->cdev = NODEV;
else
data->cdev = makedev(data->cmaj, 0);
switch (what) {
case MOD_LOAD:
error = cdevsw_add(data->cdevsw);
if (!error && data->cdevsw->d_strategy != nostrategy) {
if (data->bmaj == NOMAJ) {
data->bdev = data->cdev;
data->bmaj = data->cmaj;
} else {
data->bdev = makedev(data->bmaj, 0);
}
data->cdevsw->d_maj = data->bmaj;
bmaj2cmaj[major(data->bdev)] = major(data->cdev);
}
if (!error && data->chainevh)
error = data->chainevh(mod, what, data->chainarg);
return error;

View File

@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
* $Id: fd.c,v 1.64 1999/06/26 02:47:16 mckusick Exp $
* $Id: fd.c,v 1.65 1999/06/28 14:01:03 kato Exp $
*
*/
@ -2794,8 +2794,7 @@ static driver_t fd_driver = {
sizeof(struct fd_data)
};
DEV_DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, CDEV_MAJOR, BDEV_MAJOR,
fd_cdevsw, 0, 0);
DEV_DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, fd_cdevsw, 0, 0);
#endif /* NFDC > 0 */

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: sio.c,v 1.97 1999/05/30 16:53:22 phk Exp $
* $Id: sio.c,v 1.98 1999/06/24 10:51:35 kato Exp $
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* from: i386/isa sio.c,v 1.234
*/
@ -4470,8 +4470,7 @@ siopnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
}
#endif
DEV_DRIVER_MODULE(sio, isa, sio_driver, sio_devclass,
CDEV_MAJOR, NOMAJ, sio_cdevsw, 0, 0);
DEV_DRIVER_MODULE(sio, isa, sio_driver, sio_devclass, sio_cdevsw, 0, 0);
#ifdef PC98
/*

View File

@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
* $Id: fd.c,v 1.64 1999/06/26 02:47:16 mckusick Exp $
* $Id: fd.c,v 1.65 1999/06/28 14:01:03 kato Exp $
*
*/
@ -2794,8 +2794,7 @@ static driver_t fd_driver = {
sizeof(struct fd_data)
};
DEV_DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, CDEV_MAJOR, BDEV_MAJOR,
fd_cdevsw, 0, 0);
DEV_DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, fd_cdevsw, 0, 0);
#endif /* NFDC > 0 */

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: sio.c,v 1.97 1999/05/30 16:53:22 phk Exp $
* $Id: sio.c,v 1.98 1999/06/24 10:51:35 kato Exp $
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* from: i386/isa sio.c,v 1.234
*/
@ -4470,8 +4470,7 @@ siopnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
}
#endif
DEV_DRIVER_MODULE(sio, isa, sio_driver, sio_devclass,
CDEV_MAJOR, NOMAJ, sio_cdevsw, 0, 0);
DEV_DRIVER_MODULE(sio, isa, sio_driver, sio_devclass, sio_cdevsw, 0, 0);
#ifdef PC98
/*

View File

@ -1,4 +1,4 @@
/* $Id: brooktree848.c,v 1.86 1999/06/13 16:05:00 roger Exp $ */
/* $Id: brooktree848.c,v 1.87 1999/07/03 20:17:00 peter Exp $ */
/* BT848 Driver for Brooktree's Bt848, Bt848A, Bt849A, Bt878, Bt879 based cards.
The Brooktree BT848 Driver driver is based upon Mark Tinguely and
Jim Lowe's driver for the Matrox Meteor PCI card . The
@ -613,8 +613,7 @@ static struct cdevsw bktr_cdevsw = {
/* bmaj */ -1
};
DEV_DRIVER_MODULE(bktr, pci, bktr_driver, bktr_devclass, CDEV_MAJOR, NOMAJ,
bktr_cdevsw, 0, 0);
DEV_DRIVER_MODULE(bktr, pci, bktr_driver, bktr_devclass, bktr_cdevsw, 0, 0);
#endif /* __FreeBSD__ */

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: bus.h,v 1.18 1999/05/28 09:25:14 dfr Exp $
* $Id: bus.h,v 1.19 1999/05/30 10:27:02 dfr Exp $
*/
#ifndef _SYS_BUS_H_
@ -350,10 +350,10 @@ DECLARE_MODULE(name##_##busname, name##_##busname##_mod, \
SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
#define DEV_DRIVER_MODULE(name, busname, driver, devclass, \
cmajor, bmajor, devsw, evh, arg) \
devsw, evh, arg) \
\
static struct devsw_module_data name##_##busname##_devsw_mod = { \
evh, arg, bmajor, cmajor, &devsw \
evh, arg, &devsw \
}; \
\
DRIVER_MODULE(name, busname, driver, devclass, \

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)conf.h 8.5 (Berkeley) 1/9/95
* $Id: conf.h,v 1.59 1999/06/01 18:56:26 phk Exp $
* $Id: conf.h,v 1.60 1999/06/25 07:49:01 grog Exp $
*/
#ifndef _SYS_CONF_H_
@ -198,12 +198,8 @@ struct module;
struct devsw_module_data {
int (*chainevh)(struct module *, int, void *); /* next handler */
void *chainarg; /* arg for next event handler */
int bmaj; /* device major to use */
int cmaj; /* device major to use */
struct cdevsw *cdevsw; /* device functions */
/* Do not initialize fields hereafter */
dev_t bdev;
dev_t cdev;
};
#define DEV_MODULE(name, cmaj, bmaj, devsw, evh, arg) \

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)conf.h 8.5 (Berkeley) 1/9/95
* $Id: conf.h,v 1.59 1999/06/01 18:56:26 phk Exp $
* $Id: conf.h,v 1.60 1999/06/25 07:49:01 grog Exp $
*/
#ifndef _SYS_CONF_H_
@ -198,12 +198,8 @@ struct module;
struct devsw_module_data {
int (*chainevh)(struct module *, int, void *); /* next handler */
void *chainarg; /* arg for next event handler */
int bmaj; /* device major to use */
int cmaj; /* device major to use */
struct cdevsw *cdevsw; /* device functions */
/* Do not initialize fields hereafter */
dev_t bdev;
dev_t cdev;
};
#define DEV_MODULE(name, cmaj, bmaj, devsw, evh, arg) \