diff options
| author | dyoung <dyoung@NetBSD.org> | 2010-03-02 20:31:14 +0000 |
|---|---|---|
| committer | dyoung <dyoung@NetBSD.org> | 2010-03-02 20:31:14 +0000 |
| commit | 355cdbdce99ae8e30d4f073a10947e3c6512b2d3 (patch) | |
| tree | f787da59d32ba29ba942d43f6244c66d62f4fb82 /sys/dev | |
| parent | 3e85fef9b3b76d20425a8ffbb3b08e46aba8aa9f (diff) | |
Simplify interrupt (dis)establishment by two source transformations:
- cardbus_intr_disestablish(cc, cf, ih);
+ Cardbus_intr_disestablish(ct, ih);
- ih = cardbus_intr_establish(cc, cf, ...);
+ ih = Cardbus_intr_establish(ct, ...);
Tested with ath & atw units on a Soekris net4521.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/cardbus/if_ath_cardbus.c | 13 | ||||
| -rw-r--r-- | sys/dev/cardbus/if_atw_cardbus.c | 14 |
2 files changed, 11 insertions, 16 deletions
diff --git a/sys/dev/cardbus/if_ath_cardbus.c b/sys/dev/cardbus/if_ath_cardbus.c index eed19213b46..b6c1b93fc7a 100644 --- a/sys/dev/cardbus/if_ath_cardbus.c +++ b/sys/dev/cardbus/if_ath_cardbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ath_cardbus.c,v 1.40 2010/02/25 23:40:39 dyoung Exp $ */ +/* $NetBSD: if_ath_cardbus.c,v 1.41 2010/03/02 20:31:14 dyoung Exp $ */ /* * Copyright (c) 2003 * Ichiro FUKUHARA <ichiro@ichiro.org>. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.40 2010/02/25 23:40:39 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.41 2010/03/02 20:31:14 dyoung Exp $"); #include "opt_inet.h" @@ -115,8 +115,7 @@ ath_cardbus_suspend(device_t self, const pmf_qual_t *qual) ath_suspend(&csc->sc_ath); if (csc->sc_ih != NULL) { - cardbus_intr_disestablish(csc->sc_ct->ct_cc, csc->sc_ct->ct_cf, - csc->sc_ih); + Cardbus_intr_disestablish(csc->sc_ct, csc->sc_ih); csc->sc_ih = NULL; } return true; @@ -127,8 +126,8 @@ ath_cardbus_resume(device_t self, const pmf_qual_t *qual) { struct ath_cardbus_softc *csc = device_private(self); - csc->sc_ih = cardbus_intr_establish(csc->sc_ct->ct_cc, - csc->sc_ct->ct_cf, csc->sc_intrline, IPL_NET, ath_intr, + csc->sc_ih = Cardbus_intr_establish(csc->sc_ct, + csc->sc_intrline, IPL_NET, ath_intr, &csc->sc_ath); if (csc->sc_ih == NULL) { @@ -235,7 +234,7 @@ ath_cardbus_detach(device_t self, int flags) * Unhook the interrupt handler. */ if (csc->sc_ih != NULL) { - cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf, csc->sc_ih); + Cardbus_intr_disestablish(ct, csc->sc_ih); csc->sc_ih = NULL; } diff --git a/sys/dev/cardbus/if_atw_cardbus.c b/sys/dev/cardbus/if_atw_cardbus.c index 76cee45f910..f33e6a36af9 100644 --- a/sys/dev/cardbus/if_atw_cardbus.c +++ b/sys/dev/cardbus/if_atw_cardbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_atw_cardbus.c,v 1.32 2010/02/25 23:40:39 dyoung Exp $ */ +/* $NetBSD: if_atw_cardbus.c,v 1.33 2010/03/02 20:31:14 dyoung Exp $ */ /*- * Copyright (c) 1999, 2000, 2003 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_atw_cardbus.c,v 1.32 2010/02/25 23:40:39 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_atw_cardbus.c,v 1.33 2010/03/02 20:31:14 dyoung Exp $"); #include "opt_inet.h" @@ -308,7 +308,7 @@ atw_cardbus_detach(device_t self, int flags) * Unhook the interrupt handler. */ if (csc->sc_ih != NULL) - cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf, csc->sc_ih); + Cardbus_intr_disestablish(ct, csc->sc_ih); /* * Release bus space and close window. @@ -326,13 +326,11 @@ atw_cardbus_resume(device_t self, const pmf_qual_t *qual) struct atw_cardbus_softc *csc = device_private(self); struct atw_softc *sc = &csc->sc_atw; cardbus_devfunc_t ct = csc->sc_ct; - cardbus_chipset_tag_t cc = ct->ct_cc; - cardbus_function_tag_t cf = ct->ct_cf; /* * Map and establish the interrupt. */ - csc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline, IPL_NET, + csc->sc_ih = Cardbus_intr_establish(ct, csc->sc_intrline, IPL_NET, atw_intr, sc); if (csc->sc_ih == NULL) { aprint_error_dev(sc->sc_dev, "unable to establish interrupt\n"); @@ -347,11 +345,9 @@ atw_cardbus_suspend(device_t self, const pmf_qual_t *qual) { struct atw_cardbus_softc *csc = device_private(self); cardbus_devfunc_t ct = csc->sc_ct; - cardbus_chipset_tag_t cc = ct->ct_cc; - cardbus_function_tag_t cf = ct->ct_cf; /* Unhook the interrupt handler. */ - cardbus_intr_disestablish(cc, cf, csc->sc_ih); + Cardbus_intr_disestablish(ct, csc->sc_ih); csc->sc_ih = NULL; return atw_suspend(self, qual); |
