Module Name: src Committed By: dyoung Date: Wed Feb 23 16:20:30 UTC 2011
Modified Files: src/sys/dev: radio.c Log Message: Correct device_t/softc split and, while I am here, delete commented-out code. Patrick Welche says that this patch fixes the problem that he reported on current-users@. BTW, sc_dev is initialized in radioattach(), but I do not see where it is used. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/dev/radio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/radio.c diff -u src/sys/dev/radio.c:1.24 src/sys/dev/radio.c:1.25 --- src/sys/dev/radio.c:1.24 Thu Jan 21 02:19:55 2010 +++ src/sys/dev/radio.c Wed Feb 23 16:20:30 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: radio.c,v 1.24 2010/01/21 02:19:55 dyoung Exp $ */ +/* $NetBSD: radio.c,v 1.25 2011/02/23 16:20:30 dyoung Exp $ */ /* $OpenBSD: radio.c,v 1.2 2001/12/05 10:27:06 mickey Exp $ */ /* $RuOBSD: radio.c,v 1.7 2001/12/04 06:03:05 tm Exp $ */ @@ -30,7 +30,7 @@ /* This is the /dev/radio driver from OpenBSD */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: radio.c,v 1.24 2010/01/21 02:19:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: radio.c,v 1.25 2011/02/23 16:20:30 dyoung Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -78,7 +78,7 @@ static void radioattach(device_t parent, device_t self, void *aux) { - struct radio_softc *sc = (void *)self; + struct radio_softc *sc = device_private(self); struct radio_attach_args *sa = aux; const struct radio_hw_if *hwp = sa->hwif; void *hdlp = sa->hdl; @@ -87,7 +87,7 @@ aprint_normal("\n"); sc->hw_if = hwp; sc->hw_hdl = hdlp; - sc->sc_dev = parent; + sc->sc_dev = self; } static int @@ -181,7 +181,6 @@ static int radiodetach(device_t self, int flags) { - /*struct radio_softc *sc = (struct radio_softc *)self;*/ int maj, mn; /* locate the major number */