diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-08-27 16:06:26 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-08-27 16:06:26 +0000 |
commit | 6edf190811a066b237b9d7ef0ab4e08942a1bba1 (patch) | |
tree | 93d0118ac5a0a03c0a58ea8cdcde851c860aab0e /sys/dev | |
parent | e9774e1b179ec2eedc9ec274dddd9c21aec1846f (diff) |
Stop calling xxx_power() from xxx_resume(); instead do it the other way around.
Get rid of the sc_power() callback, which isn't used anymore.
ok deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/rt2560.c | 17 | ||||
-rw-r--r-- | sys/dev/ic/rt2560var.h | 3 | ||||
-rw-r--r-- | sys/dev/ic/rt2661.c | 17 | ||||
-rw-r--r-- | sys/dev/ic/rt2661var.h | 3 | ||||
-rw-r--r-- | sys/dev/ic/rt2860.c | 17 | ||||
-rw-r--r-- | sys/dev/ic/rt2860var.h | 3 |
6 files changed, 21 insertions, 39 deletions
diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c index 3c89d008f8f..9117461951d 100644 --- a/sys/dev/ic/rt2560.c +++ b/sys/dev/ic/rt2560.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2560.c,v 1.51 2010/08/27 04:09:18 deraadt Exp $ */ +/* $OpenBSD: rt2560.c,v 1.52 2010/08/27 16:06:25 kettenis Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -348,8 +348,10 @@ void rt2560_resume(void *xsc) { struct rt2560_softc *sc = xsc; + struct ifnet *ifp = &sc->sc_ic.ic_if; - rt2560_power(PWR_RESUME, sc); + if (ifp->if_flags & IFF_UP) + rt2560_init(ifp); } int @@ -2732,22 +2734,15 @@ void rt2560_power(int why, void *arg) { struct rt2560_softc *sc = arg; - struct ifnet *ifp = &sc->sc_ic.ic_if; int s; s = splnet(); switch (why) { case PWR_SUSPEND: - rt2560_stop(ifp, 0); - if (sc->sc_power != NULL) - (*sc->sc_power)(sc, why); + rt2560_suspend(sc); break; case PWR_RESUME: - if (ifp->if_flags & IFF_UP) { - rt2560_init(ifp); - if (sc->sc_power != NULL) - (*sc->sc_power)(sc, why); - } + rt2560_resume(sc); break; } splx(s); diff --git a/sys/dev/ic/rt2560var.h b/sys/dev/ic/rt2560var.h index d6b94320dfd..8109411ba8b 100644 --- a/sys/dev/ic/rt2560var.h +++ b/sys/dev/ic/rt2560var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2560var.h,v 1.7 2010/08/04 19:48:33 damien Exp $ */ +/* $OpenBSD: rt2560var.h,v 1.8 2010/08/27 16:06:25 kettenis Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -104,7 +104,6 @@ struct rt2560_softc { int (*sc_enable)(struct rt2560_softc *); void (*sc_disable)(struct rt2560_softc *); - void (*sc_power)(struct rt2560_softc *, int); bus_dma_tag_t sc_dmat; bus_space_tag_t sc_st; diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c index 2296fab42a5..456ac8d0ed6 100644 --- a/sys/dev/ic/rt2661.c +++ b/sys/dev/ic/rt2661.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2661.c,v 1.57 2010/08/27 04:09:18 deraadt Exp $ */ +/* $OpenBSD: rt2661.c,v 1.58 2010/08/27 16:06:25 kettenis Exp $ */ /*- * Copyright (c) 2006 @@ -415,8 +415,10 @@ void rt2661_resume(void *xsc) { struct rt2661_softc *sc = xsc; + struct ifnet *ifp = &sc->sc_ic.ic_if; - rt2661_power(PWR_RESUME, sc); + if (ifp->if_flags & IFF_UP) + rt2661_init(ifp); } int @@ -2927,22 +2929,15 @@ void rt2661_power(int why, void *arg) { struct rt2661_softc *sc = arg; - struct ifnet *ifp = &sc->sc_ic.ic_if; int s; s = splnet(); switch (why) { case PWR_SUSPEND: - rt2661_stop(ifp, 0); - if (sc->sc_power != NULL) - (*sc->sc_power)(sc, why); + rt2661_suspend(sc); break; case PWR_RESUME: - if (ifp->if_flags & IFF_UP) { - rt2661_init(ifp); - if (sc->sc_power != NULL) - (*sc->sc_power)(sc, why); - } + rt2661_resume(sc); break; } splx(s); diff --git a/sys/dev/ic/rt2661var.h b/sys/dev/ic/rt2661var.h index b426a8b4d47..d4130d32f46 100644 --- a/sys/dev/ic/rt2661var.h +++ b/sys/dev/ic/rt2661var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2661var.h,v 1.11 2010/08/04 19:48:33 damien Exp $ */ +/* $OpenBSD: rt2661var.h,v 1.12 2010/08/27 16:06:25 kettenis Exp $ */ /*- * Copyright (c) 2006 @@ -97,7 +97,6 @@ struct rt2661_softc { int (*sc_enable)(struct rt2661_softc *); void (*sc_disable)(struct rt2661_softc *); - void (*sc_power)(struct rt2661_softc *, int); bus_dma_tag_t sc_dmat; bus_space_tag_t sc_st; diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c index 0eebcaa095d..f4fadc55ef1 100644 --- a/sys/dev/ic/rt2860.c +++ b/sys/dev/ic/rt2860.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2860.c,v 1.59 2010/08/27 04:09:18 deraadt Exp $ */ +/* $OpenBSD: rt2860.c,v 1.60 2010/08/27 16:06:25 kettenis Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -436,8 +436,10 @@ void rt2860_resume(void *xsc) { struct rt2860_softc *sc = xsc; + struct ifnet *ifp = &sc->sc_ic.ic_if; - rt2860_power(PWR_RESUME, sc); + if (ifp->if_flags & IFF_UP) + rt2860_init(ifp); } int @@ -3867,22 +3869,15 @@ void rt2860_power(int why, void *arg) { struct rt2860_softc *sc = arg; - struct ifnet *ifp = &sc->sc_ic.ic_if; int s; s = splnet(); switch (why) { case PWR_SUSPEND: - rt2860_stop(ifp, 0); - if (sc->sc_power != NULL) - (*sc->sc_power)(sc, why); + rt2860_suspend(sc); break; case PWR_RESUME: - if (ifp->if_flags & IFF_UP) { - rt2860_init(ifp); - if (sc->sc_power != NULL) - (*sc->sc_power)(sc, why); - } + rt2860_resume(sc); break; } splx(s); diff --git a/sys/dev/ic/rt2860var.h b/sys/dev/ic/rt2860var.h index 5a1b538fe96..e0d466ca73c 100644 --- a/sys/dev/ic/rt2860var.h +++ b/sys/dev/ic/rt2860var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2860var.h,v 1.18 2010/08/04 19:48:33 damien Exp $ */ +/* $OpenBSD: rt2860var.h,v 1.19 2010/08/27 16:06:25 kettenis Exp $ */ /*- * Copyright (c) 2007 @@ -112,7 +112,6 @@ struct rt2860_softc { int (*sc_enable)(struct rt2860_softc *); void (*sc_disable)(struct rt2860_softc *); - void (*sc_power)(struct rt2860_softc *, int); bus_dma_tag_t sc_dmat; bus_space_tag_t sc_st; |