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/0b7b86b53abc
branches: trunk
changeset: 748996:0b7b86b53abc
user: dyoung <dyoung%NetBSD.org@localhost>
date: Thu Nov 12 19:51:44 2009 +0000
description:
Simplify activation hooks. (sc_dying must die!)
diffstat:
sys/dev/usb/ubsa.c | 19 +++++--------------
sys/dev/usb/uchcom.c | 15 +++++----------
sys/dev/usb/udsbr.c | 16 +++++-----------
sys/dev/usb/uep.c | 18 ++++++------------
sys/dev/usb/uftdi.c | 16 +++++-----------
sys/dev/usb/ugensa.c | 16 +++++-----------
6 files changed, 31 insertions(+), 69 deletions(-)
diffs (256 lines):
diff -r d8164ad80014 -r 0b7b86b53abc sys/dev/usb/ubsa.c
--- a/sys/dev/usb/ubsa.c Thu Nov 12 19:50:01 2009 +0000
+++ b/sys/dev/usb/ubsa.c Thu Nov 12 19:51:44 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ubsa.c,v 1.24 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: ubsa.c,v 1.25 2009/11/12 19:51:44 dyoung Exp $ */
/*-
* Copyright (c) 2002, Alexander Kabaev <kan.FreeBSD.org>.
* All rights reserved.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ubsa.c,v 1.24 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubsa.c,v 1.25 2009/11/12 19:51:44 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -354,21 +354,12 @@
ubsa_activate(device_ptr_t self, enum devact act)
{
struct ubsa_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_numif; i++) {
- if (sc->sc_subdevs[i] != NULL)
- rv |= config_deactivate(sc->sc_subdevs[i]);
- }
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (rv);
}
-
diff -r d8164ad80014 -r 0b7b86b53abc sys/dev/usb/uchcom.c
--- a/sys/dev/usb/uchcom.c Thu Nov 12 19:50:01 2009 +0000
+++ b/sys/dev/usb/uchcom.c Thu Nov 12 19:51:44 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uchcom.c,v 1.8 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: uchcom.c,v 1.9 2009/11/12 19:51:44 dyoung Exp $ */
/*
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.8 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.9 2009/11/12 19:51:44 dyoung Exp $");
/*
* driver for WinChipHead CH341/340, the worst USB-serial chip in the world.
@@ -339,20 +339,15 @@
uchcom_activate(device_t self, enum devact act)
{
struct uchcom_softc *sc = device_private(self);
- int rv = 0;
switch (act) {
- case DVACT_ACTIVATE:
- rv = EOPNOTSUPP;
- break;
case DVACT_DEACTIVATE:
close_intr_pipe(sc);
sc->sc_dying = 1;
- if (sc->sc_subdev != NULL)
- rv = config_deactivate(sc->sc_subdev);
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return rv;
}
static int
diff -r d8164ad80014 -r 0b7b86b53abc sys/dev/usb/udsbr.c
--- a/sys/dev/usb/udsbr.c Thu Nov 12 19:50:01 2009 +0000
+++ b/sys/dev/usb/udsbr.c Thu Nov 12 19:51:44 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udsbr.c,v 1.16 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: udsbr.c,v 1.17 2009/11/12 19:51:44 dyoung Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udsbr.c,v 1.16 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udsbr.c,v 1.17 2009/11/12 19:51:44 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -176,20 +176,14 @@
udsbr_activate(device_ptr_t self, enum devact act)
{
struct udsbr_softc *sc = device_private(self);
- int rv = 0;
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
- break;
-
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- if (sc->sc_child != NULL)
- rv = config_deactivate(sc->sc_child);
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (rv);
}
int
diff -r d8164ad80014 -r 0b7b86b53abc sys/dev/usb/uep.c
--- a/sys/dev/usb/uep.c Thu Nov 12 19:50:01 2009 +0000
+++ b/sys/dev/usb/uep.c Thu Nov 12 19:51:44 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uep.c,v 1.13 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: uep.c,v 1.14 2009/11/12 19:51:44 dyoung Exp $ */
/*
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uep.c,v 1.13 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uep.c,v 1.14 2009/11/12 19:51:44 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -258,20 +258,14 @@
uep_activate(device_t self, enum devact act)
{
struct uep_softc *sc = device_private(self);
- int rv = 0;
switch (act) {
- case DVACT_ACTIVATE:
+ case DVACT_DEACTIVATE:
+ sc->sc_dying = 1;
+ return 0;
+ default:
return EOPNOTSUPP;
-
- case DVACT_DEACTIVATE:
- if (sc->sc_wsmousedev != NULL)
- rv = config_deactivate(sc->sc_wsmousedev);
- sc->sc_dying = 1;
- break;
}
-
- return rv;
}
Static int
diff -r d8164ad80014 -r 0b7b86b53abc sys/dev/usb/uftdi.c
--- a/sys/dev/usb/uftdi.c Thu Nov 12 19:50:01 2009 +0000
+++ b/sys/dev/usb/uftdi.c Thu Nov 12 19:51:44 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uftdi.c,v 1.43 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: uftdi.c,v 1.44 2009/11/12 19:51:44 dyoung Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.43 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.44 2009/11/12 19:51:44 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -312,20 +312,14 @@
uftdi_activate(device_t self, enum devact act)
{
struct uftdi_softc *sc = device_private(self);
- int rv = 0,i;
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
-
case DVACT_DEACTIVATE:
- for (i=0; i < sc->sc_numports; i++)
- if (sc->sc_subdev[i] != NULL)
- rv = config_deactivate(sc->sc_subdev[i]);
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (rv);
}
void
diff -r d8164ad80014 -r 0b7b86b53abc sys/dev/usb/ugensa.c
--- a/sys/dev/usb/ugensa.c Thu Nov 12 19:50:01 2009 +0000
+++ b/sys/dev/usb/ugensa.c Thu Nov 12 19:51:44 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ugensa.c,v 1.23 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: ugensa.c,v 1.24 2009/11/12 19:51:44 dyoung Exp $ */
/*
* Copyright (c) 2004, 2005 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ugensa.c,v 1.23 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugensa.c,v 1.24 2009/11/12 19:51:44 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -258,22 +258,16 @@
ugensa_activate(device_t self, enum devact act)
{
struct ugensa_softc *sc = device_private(self);
- int rv = 0;
DPRINTF(("ugensa_activate: sc=%p\n", sc));
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
- break;
-
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- if (sc->sc_subdev)
- rv = config_deactivate(sc->sc_subdev);
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (rv);
}
USB_DETACH(ugensa)
Home |
Main Index |
Thread Index |
Old Index