Module Name:    src
Committed By:   tsutsui
Date:           Thu Aug 19 15:17:53 UTC 2010

Modified Files:
        src/sys/arch/arm/sa11x0: sa11x0_com.c
        src/sys/arch/hpcarm/dev: j720pcic.c

Log Message:
Fix device_t/softc split botches.  PR port-hpcarm/43780


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/arm/sa11x0/sa11x0_com.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpcarm/dev/j720pcic.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/arm/sa11x0/sa11x0_com.c
diff -u src/sys/arch/arm/sa11x0/sa11x0_com.c:1.46 src/sys/arch/arm/sa11x0/sa11x0_com.c:1.47
--- src/sys/arch/arm/sa11x0/sa11x0_com.c:1.46	Sun Dec  6 21:33:45 2009
+++ src/sys/arch/arm/sa11x0/sa11x0_com.c	Thu Aug 19 15:17:53 2010
@@ -1,4 +1,4 @@
-/*      $NetBSD: sa11x0_com.c,v 1.46 2009/12/06 21:33:45 dyoung Exp $        */
+/*      $NetBSD: sa11x0_com.c,v 1.47 2010/08/19 15:17:53 tsutsui Exp $        */
 
 /*-
  * Copyright (c) 1998, 1999, 2001 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.46 2009/12/06 21:33:45 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.47 2010/08/19 15:17:53 tsutsui Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -159,7 +159,7 @@
 
 #ifdef hpcarm
 /* HPCARM specific functions */
-static void	sacom_j720_init(struct sa11x0_softc *, struct sacom_softc *);
+static void	sacom_j720_init(device_t, device_t);
 #endif
 
 #define COMUNIT_MASK	0x7ffff
@@ -234,7 +234,7 @@
 
 #ifdef hpcarm
 	struct platid_data *p;
-	void (*mdinit)(device_t, struct sacom_softc *);
+	void (*mdinit)(device_t, device_t);
 #endif
 
 	aprint_normal("\n");
@@ -270,7 +270,7 @@
 	/* Do hpcarm specific initialization, if any */
 	if ((p = platid_search_data(&platid, sacom_platid_table)) != NULL) {
 		mdinit = p->data;
-		(mdinit)(parent, sc);
+		(*mdinit)(parent, self);
 	}
 #endif
 
@@ -1400,12 +1400,16 @@
 }
 
 static void
-sacom_j720_init(struct sa11x0_softc *parent, struct sacom_softc *sc) {
+sacom_j720_init(device_t parent, device_t self)
+{
+	struct sa11x0_softc *sasc;
+
+	sasc = device_private(parent);
 
 	/* XXX  this should be done at sc->enable function */
-	bus_space_write_4(parent->sc_iot, parent->sc_gpioh,
+	bus_space_write_4(sasc->sc_iot, sasc->sc_gpioh,
 	    SAGPIO_PCR, 0xa0000);
-	bus_space_write_4(parent->sc_iot, parent->sc_gpioh,
+	bus_space_write_4(sasc->sc_iot, sasc->sc_gpioh,
 	    SAGPIO_PSR, 0x100);
 }
 

Index: src/sys/arch/hpcarm/dev/j720pcic.c
diff -u src/sys/arch/hpcarm/dev/j720pcic.c:1.6 src/sys/arch/hpcarm/dev/j720pcic.c:1.7
--- src/sys/arch/hpcarm/dev/j720pcic.c:1.6	Fri May 29 14:15:45 2009
+++ src/sys/arch/hpcarm/dev/j720pcic.c	Thu Aug 19 15:17:53 2010
@@ -1,4 +1,4 @@
-/*      $NetBSD: j720pcic.c,v 1.6 2009/05/29 14:15:45 rjs Exp $        */
+/*      $NetBSD: j720pcic.c,v 1.7 2010/08/19 15:17:53 tsutsui Exp $        */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 /* Jornada 720 PCMCIA support. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: j720pcic.c,v 1.6 2009/05/29 14:15:45 rjs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: j720pcic.c,v 1.7 2010/08/19 15:17:53 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -99,9 +99,14 @@
 static void
 sacpcic_attach(device_t parent, device_t self, void *aux)
 {
+	struct sacc_softc *psc;
+	struct sacpcic_softc *sc;
 
-	sacpcic_attach_common(device_private(parent),
-	    device_private(self), aux, j720_socket_setup);
+	psc = device_private(parent);
+	sc = device_private(self);
+	sc->sc_pc.sc_dev = self;
+
+	sacpcic_attach_common(psc, sc, aux, j720_socket_setup);
 }
 
 static void

Reply via email to