Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Correct device_t/softc split and, while I am here, d...
details: https://anonhg.NetBSD.org/src/rev/a00891a5af46
branches: trunk
changeset: 762586:a00891a5af46
user: dyoung <dyoung%NetBSD.org@localhost>
date: Wed Feb 23 16:20:30 2011 +0000
description:
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.
diffstat:
sys/dev/radio.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diffs (44 lines):
diff -r 490b413ed343 -r a00891a5af46 sys/dev/radio.c
--- a/sys/dev/radio.c Wed Feb 23 15:44:38 2011 +0000
+++ b/sys/dev/radio.c Wed Feb 23 16:20:30 2011 +0000
@@ -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 */
Home |
Main Index |
Thread Index |
Old Index