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 activation hooks. (sc_dying must die!)
details: https://anonhg.NetBSD.org/src/rev/982fd0318113
branches: trunk
changeset: 749000:982fd0318113
user: dyoung <dyoung%NetBSD.org@localhost>
date: Thu Nov 12 19:58:27 2009 +0000
description:
Simplify activation hooks. (sc_dying must die!)
diffstat:
sys/dev/usb/uhidev.c | 19 ++++---------------
sys/dev/usb/uhmodem.c | 18 +++++-------------
sys/dev/usb/uipaq.c | 16 +++++-----------
sys/dev/usb/uirda.c | 16 +++++-----------
sys/dev/usb/ukbd.c | 15 +++++----------
sys/dev/usb/umass.c | 15 ++++-----------
sys/dev/usb/umct.c | 15 +++++----------
sys/dev/usb/umidi.c | 39 ++++++++++++++-------------------------
sys/dev/usb/umodem_common.c | 16 +++++-----------
sys/dev/usb/ums.c | 15 +++++----------
sys/dev/usb/uplcom.c | 15 +++++----------
sys/dev/usb/uslsa.c | 16 +++++-----------
sys/dev/usb/ustir.c | 15 +++++----------
sys/dev/usb/uvideo.c | 19 ++++++-------------
sys/dev/usb/uvisor.c | 18 +++++-------------
sys/dev/usb/uvscom.c | 15 +++++----------
sys/dev/usb/xboxcontroller.c | 19 ++++++-------------
17 files changed, 94 insertions(+), 207 deletions(-)
diffs (truncated from 779 to 300 lines):
diff -r cd9e84ee83e5 -r 982fd0318113 sys/dev/usb/uhidev.c
--- a/sys/dev/usb/uhidev.c Thu Nov 12 19:53:56 2009 +0000
+++ b/sys/dev/usb/uhidev.c Thu Nov 12 19:58:27 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uhidev.c,v 1.44 2009/11/06 04:42:27 rafal Exp $ */
+/* $NetBSD: uhidev.c,v 1.45 2009/11/12 19:58:27 dyoung Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.44 2009/11/06 04:42:27 rafal Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.45 2009/11/12 19:58:27 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -356,25 +356,14 @@
uhidev_activate(device_t self, enum devact act)
{
struct uhidev_softc *sc = device_private(self);
- int i, rv;
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
-
case DVACT_DEACTIVATE:
- rv = 0;
- for (i = 0; i < sc->sc_nrepid; i++)
- if (sc->sc_subdevs[i] != NULL)
- rv |= config_deactivate(
- sc->sc_subdevs[i]);
sc->sc_dying = 1;
- break;
+ return 0;
default:
- rv = 0;
- break;
+ return EOPNOTSUPP;
}
- return (rv);
}
void
diff -r cd9e84ee83e5 -r 982fd0318113 sys/dev/usb/uhmodem.c
--- a/sys/dev/usb/uhmodem.c Thu Nov 12 19:53:56 2009 +0000
+++ b/sys/dev/usb/uhmodem.c Thu Nov 12 19:58:27 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uhmodem.c,v 1.8 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: uhmodem.c,v 1.9 2009/11/12 19:58:27 dyoung Exp $ */
/*
* Copyright (c) 2008 Yojiro UO <yuo%nui.org@localhost>.
@@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhmodem.c,v 1.8 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhmodem.c,v 1.9 2009/11/12 19:58:27 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -422,22 +422,14 @@
uhmodem_activate(device_t self, enum devact act)
{
struct uhmodem_softc *sc = device_private(self);
- int rv = 0;
- int i;
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
-
case DVACT_DEACTIVATE:
- for (i = 0; i < sc->sc_ubsa.sc_numif; i++) {
- if (sc->sc_ubsa.sc_subdevs[i] != NULL)
- rv |= config_deactivate(sc->sc_ubsa.sc_subdevs[i]);
- }
sc->sc_ubsa.sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (rv);
}
Static int
diff -r cd9e84ee83e5 -r 982fd0318113 sys/dev/usb/uipaq.c
--- a/sys/dev/usb/uipaq.c Thu Nov 12 19:53:56 2009 +0000
+++ b/sys/dev/usb/uipaq.c Thu Nov 12 19:58:27 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipaq.c,v 1.14 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: uipaq.c,v 1.15 2009/11/12 19:58:27 dyoung Exp $ */
/* $OpenBSD: uipaq.c,v 1.1 2005/06/17 23:50:33 deraadt Exp $ */
/*
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipaq.c,v 1.14 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipaq.c,v 1.15 2009/11/12 19:58:27 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -362,20 +362,14 @@
uipaq_activate(device_t self, enum devact act)
{
struct uipaq_softc *sc = device_private(self);
- int rv = 0;
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
- break;
-
case DVACT_DEACTIVATE:
- if (sc->sc_subdev != NULL)
- rv = config_deactivate(sc->sc_subdev);
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (rv);
}
void
diff -r cd9e84ee83e5 -r 982fd0318113 sys/dev/usb/uirda.c
--- a/sys/dev/usb/uirda.c Thu Nov 12 19:53:56 2009 +0000
+++ b/sys/dev/usb/uirda.c Thu Nov 12 19:58:27 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uirda.c,v 1.32 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: uirda.c,v 1.33 2009/11/12 19:58:27 dyoung Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uirda.c,v 1.32 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uirda.c,v 1.33 2009/11/12 19:58:27 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -344,20 +344,14 @@
uirda_activate(device_t self, enum devact act)
{
struct uirda_softc *sc = device_private(self);
- int error = 0;
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
- break;
-
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- if (sc->sc_child != NULL)
- error = config_deactivate(sc->sc_child);
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (error);
}
int
diff -r cd9e84ee83e5 -r 982fd0318113 sys/dev/usb/ukbd.c
--- a/sys/dev/usb/ukbd.c Thu Nov 12 19:53:56 2009 +0000
+++ b/sys/dev/usb/ukbd.c Thu Nov 12 19:58:27 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ukbd.c,v 1.104 2009/07/11 18:26:58 jakllsch Exp $ */
+/* $NetBSD: ukbd.c,v 1.105 2009/11/12 19:58:27 dyoung Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.104 2009/07/11 18:26:58 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.105 2009/11/12 19:58:27 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -416,19 +416,14 @@
ukbd_activate(device_t self, enum devact act)
{
struct ukbd_softc *sc = device_private(self);
- int rv = 0;
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
-
case DVACT_DEACTIVATE:
- if (sc->sc_wskbddev != NULL)
- rv = config_deactivate(sc->sc_wskbddev);
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (rv);
}
int
diff -r cd9e84ee83e5 -r 982fd0318113 sys/dev/usb/umass.c
--- a/sys/dev/usb/umass.c Thu Nov 12 19:53:56 2009 +0000
+++ b/sys/dev/usb/umass.c Thu Nov 12 19:58:27 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umass.c,v 1.135 2009/10/30 16:22:32 is Exp $ */
+/* $NetBSD: umass.c,v 1.136 2009/11/12 19:58:27 dyoung Exp $ */
/*
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.135 2009/10/30 16:22:32 is Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.136 2009/11/12 19:58:27 dyoung Exp $");
#include "atapibus.h"
#include "scsibus.h"
@@ -707,21 +707,14 @@
umass_activate(device_t dev, enum devact act)
{
struct umass_softc *sc = device_private(dev);
- struct umassbus_softc *scbus = sc->bus;
- int rv;
DPRINTF(UDMASS_USB, ("%s: umass_activate: %d\n",
- device_xname(sc->sc_dev), act));
+ device_xname(dev), act));
switch (act) {
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- if (scbus == NULL || scbus->sc_child == NULL)
- return 0;
- rv = config_deactivate(scbus->sc_child);
- DPRINTF(UDMASS_USB, ("%s: umass_deactivate: child "
- "returned %d\n", device_xname(sc->sc_dev), rv));
- return rv;
+ return 0;
default:
return EOPNOTSUPP;
}
diff -r cd9e84ee83e5 -r 982fd0318113 sys/dev/usb/umct.c
--- a/sys/dev/usb/umct.c Thu Nov 12 19:53:56 2009 +0000
+++ b/sys/dev/usb/umct.c Thu Nov 12 19:58:27 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umct.c,v 1.28 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: umct.c,v 1.29 2009/11/12 19:58:27 dyoung Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umct.c,v 1.28 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umct.c,v 1.29 2009/11/12 19:58:27 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -342,19 +342,14 @@
umct_activate(device_t self, enum devact act)
{
struct umct_softc *sc = device_private(self);
- int rv = 0;
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
-
case DVACT_DEACTIVATE:
- if (sc->sc_subdev != NULL)
- rv = config_deactivate(sc->sc_subdev);
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (rv);
}
void
diff -r cd9e84ee83e5 -r 982fd0318113 sys/dev/usb/umidi.c
--- a/sys/dev/usb/umidi.c Thu Nov 12 19:53:56 2009 +0000
Home |
Main Index |
Thread Index |
Old Index