Module Name:    src
Committed By:   macallan
Date:           Wed Oct 26 13:54:18 UTC 2011

Modified Files:
        src/sys/arch/macppc/dev: uni-n.c
        src/sys/arch/macppc/macppc: memory.c

Log Message:
more device/softc splitting


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/macppc/dev/uni-n.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/macppc/macppc/memory.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/arch/macppc/dev/uni-n.c
diff -u src/sys/arch/macppc/dev/uni-n.c:1.5 src/sys/arch/macppc/dev/uni-n.c:1.6
--- src/sys/arch/macppc/dev/uni-n.c:1.5	Sat Jun 18 08:08:28 2011
+++ src/sys/arch/macppc/dev/uni-n.c	Wed Oct 26 13:54:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uni-n.c,v 1.5 2011/06/18 08:08:28 matt Exp $	*/
+/*	$NetBSD: uni-n.c,v 1.6 2011/10/26 13:54:18 macallan Exp $	*/
 
 /*-
  * Copyright (C) 2005 Michael Lorenz.
@@ -31,7 +31,7 @@
  */
  
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uni-n.c,v 1.5 2011/06/18 08:08:28 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uni-n.c,v 1.6 2011/10/26 13:54:18 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -47,11 +47,11 @@ static int uni_n_match(device_t, cfdata_
 static int uni_n_print(void *, const char *);
 
 struct uni_n_softc {
-	struct device sc_dev;
+	device_t sc_dev;
 	int sc_node;
 };
 
-CFATTACH_DECL(uni_n, sizeof(struct uni_n_softc),
+CFATTACH_DECL_NEW(uni_n, sizeof(struct uni_n_softc),
     uni_n_match, uni_n_attach, NULL, NULL);
 
 int
@@ -84,6 +84,7 @@ uni_n_attach(device_t parent, device_t s
 	int intr[6];
 	char name[32];
 
+	sc->sc_dev = self;
 	node = OF_finddevice("/uni-n");
 	sc->sc_node = node;
 	printf(" address 0x%08x\n",our_ca->ca_reg[0]);

Index: src/sys/arch/macppc/macppc/memory.c
diff -u src/sys/arch/macppc/macppc/memory.c:1.4 src/sys/arch/macppc/macppc/memory.c:1.5
--- src/sys/arch/macppc/macppc/memory.c:1.4	Sat Jun 18 08:08:28 2011
+++ src/sys/arch/macppc/macppc/memory.c	Wed Oct 26 13:54:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: memory.c,v 1.4 2011/06/18 08:08:28 matt Exp $	*/
+/*	$NetBSD: memory.c,v 1.5 2011/10/26 13:54:18 macallan Exp $	*/
 /*	$OpenBSD: mem.c,v 1.15 2007/10/14 17:29:04 kettenis Exp $	*/
 
 /*-
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: memory.c,v 1.4 2011/06/18 08:08:28 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: memory.c,v 1.5 2011/10/26 13:54:18 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -60,7 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: memory.c,v 1
 #include <dev/ofw/openfirm.h>
 
 struct memory_softc {
-	struct device	 sc_dev;
+	device_t	 sc_dev;
 
 	u_char		*sc_buf;
 	int		 sc_len;
@@ -72,7 +72,7 @@ struct memory_softc {
 int	memory_match(device_t, cfdata_t, void *);
 void	memory_attach(device_t, device_t, void *);
 
-CFATTACH_DECL(memory, sizeof(struct memory_softc), memory_match, memory_attach,
+CFATTACH_DECL_NEW(memory, sizeof(struct memory_softc), memory_match, memory_attach,
               NULL, NULL);
 
 int	memory_i2c_acquire_bus(void *, int);
@@ -98,6 +98,7 @@ memory_attach(device_t parent, device_t 
 	struct i2c_controller ic;
 	struct i2c_attach_args ia;
 
+	sc->sc_dev = self;
 	sc->sc_len = OF_getproplen(ca->ca_node, "dimm-info");
 	if (sc->sc_len > 0) {
 		sc->sc_buf = malloc(sc->sc_len, M_DEVBUF, M_NOWAIT);

Reply via email to