summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2013-08-17 08:34:46 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2013-08-17 08:34:46 +0000
commitd96e6558c546a4e9b75574d268fbf8b888e2f4d2 (patch)
tree4129088df59e49dadab32a14958a7625cb2d9710
parentf7fbec4709827c74cde1722c0ca9d86f05b531e0 (diff)
Remove unnecessary activate functions and unused DPRINTFN macros.
Req by and OK mpi@.
-rw-r--r--sys/dev/usb/utrh.c28
-rw-r--r--sys/dev/usb/utwitch.c30
2 files changed, 8 insertions, 50 deletions
diff --git a/sys/dev/usb/utrh.c b/sys/dev/usb/utrh.c
index 1e178d2f32b..5b6ccb5466b 100644
--- a/sys/dev/usb/utrh.c
+++ b/sys/dev/usb/utrh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utrh.c,v 1.10 2013/04/15 09:23:02 mglocker Exp $ */
+/* $OpenBSD: utrh.c,v 1.11 2013/08/17 08:34:45 sthen Exp $ */
/*
* Copyright (c) 2009 Yojiro UO <yuo@nui.org>
@@ -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
@@ -192,19 +185,6 @@ utrh_detach(struct device *self, int flags)
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
utrh_intr(struct uhidev *addr, void *ibuf, u_int len)
{
diff --git a/sys/dev/usb/utwitch.c b/sys/dev/usb/utwitch.c
index e8288f9c24c..1fe7dc4794a 100644
--- a/sys/dev/usb/utwitch.c
+++ b/sys/dev/usb/utwitch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utwitch.c,v 1.7 2013/04/15 09:23:02 mglocker Exp $ */
+/* $OpenBSD: utwitch.c,v 1.8 2013/08/17 08:34:45 sthen Exp $ */
/*
* Copyright (c) 2010 Yojiro UO <yuo@nui.org>
@@ -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 flags)
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);
@@ -208,19 +199,6 @@ utwitch_detach(struct device *self, int flags)
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
utwitch_intr(struct uhidev *addr, void *ibuf, u_int len)
{