summaryrefslogtreecommitdiff
path: root/sys/arch/armv7/omap
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2013-09-12 00:06:06 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2013-09-12 00:06:06 +0000
commite8e9feb89c7999716411b31f07328816b60a0d99 (patch)
tree3818f255df14dc0b8758fff1d53019bf16490f6b /sys/arch/armv7/omap
parent8b8bd2def0b195c83c50720bc41e5fd6345c02cc (diff)
#define DEVNAME(_sc) ((_sc)->sc_dev.dv_xname)
Diffstat (limited to 'sys/arch/armv7/omap')
-rw-r--r--sys/arch/armv7/omap/if_cpsw.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/arch/armv7/omap/if_cpsw.c b/sys/arch/armv7/omap/if_cpsw.c
index 5799c89dfa3..c7f8bcaa0f5 100644
--- a/sys/arch/armv7/omap/if_cpsw.c
+++ b/sys/arch/armv7/omap/if_cpsw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cpsw.c,v 1.5 2013/09/11 23:43:20 dlg Exp $ */
+/* $OpenBSD: if_cpsw.c,v 1.6 2013/09/12 00:06:05 dlg Exp $ */
/* $NetBSD: if_cpsw.c,v 1.3 2013/04/17 14:36:34 bouyer Exp $ */
/*
@@ -165,6 +165,8 @@ struct cpsw_softc {
struct timeout sc_tick;
};
+#define DEVNAME(_sc) ((_sc)->sc_dev.dv_xname)
+
void cpsw_get_mac_addr(struct cpsw_softc *);
void cpsw_attach(struct device *, struct device *, void *);
@@ -352,13 +354,13 @@ cpsw_attach(struct device *parent, struct device *self, void *aux)
cpsw_get_mac_addr(sc);
sc->sc_rxthih = arm_intr_establish(oa->oa_dev->irq[0] + CPSW_INTROFF_RXTH,
- IPL_NET, cpsw_rxthintr, sc, sc->sc_dev.dv_xname);
+ IPL_NET, cpsw_rxthintr, sc, DEVNAME(sc));
sc->sc_rxih = arm_intr_establish(oa->oa_dev->irq[0] + CPSW_INTROFF_RX,
- IPL_NET, cpsw_rxintr, sc, sc->sc_dev.dv_xname);
+ IPL_NET, cpsw_rxintr, sc, DEVNAME(sc));
sc->sc_txih = arm_intr_establish(oa->oa_dev->irq[0] + CPSW_INTROFF_TX,
- IPL_NET, cpsw_txintr, sc, sc->sc_dev.dv_xname);
+ IPL_NET, cpsw_txintr, sc, DEVNAME(sc));
sc->sc_miscih = arm_intr_establish(oa->oa_dev->irq[0] + CPSW_INTROFF_MISC,
- IPL_NET, cpsw_miscintr, sc, sc->sc_dev.dv_xname);
+ IPL_NET, cpsw_miscintr, sc, DEVNAME(sc));
sc->sc_bst = oa->oa_iot;
sc->sc_bdt = oa->oa_dmat;
@@ -432,7 +434,7 @@ cpsw_attach(struct device *parent, struct device *self, void *aux)
ifp->if_watchdog = cpsw_watchdog;
IFQ_SET_MAXLEN(&ifp->if_snd, CPSW_NTXDESCS - 1);
IFQ_SET_READY(&ifp->if_snd);
- memcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
+ memcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ);
cpsw_stop(ifp);