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 several device-activation hooks.
details: https://anonhg.NetBSD.org/src/rev/e79661ba8323
branches: trunk
changeset: 749728:e79661ba8323
user: dyoung <dyoung%NetBSD.org@localhost>
date: Sun Dec 06 20:20:12 2009 +0000
description:
Simplify several device-activation hooks.
diffstat:
sys/dev/usb/if_atu.c | 12 +++++-------
sys/dev/usb/if_aue.c | 13 +++++--------
sys/dev/usb/if_axe.c | 13 +++++--------
sys/dev/usb/if_cdce.c | 13 +++++--------
sys/dev/usb/if_cue.c | 13 +++++--------
sys/dev/usb/if_kue.c | 15 +++++----------
sys/dev/usb/if_rum.c | 13 +++++--------
sys/dev/usb/if_udav.c | 13 +++++--------
sys/dev/usb/if_upl.c | 13 +++++--------
sys/dev/usb/if_ural.c | 14 +++++---------
sys/dev/usb/if_url.c | 14 +++++---------
sys/dev/usb/if_zyd.c | 12 +++++-------
12 files changed, 60 insertions(+), 98 deletions(-)
diffs (truncated from 458 to 300 lines):
diff -r 6f5e7d75f1da -r e79661ba8323 sys/dev/usb/if_atu.c
--- a/sys/dev/usb/if_atu.c Sun Dec 06 18:00:15 2009 +0000
+++ b/sys/dev/usb/if_atu.c Sun Dec 06 20:20:12 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_atu.c,v 1.33 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: if_atu.c,v 1.34 2009/12/06 20:20:12 dyoung Exp $ */
/* $OpenBSD: if_atu.c,v 1.48 2004/12/30 01:53:21 dlg Exp $ */
/*
* Copyright (c) 2003, 2004
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_atu.c,v 1.33 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atu.c,v 1.34 2009/12/06 20:20:12 dyoung Exp $");
#include "bpfilter.h"
@@ -1429,17 +1429,15 @@
struct atu_softc *sc = device_private(self);
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
if (sc->sc_state != ATU_S_UNCONFIG) {
if_deactivate(&sc->atu_ec.ec_if);
sc->sc_state = ATU_S_DEAD;
}
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (0);
}
/*
diff -r 6f5e7d75f1da -r e79661ba8323 sys/dev/usb/if_aue.c
--- a/sys/dev/usb/if_aue.c Sun Dec 06 18:00:15 2009 +0000
+++ b/sys/dev/usb/if_aue.c Sun Dec 06 20:20:12 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_aue.c,v 1.115 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: if_aue.c,v 1.116 2009/12/06 20:20:12 dyoung Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul%ee.columbia.edu@localhost>. All rights reserved.
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.115 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.116 2009/12/06 20:20:12 dyoung Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@@ -955,16 +955,13 @@
DPRINTFN(2,("%s: %s: enter\n", device_xname(sc->aue_dev), __func__));
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
- break;
-
case DVACT_DEACTIVATE:
if_deactivate(&sc->aue_ec.ec_if);
sc->aue_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (0);
}
/*
diff -r 6f5e7d75f1da -r e79661ba8323 sys/dev/usb/if_axe.c
--- a/sys/dev/usb/if_axe.c Sun Dec 06 18:00:15 2009 +0000
+++ b/sys/dev/usb/if_axe.c Sun Dec 06 20:20:12 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_axe.c,v 1.29 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: if_axe.c,v 1.30 2009/12/06 20:20:12 dyoung Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.29 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.30 2009/12/06 20:20:12 dyoung Exp $");
#if defined(__NetBSD__)
#include "opt_inet.h"
@@ -635,16 +635,13 @@
DPRINTFN(2,("%s: %s: enter\n", USBDEVNAME(sc->axe_dev), __func__));
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
- break;
-
case DVACT_DEACTIVATE:
if_deactivate(&sc->axe_ec.ec_if);
sc->axe_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (0);
}
/*
diff -r 6f5e7d75f1da -r e79661ba8323 sys/dev/usb/if_cdce.c
--- a/sys/dev/usb/if_cdce.c Sun Dec 06 18:00:15 2009 +0000
+++ b/sys/dev/usb/if_cdce.c Sun Dec 06 20:20:12 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_cdce.c,v 1.25 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: if_cdce.c,v 1.26 2009/12/06 20:20:12 dyoung Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul%windriver.com@localhost>
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.25 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.26 2009/12/06 20:20:12 dyoung Exp $");
#include "bpfilter.h"
#ifdef __NetBSD__
#include "opt_inet.h"
@@ -790,16 +790,13 @@
struct cdce_softc *sc = device_private(self);
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
- break;
-
case DVACT_DEACTIVATE:
if_deactivate(GET_IFP(sc));
sc->cdce_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (0);
}
diff -r 6f5e7d75f1da -r e79661ba8323 sys/dev/usb/if_cue.c
--- a/sys/dev/usb/if_cue.c Sun Dec 06 18:00:15 2009 +0000
+++ b/sys/dev/usb/if_cue.c Sun Dec 06 20:20:12 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_cue.c,v 1.55 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: if_cue.c,v 1.56 2009/12/06 20:20:12 dyoung Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul%ee.columbia.edu@localhost>. All rights reserved.
@@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.55 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.56 2009/12/06 20:20:12 dyoung Exp $");
#if defined(__NetBSD__)
#include "opt_inet.h"
@@ -648,17 +648,14 @@
DPRINTFN(2,("%s: %s: enter\n", USBDEVNAME(sc->cue_dev), __func__));
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
- break;
-
case DVACT_DEACTIVATE:
/* Deactivate the interface. */
if_deactivate(&sc->cue_ec.ec_if);
sc->cue_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (0);
}
/*
diff -r 6f5e7d75f1da -r e79661ba8323 sys/dev/usb/if_kue.c
--- a/sys/dev/usb/if_kue.c Sun Dec 06 18:00:15 2009 +0000
+++ b/sys/dev/usb/if_kue.c Sun Dec 06 20:20:12 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_kue.c,v 1.66 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: if_kue.c,v 1.67 2009/12/06 20:20:12 dyoung Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul%ee.columbia.edu@localhost>. All rights reserved.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.66 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.67 2009/12/06 20:20:12 dyoung Exp $");
#if defined(__NetBSD__)
#include "opt_inet.h"
@@ -593,19 +593,14 @@
DPRINTFN(2,("%s: %s: enter\n", USBDEVNAME(sc->kue_dev), __func__));
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
- break;
-
case DVACT_DEACTIVATE:
-#if defined(__NetBSD__)
/* Deactivate the interface. */
if_deactivate(&sc->kue_ec.ec_if);
-#endif
sc->kue_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return (0);
}
/*
diff -r 6f5e7d75f1da -r e79661ba8323 sys/dev/usb/if_rum.c
--- a/sys/dev/usb/if_rum.c Sun Dec 06 18:00:15 2009 +0000
+++ b/sys/dev/usb/if_rum.c Sun Dec 06 20:20:12 2009 +0000
@@ -1,5 +1,5 @@
/* $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $ */
-/* $NetBSD: if_rum.c,v 1.29 2009/09/28 10:22:07 pooka Exp $ */
+/* $NetBSD: if_rum.c,v 1.30 2009/12/06 20:20:12 dyoung Exp $ */
/*-
* Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini%free.fr@localhost>
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.29 2009/09/28 10:22:07 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.30 2009/12/06 20:20:12 dyoung Exp $");
#include "bpfilter.h"
@@ -2287,13 +2287,10 @@
rum_activate(device_ptr_t self, enum devact act)
{
switch (act) {
- case DVACT_ACTIVATE:
- return EOPNOTSUPP;
-
case DVACT_DEACTIVATE:
/*if_deactivate(&sc->sc_ic.ic_if);*/
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
-
- return 0;
}
diff -r 6f5e7d75f1da -r e79661ba8323 sys/dev/usb/if_udav.c
--- a/sys/dev/usb/if_udav.c Sun Dec 06 18:00:15 2009 +0000
+++ b/sys/dev/usb/if_udav.c Sun Dec 06 20:20:12 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_udav.c,v 1.26 2009/09/23 19:07:19 plunky Exp $ */
+/* $NetBSD: if_udav.c,v 1.27 2009/12/06 20:20:12 dyoung Exp $ */
/* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */
/*
* Copyright (c) 2003
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.26 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.27 2009/12/06 20:20:12 dyoung Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@@ -736,16 +736,13 @@
DPRINTF(("%s: %s: enter, act=%d\n", USBDEVNAME(sc->sc_dev),
__func__, act));
switch (act) {
- case DVACT_ACTIVATE:
- return (EOPNOTSUPP);
- break;
-
case DVACT_DEACTIVATE:
if_deactivate(&sc->sc_ec.ec_if);
sc->sc_dying = 1;
- break;
+ return 0;
Home |
Main Index |
Thread Index |
Old Index