as suggested by mpi, remove activate functions from devices
under uhidev which don't do anything with them. remove unused
DPRINTFN while there.
I don't have either of these devices to test running with them;
if they can be unplugged without a panic then the diff works.
Index: utrh.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/utrh.c,v
retrieving revision 1.10
diff -u -p -r1.10 utrh.c
--- utrh.c 15 Apr 2013 09:23:02 -0000 1.10
+++ utrh.c 8 May 2013 20:42:53 -0000
@@ -39,14 +39,11 @@
#endif
#ifdef UTRH_DEBUG
-int utrhdebug = 0;
-#define DPRINTFN(n, x) do { if (utrhdebug > (n)) printf x; } while (0)
+#define DPRINTF(x) do { printf x; } while (0)
#else
-#define DPRINTFN(n, x)
+#define DPRINTF(x)
#endif
-#define DPRINTF(x) DPRINTFN(0, x)
-
/* sensors */
#define UTRH_TEMP 0
#define UTRH_HUMIDITY 1
@@ -55,8 +52,6 @@ int utrhdebug = 0;
struct utrh_softc {
struct uhidev sc_hdev;
struct usbd_device *sc_udev;
- u_char sc_dying;
- uint16_t sc_flag;
/* uhidev parameters */
size_t sc_flen; /* feature report length */
@@ -80,7 +75,6 @@ const struct usb_devno utrh_devs[] = {
int utrh_match(struct device *, void *, void *);
void utrh_attach(struct device *, struct device *, void *);
int utrh_detach(struct device *, int);
-int utrh_activate(struct device *, int);
int utrh_sht1x_temp(unsigned int);
int utrh_sht1x_rh(unsigned int, int);
@@ -96,8 +90,7 @@ const struct cfattach utrh_ca = {
sizeof(struct utrh_softc),
utrh_match,
utrh_attach,
- utrh_detach,
- utrh_activate,
+ utrh_detach
};
int
@@ -190,19 +183,6 @@ utrh_detach(struct device *self, int fla
}
return (rv);
-}
-
-int
-utrh_activate(struct device *self, int act)
-{
- struct utrh_softc *sc = (struct utrh_softc *)self;
-
- switch (act) {
- case DVACT_DEACTIVATE:
- sc->sc_dying = 1;
- break;
- }
- return (0);
}
void
Index: utwitch.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/utwitch.c,v
retrieving revision 1.7
diff -u -p -r1.7 utwitch.c
--- utwitch.c 15 Apr 2013 09:23:02 -0000 1.7
+++ utwitch.c 8 May 2013 20:42:53 -0000
@@ -51,19 +51,14 @@
#define UPDATE_TICK 5 /* sec */
#ifdef UYUREX_DEBUG
-int utwitchdebug = 0;
-#define DPRINTFN(n, x) do { if (utwitchdebug > (n)) printf x; } while (0)
+#define DPRINTF(x) do { printf x; } while (0)
#else
-#define DPRINTFN(n, x)
+#define DPRINTF(x)
#endif
-#define DPRINTF(x) DPRINTFN(0, x)
-
struct utwitch_softc {
struct uhidev sc_hdev;
struct usbd_device *sc_udev;
- u_char sc_dying;
- uint16_t sc_flag;
/* uhidev parameters */
size_t sc_flen; /* feature report length */
@@ -94,7 +89,6 @@ const struct usb_devno utwitch_devs[] =
int utwitch_match(struct device *, void *, void *);
void utwitch_attach(struct device *, struct device *, void *);
int utwitch_detach(struct device *, int);
-int utwitch_activate(struct device *, int);
void utwitch_set_mode(struct utwitch_softc *, uint8_t);
void utwitch_read_value_request(struct utwitch_softc *);
@@ -111,8 +105,7 @@ const struct cfattach utwitch_ca = {
sizeof(struct utwitch_softc),
utwitch_match,
utwitch_attach,
- utwitch_detach,
- utwitch_activate,
+ utwitch_detach
};
int
@@ -191,8 +184,6 @@ utwitch_detach(struct device *self, int
struct utwitch_softc *sc = (struct utwitch_softc *)self;
int rv = 0;
- sc->sc_dying = 1;
-
wakeup(&sc->sc_sensortask);
sensordev_deinstall(&sc->sc_sensordev);
sensor_detach(&sc->sc_sensordev, &sc->sc_sensor_val);
@@ -206,19 +197,6 @@ utwitch_detach(struct device *self, int
}
return (rv);
-}
-
-int
-utwitch_activate(struct device *self, int act)
-{
- struct utwitch_softc *sc = (struct utwitch_softc *)self;
-
- switch (act) {
- case DVACT_DEACTIVATE:
- sc->sc_dying = 1;
- break;
- }
- return (0);
}
void