summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorrik <rik@FreeBSD.org>2004-03-02 16:44:07 +0000
committerrik <rik@FreeBSD.org>2004-03-02 16:44:07 +0000
commite6b8b4079475e26c80cb7397a61ba45f35fe199e (patch)
tree75f9f3030a20dc79fed9b474b25fa91b6b910824 /sys/dev
parentfe4ee75f221068445d562107382dae05426b1a08 (diff)
downloadFreeBSD-src-e6b8b4079475e26c80cb7397a61ba45f35fe199e.zip
FreeBSD-src-e6b8b4079475e26c80cb7397a61ba45f35fe199e.tar.gz
1. Fix compilation and panic while system boot problem after makedev was
changed to unde2dev. Approved by: imp (mentor)
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cx/if_cx.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c
index 9a3acc2..c287da2 100644
--- a/sys/dev/cx/if_cx.c
+++ b/sys/dev/cx/if_cx.c
@@ -19,7 +19,7 @@
* as long as this message is kept with the software, all derivative
* works or modified versions.
*
- * Cronyx Id: if_cx.c,v 1.1.2.22 2004/02/05 17:10:19 rik Exp $
+ * Cronyx Id: if_cx.c,v 1.1.2.23 2004/02/26 17:56:40 rik Exp $
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -2548,9 +2548,21 @@ static struct cdevsw cx_cdevsw = {
.d_dump = nodump,
.d_flags = D_TTY,
};
-#else /* __FreeBSD_version > 501000 */
+#elif __FreeBSD_version < 502103
static struct cdevsw cx_cdevsw = {
- .d_version = D_VERSION,
+ .d_open = cx_open,
+ .d_close = cx_close,
+ .d_read = cx_read,
+ .d_write = cx_write,
+ .d_ioctl = cx_ioctl,
+ .d_poll = ttypoll,
+ .d_name = "cx",
+ .d_maj = CDEV_MAJOR,
+ .d_flags = D_TTY,
+};
+#else /* __FreeBSD_version >= 502103 */
+static struct cdevsw cx_cdevsw = {
+ .d_version = D_VERSION,
.d_open = cx_open,
.d_close = cx_close,
.d_read = cx_read,
@@ -3105,10 +3117,16 @@ static int cx_modevent (module_t mod, int type, void *unused)
static int load_count = 0;
struct cdevsw *cdsw;
+#if __FreeBSD_version >= 502103
dev = udev2dev (makeudev(CDEV_MAJOR, 0));
+#else
+ dev = makedev (CDEV_MAJOR, 0);
+#endif
switch (type) {
case MOD_LOAD:
- if ((cdsw = devsw (dev)) && cdsw->d_maj == CDEV_MAJOR) {
+ if (dev != NODEV &&
+ (cdsw = devsw (dev)) &&
+ cdsw->d_maj == CDEV_MAJOR) {
printf ("Sigma driver is already in system\n");
return (EEXIST);
}
OpenPOWER on IntegriCloud