Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/cardbus Simplify interrupt (dis)establishment by two...



details:   https://anonhg.NetBSD.org/src/rev/6e3c88b41a3d
branches:  trunk
changeset: 753153:6e3c88b41a3d
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Thu Mar 18 20:52:43 2010 +0000

description:
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, ...);

The identical change to a few other CardBus NICs has not caused any
problems, as expected, so I'm going to commit this rather safe change
and get on with the work.

Testers have been enlisted.  I will revisit this change if I get any
negative responses.

diffstat:

 sys/dev/cardbus/if_fxp_cardbus.c |  17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diffs (61 lines):

diff -r 056383a8c7a2 -r 6e3c88b41a3d sys/dev/cardbus/if_fxp_cardbus.c
--- a/sys/dev/cardbus/if_fxp_cardbus.c  Thu Mar 18 20:51:42 2010 +0000
+++ b/sys/dev/cardbus/if_fxp_cardbus.c  Thu Mar 18 20:52:43 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_fxp_cardbus.c,v 1.46 2010/02/26 00:57:02 dyoung Exp $       */
+/*     $NetBSD: if_fxp_cardbus.c,v 1.47 2010/03/18 20:52:43 dyoung Exp $       */
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_fxp_cardbus.c,v 1.46 2010/02/26 00:57:02 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_fxp_cardbus.c,v 1.47 2010/03/18 20:52:43 dyoung Exp $");
 
 #include "opt_inet.h"
 #include "rnd.h"
@@ -212,8 +212,7 @@
 fxp_cardbus_enable(struct fxp_softc * sc)
 {
        struct fxp_cardbus_softc *csc = (struct fxp_cardbus_softc *)sc;
-       cardbus_chipset_tag_t cc = csc->ct->ct_cc;
-       cardbus_function_tag_t cf = csc->ct->ct_cf;
+       cardbus_devfunc_t ct = csc->ct;
 
        Cardbus_function_enable(csc->ct);
 
@@ -221,7 +220,7 @@
 
        /* Map and establish the interrupt. */
 
-       sc->sc_ih = cardbus_intr_establish(cc, cf, csc->intrline, IPL_NET,
+       sc->sc_ih = Cardbus_intr_establish(ct, csc->intrline, IPL_NET,
            fxp_intr, sc);
        if (NULL == sc->sc_ih) {
                aprint_error_dev(sc->sc_dev, "couldn't establish interrupt\n");
@@ -235,12 +234,10 @@
 fxp_cardbus_disable(struct fxp_softc * sc)
 {
        struct fxp_cardbus_softc *csc = (struct fxp_cardbus_softc *)sc;
-       struct cardbus_devfunc *ct = csc->ct;
-       cardbus_chipset_tag_t cc = ct->ct_cc;
-       cardbus_function_tag_t cf = ct->ct_cf;
+       cardbus_devfunc_t ct = csc->ct;
 
        /* Remove interrupt handler. */
-       cardbus_intr_disestablish(cc, cf, sc->sc_ih);
+       Cardbus_intr_disestablish(ct, sc->sc_ih);
 
        Cardbus_function_disable(csc->ct);
 }
@@ -263,7 +260,7 @@
        /*
         * Unhook the interrupt handler.
         */
-       cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf, sc->sc_ih);
+       Cardbus_intr_disestablish(ct, sc->sc_ih);
 
        /*
         * release bus space and close window



Home | Main Index | Thread Index | Old Index