Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Simplify device-activation hooks.
details: https://anonhg.NetBSD.org/src/rev/f5d53a21bd29
branches: trunk
changeset: 749732:f5d53a21bd29
user: dyoung <dyoung%NetBSD.org@localhost>
date: Sun Dec 06 21:40:31 2009 +0000
description:
Simplify device-activation hooks.
diffstat:
sys/dev/usb/pseye.c | 15 +++++----------
sys/dev/usb/ubt.c | 16 ++++------------
sys/dev/usb/ucom.c | 12 +++++-------
sys/dev/usb/ucycom.c | 12 +++++-------
sys/dev/usb/ugen.c | 12 +++++-------
sys/dev/usb/uhid.c | 12 +++++-------
sys/dev/usb/ulpt.c | 12 +++++-------
sys/dev/usb/urio.c | 13 +++++--------
sys/dev/usb/uscanner.c | 12 +++++-------
sys/dev/usb/usscanner.c | 12 +++++-------
sys/dev/usb/utoppy.c | 12 +++++-------
11 files changed, 54 insertions(+), 86 deletions(-)
diffs (truncated from 411 to 300 lines):
diff -r ce946dc05d3b -r f5d53a21bd29 sys/dev/usb/pseye.c
--- a/sys/dev/usb/pseye.c Sun Dec 06 21:39:45 2009 +0000
+++ b/sys/dev/usb/pseye.c Sun Dec 06 21:40:31 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pseye.c,v 1.14 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: pseye.c,v 1.15 2009/12/06 21:40:31 dyoung Exp $ */
/*-
* Copyright (c) 2008 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pseye.c,v 1.14 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pseye.c,v 1.15 2009/12/06 21:40:31 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -309,19 +309,14 @@
pseye_activate(device_ptr_t self, enum devact act)
{
struct pseye_softc *sc = device_private(self);
- int rv;
-
- rv = 0;
switch (act) {
- case DVACT_ACTIVATE:
- break;
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
-
- return rv;
}
static void
diff -r ce946dc05d3b -r f5d53a21bd29 sys/dev/usb/ubt.c
--- a/sys/dev/usb/ubt.c Sun Dec 06 21:39:45 2009 +0000
+++ b/sys/dev/usb/ubt.c Sun Dec 06 21:40:31 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ubt.c,v 1.37 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: ubt.c,v 1.38 2009/12/06 21:40:31 dyoung Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.37 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.38 2009/12/06 21:40:31 dyoung Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -578,24 +578,16 @@
ubt_activate(device_ptr_t self, enum devact act)
{
struct ubt_softc *sc = USBGETSOFTC(self);
- int error = 0;
DPRINTFN(1, "sc=%p, act=%d\n", sc, act);
switch (act) {
- case DVACT_ACTIVATE:
- break;
-
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- break;
-
+ return 0;
default:
- error = EOPNOTSUPP;
- break;
+ return EOPNOTSUPP;
}
-
- return error;
}
/* set ISOC configuration */
diff -r ce946dc05d3b -r f5d53a21bd29 sys/dev/usb/ucom.c
--- a/sys/dev/usb/ucom.c Sun Dec 06 21:39:45 2009 +0000
+++ b/sys/dev/usb/ucom.c Sun Dec 06 21:40:31 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ucom.c,v 1.80 2009/07/30 19:57:07 skrll Exp $ */
+/* $NetBSD: ucom.c,v 1.81 2009/12/06 21:40:31 dyoung Exp $ */
/*
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.80 2009/07/30 19:57:07 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.81 2009/12/06 21:40:31 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -273,14 +273,12 @@
DPRINTFN(5,("ucom_activate: %d\n", act));
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
-
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (0);
}
void
diff -r ce946dc05d3b -r f5d53a21bd29 sys/dev/usb/ucycom.c
--- a/sys/dev/usb/ucycom.c Sun Dec 06 21:39:45 2009 +0000
+++ b/sys/dev/usb/ucycom.c Sun Dec 06 21:40:31 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ucycom.c,v 1.29 2009/08/06 07:07:30 skrll Exp $ */
+/* $NetBSD: ucycom.c,v 1.30 2009/12/06 21:40:31 dyoung Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.29 2009/08/06 07:07:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.30 2009/12/06 21:40:31 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -272,14 +272,12 @@
DPRINTFN(5,("ucycom_activate: %d\n", act));
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
-
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (0);
}
#if 0
diff -r ce946dc05d3b -r f5d53a21bd29 sys/dev/usb/ugen.c
--- a/sys/dev/usb/ugen.c Sun Dec 06 21:39:45 2009 +0000
+++ b/sys/dev/usb/ugen.c Sun Dec 06 21:40:31 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ugen.c,v 1.105 2009/09/24 22:33:04 pooka Exp $ */
+/* $NetBSD: ugen.c,v 1.106 2009/12/06 21:40:31 dyoung Exp $ */
/*
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.105 2009/09/24 22:33:04 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.106 2009/12/06 21:40:31 dyoung Exp $");
#include "opt_ugen_bulk_ra_wb.h"
#include "opt_compat_netbsd.h"
@@ -1000,14 +1000,12 @@
struct ugen_softc *sc = device_private(self);
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
-
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (0);
}
#endif
diff -r ce946dc05d3b -r f5d53a21bd29 sys/dev/usb/uhid.c
--- a/sys/dev/usb/uhid.c Sun Dec 06 21:39:45 2009 +0000
+++ b/sys/dev/usb/uhid.c Sun Dec 06 21:40:31 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uhid.c,v 1.82 2008/05/24 16:40:58 cube Exp $ */
+/* $NetBSD: uhid.c,v 1.83 2009/12/06 21:40:31 dyoung Exp $ */
/*
* Copyright (c) 1998, 2004, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhid.c,v 1.82 2008/05/24 16:40:58 cube Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhid.c,v 1.83 2009/12/06 21:40:31 dyoung Exp $");
#include "opt_compat_netbsd.h"
@@ -175,14 +175,12 @@
struct uhid_softc *sc = device_private(self);
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
-
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (0);
}
int
diff -r ce946dc05d3b -r f5d53a21bd29 sys/dev/usb/ulpt.c
--- a/sys/dev/usb/ulpt.c Sun Dec 06 21:39:45 2009 +0000
+++ b/sys/dev/usb/ulpt.c Sun Dec 06 21:40:31 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ulpt.c,v 1.83 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: ulpt.c,v 1.84 2009/12/06 21:40:31 dyoung Exp $ */
/* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */
/*
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ulpt.c,v 1.83 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ulpt.c,v 1.84 2009/12/06 21:40:31 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -364,14 +364,12 @@
struct ulpt_softc *sc = device_private(self);
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
-
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (0);
}
#endif
diff -r ce946dc05d3b -r f5d53a21bd29 sys/dev/usb/urio.c
--- a/sys/dev/usb/urio.c Sun Dec 06 21:39:45 2009 +0000
+++ b/sys/dev/usb/urio.c Sun Dec 06 21:40:31 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: urio.c,v 1.33 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: urio.c,v 1.34 2009/12/06 21:40:31 dyoung Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: urio.c,v 1.33 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: urio.c,v 1.34 2009/12/06 21:40:31 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -290,15 +290,12 @@
struct urio_softc *sc = device_private(self);
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
- break;
-
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (0);
Home |
Main Index |
Thread Index |
Old Index