diff options
author | akiyama <akiyama@FreeBSD.org> | 2008-02-24 12:16:01 +0000 |
---|---|---|
committer | akiyama <akiyama@FreeBSD.org> | 2008-02-24 12:16:01 +0000 |
commit | 3d3662f90b2bd1277781759f136fa4f543d8f7db (patch) | |
tree | eb66a592393d8cd31cf3e92ba4d519ba6e0375b4 | |
parent | 166cb6ef20bafa38ee6d28167ba82881e636509b (diff) | |
download | FreeBSD-src-3d3662f90b2bd1277781759f136fa4f543d8f7db.zip FreeBSD-src-3d3662f90b2bd1277781759f136fa4f543d8f7db.tar.gz |
o Add module event handler.
Now ucom kernel module can unload properly.
o Update copyright year.
PR: usb/88966
MFC after: 1 week
-rw-r--r-- | sys/dev/usb/ucom.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index aaa06d3..20fb7ea 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -1,7 +1,8 @@ /* $NetBSD: ucom.c,v 1.40 2001/11/13 06:24:54 lukem Exp $ */ /*- - * Copyright (c) 2001-2003, 2005 Shunsuke Akiyama <akiyama@jp.FreeBSD.org>. + * Copyright (c) 2001-2003, 2005, 2008 + * Shunsuke Akiyama <akiyama@jp.FreeBSD.org>. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -113,6 +114,7 @@ SYSCTL_INT(_hw_usb_ucom, OID_AUTO, debug, CTLFLAG_RW, #define DPRINTFN(n, x) #endif +static int ucom_modevent(module_t, int, void *); static void ucom_cleanup(struct ucom_softc *); static int ucomparam(struct tty *, struct termios *); static void ucomstart(struct tty *); @@ -135,7 +137,7 @@ devclass_t ucom_devclass; static moduledata_t ucom_mod = { "ucom", - NULL, + ucom_modevent, NULL }; @@ -143,6 +145,21 @@ DECLARE_MODULE(ucom, ucom_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); MODULE_DEPEND(ucom, usb, 1, 1, 1); MODULE_VERSION(ucom, UCOM_MODVER); +static int +ucom_modevent(module_t mod, int type, void *data) +{ + switch (type) { + case MOD_LOAD: + break; + case MOD_UNLOAD: + break; + default: + return (EOPNOTSUPP); + break; + } + return (0); +} + int ucom_attach(struct ucom_softc *sc) { |