Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/cardbus This is *always* compiled with #define rbus ...



details:   https://anonhg.NetBSD.org/src/rev/744fe233822e
branches:  trunk
changeset: 752904:744fe233822e
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Wed Mar 10 21:00:36 2010 +0000

description:
This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.

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 by me.

diffstat:

 sys/dev/cardbus/if_ex_cardbus.c |  18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)

diffs (64 lines):

diff -r a227f8982e21 -r 744fe233822e sys/dev/cardbus/if_ex_cardbus.c
--- a/sys/dev/cardbus/if_ex_cardbus.c   Wed Mar 10 20:30:00 2010 +0000
+++ b/sys/dev/cardbus/if_ex_cardbus.c   Wed Mar 10 21:00:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ex_cardbus.c,v 1.50 2010/02/26 00:57:02 dyoung Exp $        */
+/*     $NetBSD: if_ex_cardbus.c,v 1.51 2010/03/10 21:00:36 dyoung Exp $        */
 
 /*
  * Copyright (c) 1998 and 1999
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ex_cardbus.c,v 1.50 2010/02/26 00:57:02 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ex_cardbus.c,v 1.51 2010/03/10 21:00:36 dyoung Exp $");
 
 /* #define EX_DEBUG 4 */       /* define to report information for debugging */
 
@@ -215,10 +215,6 @@
        struct ex_softc *sc = &csc->sc_softc;
        struct cardbus_attach_args *ca = aux;
        cardbus_devfunc_t ct = ca->ca_ct;
-#if rbus
-#else
-       cardbus_chipset_tag_t cc = ct->ct_cc;
-#endif
        const struct ex_cardbus_product *ecp;
        bus_addr_t adr, adr1;
 
@@ -244,10 +240,6 @@
 
        if (Cardbus_mapreg_map(ct, PCI_BAR0, PCI_MAPREG_TYPE_IO, 0,
                &sc->sc_iot, &sc->sc_ioh, &adr, &csc->sc_mapsize) == 0) {
-#if rbus
-#else
-               (*ct->ct_cf->cardbus_io_open)(cc, 0, adr, adr + csc->sc_mapsize);
-#endif
                csc->sc_bar_reg = PCI_BAR0;
                csc->sc_bar_val = adr | PCI_MAPREG_TYPE_IO;
 
@@ -326,7 +318,7 @@
                /*
                 * Unhook the interrupt handler.
                 */
-               cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf, sc->sc_ih);
+               Cardbus_intr_disestablish(ct, sc->sc_ih);
 
                if (csc->sc_cardtype == EX_CB_CYCLONE) {
                        Cardbus_mapreg_unmap(ct,
@@ -344,13 +336,11 @@
 ex_cardbus_enable(struct ex_softc *sc)
 {
        struct ex_cardbus_softc *csc = (struct ex_cardbus_softc *)sc;
-       cardbus_function_tag_t cf = csc->sc_ct->ct_cf;
-       cardbus_chipset_tag_t cc = csc->sc_ct->ct_cc;
 
        Cardbus_function_enable(csc->sc_ct);
        ex_cardbus_setup(csc);
 
-       sc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline,
+       sc->sc_ih = Cardbus_intr_establish(csc->sc_ct, csc->sc_intrline,
            IPL_NET, ex_intr, sc);
        if (NULL == sc->sc_ih) {
                aprint_error_dev(sc->sc_dev, "couldn't establish interrupt\n");



Home | Main Index | Thread Index | Old Index