svn commit: r209244 - in head/sys: kern sys
Ed Schouten
ed at FreeBSD.org
Thu Jun 17 08:49:31 UTC 2010
Author: ed
Date: Thu Jun 17 08:49:31 2010
New Revision: 209244
URL: http://svn.freebsd.org/changeset/base/209244
Log:
Remove the unit argument from the recently added make_dev_p().
New code that creates character devices shouldn't use device unit
numbers, but only si_drv[12] to hold pointer to per-device data. Make
this function more future proof by removing the unit number argument.
Discussed with: kib
Modified:
head/sys/kern/kern_conf.c
head/sys/sys/conf.h
Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c Thu Jun 17 05:03:01 2010 (r209243)
+++ head/sys/kern/kern_conf.c Thu Jun 17 08:49:31 2010 (r209244)
@@ -766,14 +766,14 @@ make_dev_credf(int flags, struct cdevsw
}
int
-make_dev_p(int flags, struct cdev **cdev, struct cdevsw *devsw, int unit,
+make_dev_p(int flags, struct cdev **cdev, struct cdevsw *devsw,
struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, ...)
{
va_list ap;
int res;
va_start(ap, fmt);
- res = make_dev_credv(flags, cdev, devsw, unit, cr, uid, gid, mode,
+ res = make_dev_credv(flags, cdev, devsw, 0, cr, uid, gid, mode,
fmt, ap);
va_end(ap);
Modified: head/sys/sys/conf.h
==============================================================================
--- head/sys/sys/conf.h Thu Jun 17 05:03:01 2010 (r209243)
+++ head/sys/sys/conf.h Thu Jun 17 08:49:31 2010 (r209244)
@@ -271,8 +271,8 @@ struct cdev *make_dev_credf(int _flags,
struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode,
const char *_fmt, ...) __printflike(8, 9);
int make_dev_p(int _flags, struct cdev **_cdev, struct cdevsw *_devsw,
- int _unit, struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode,
- const char *_fmt, ...) __printflike(9, 10);
+ struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode,
+ const char *_fmt, ...) __printflike(8, 9);
struct cdev *make_dev_alias(struct cdev *_pdev, const char *_fmt, ...)
__printflike(2, 3);
void dev_lock(void);
More information about the svn-src-all
mailing list