Source-Changes-HG archive

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

[src/trunk]: src/sys/dev To ease a future device_t/softc split, se device_pri...



details:   https://anonhg.NetBSD.org/src/rev/2088aeffac1c
branches:  trunk
changeset: 747448:2088aeffac1c
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Tue Sep 15 18:37:02 2009 +0000

description:
To ease a future device_t/softc split, se device_private() instead
of casting device_t to softc.

diffstat:

 sys/dev/ic/awi.c               |  6 +++---
 sys/dev/pcmcia/if_awi_pcmcia.c |  8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (63 lines):

diff -r f13d8b62f13c -r 2088aeffac1c sys/dev/ic/awi.c
--- a/sys/dev/ic/awi.c  Tue Sep 15 18:32:00 2009 +0000
+++ b/sys/dev/ic/awi.c  Tue Sep 15 18:37:02 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: awi.c,v 1.83 2009/09/15 18:32:00 dyoung Exp $  */
+/*     $NetBSD: awi.c,v 1.84 2009/09/15 18:37:02 dyoung Exp $  */
 
 /*-
  * Copyright (c) 1999,2000,2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.83 2009/09/15 18:32:00 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.84 2009/09/15 18:37:02 dyoung Exp $");
 
 #include "opt_inet.h"
 #include "bpfilter.h"
@@ -322,7 +322,7 @@
 int
 awi_activate(device_t self, enum devact act)
 {
-       struct awi_softc *sc = (struct awi_softc *)self;
+       struct awi_softc *sc = device_private(self);
        struct ifnet *ifp = &sc->sc_if;
        int s, error = 0;
 
diff -r f13d8b62f13c -r 2088aeffac1c sys/dev/pcmcia/if_awi_pcmcia.c
--- a/sys/dev/pcmcia/if_awi_pcmcia.c    Tue Sep 15 18:32:00 2009 +0000
+++ b/sys/dev/pcmcia/if_awi_pcmcia.c    Tue Sep 15 18:37:02 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_awi_pcmcia.c,v 1.43 2009/05/12 14:42:18 cegger Exp $ */
+/* $NetBSD: if_awi_pcmcia.c,v 1.44 2009/09/15 18:37:02 dyoung Exp $ */
 
 /*-
  * Copyright (c) 1999, 2004 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_awi_pcmcia.c,v 1.43 2009/05/12 14:42:18 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_awi_pcmcia.c,v 1.44 2009/09/15 18:37:02 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -181,7 +181,7 @@
 awi_pcmcia_attach(device_t parent, device_t self,
     void *aux)
 {
-       struct awi_pcmcia_softc *psc = (void *)self;
+       struct awi_pcmcia_softc *psc = device_private(self);
        struct awi_softc *sc = &psc->sc_awi;
        struct pcmcia_attach_args *pa = aux;
        struct pcmcia_config_entry *cfe;
@@ -241,7 +241,7 @@
 static int
 awi_pcmcia_detach(device_t self, int flags)
 {
-       struct awi_pcmcia_softc *psc = (struct awi_pcmcia_softc *)self;
+       struct awi_pcmcia_softc *psc = device_private(self);
        int error;
 
        if (psc->sc_state != AWI_PCMCIA_ATTACHED)



Home | Main Index | Thread Index | Old Index