Module Name:    src
Committed By:   tsutsui
Date:           Wed Mar 16 14:43:37 UTC 2011

Modified Files:
        src/sys/arch/hpcmips/hpcmips: clock.c
        src/sys/arch/hpcmips/include: sysconf.h
        src/sys/arch/hpcmips/tx: tx39clock.c
        src/sys/arch/hpcmips/vr: rtc.c

Log Message:
Fix device_t/softc confusion.
(currently harmless since they are not split yet)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hpcmips/hpcmips/clock.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hpcmips/include/sysconf.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/hpcmips/tx/tx39clock.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/hpcmips/vr/rtc.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/hpcmips/hpcmips/clock.c
diff -u src/sys/arch/hpcmips/hpcmips/clock.c:1.21 src/sys/arch/hpcmips/hpcmips/clock.c:1.22
--- src/sys/arch/hpcmips/hpcmips/clock.c:1.21	Tue Feb  8 20:20:15 2011
+++ src/sys/arch/hpcmips/hpcmips/clock.c	Wed Mar 16 14:43:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.21 2011/02/08 20:20:15 rmind Exp $	*/
+/*	$NetBSD: clock.c,v 1.22 2011/03/16 14:43:36 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 Shin Takemura, All rights reserved.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.21 2011/02/08 20:20:15 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.22 2011/03/16 14:43:36 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -83,12 +83,12 @@
  *	Register CPU(VR41XX or TX39XX) dependent clock routine to system.
  */
 void
-platform_clock_attach(void *ctx, struct platform_clock *clock)
+platform_clock_attach(device_t dev, struct platform_clock *clock)
 {
 
 	printf("\n");
 
-	clock->self = ctx;
+	clock->self = dev;
 	platform.clock = clock;
 }
 

Index: src/sys/arch/hpcmips/include/sysconf.h
diff -u src/sys/arch/hpcmips/include/sysconf.h:1.16 src/sys/arch/hpcmips/include/sysconf.h:1.17
--- src/sys/arch/hpcmips/include/sysconf.h:1.16	Sun Feb 20 07:58:14 2011
+++ src/sys/arch/hpcmips/include/sysconf.h	Wed Mar 16 14:43:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysconf.h,v 1.16 2011/02/20 07:58:14 matt Exp $	*/
+/*	$NetBSD: sysconf.h,v 1.17 2011/03/16 14:43:36 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -73,12 +73,12 @@
 
 struct platform_clock {
 	int	hz;
-	void	(*init)(struct device *);
+	void	(*init)(device_t);
 	void	*self;
 	int	start;
 };
 
-void platform_clock_attach(void *, struct platform_clock *);
+void platform_clock_attach(device_t, struct platform_clock *);
 
 #endif /* _KERNEL */
 #endif /* !_HPCMIPS_SYSCONF_H_ */

Index: src/sys/arch/hpcmips/tx/tx39clock.c
diff -u src/sys/arch/hpcmips/tx/tx39clock.c:1.24 src/sys/arch/hpcmips/tx/tx39clock.c:1.25
--- src/sys/arch/hpcmips/tx/tx39clock.c:1.24	Wed Mar 16 14:39:26 2011
+++ src/sys/arch/hpcmips/tx/tx39clock.c	Wed Mar 16 14:43:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tx39clock.c,v 1.24 2011/03/16 14:39:26 tsutsui Exp $ */
+/*	$NetBSD: tx39clock.c,v 1.25 2011/03/16 14:43:37 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tx39clock.c,v 1.24 2011/03/16 14:39:26 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tx39clock.c,v 1.25 2011/03/16 14:43:37 tsutsui Exp $");
 
 #include "opt_tx39clock_debug.h"
 
@@ -110,7 +110,7 @@
 tx39clock_attach(struct device *parent, struct device *self, void *aux)
 {
 	struct txsim_attach_args *ta = aux;
-	struct tx39clock_softc *sc = (void*)self;
+	struct tx39clock_softc *sc = device_private(self);
 	tx_chipset_tag_t tc;
 	txreg_t reg;
 
@@ -248,9 +248,9 @@
 }
 
 void
-tx39clock_init(struct device *dev)
+tx39clock_init(device_t self)
 {
-	struct tx39clock_softc *sc = (void*)dev;
+	struct tx39clock_softc *sc = device_private(self);
 	tx_chipset_tag_t tc = sc->sc_tc;
 	txreg_t reg;
 	int pcnt;

Index: src/sys/arch/hpcmips/vr/rtc.c
diff -u src/sys/arch/hpcmips/vr/rtc.c:1.29 src/sys/arch/hpcmips/vr/rtc.c:1.30
--- src/sys/arch/hpcmips/vr/rtc.c:1.29	Wed Mar 16 14:28:39 2011
+++ src/sys/arch/hpcmips/vr/rtc.c	Wed Mar 16 14:43:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtc.c,v 1.29 2011/03/16 14:28:39 tsutsui Exp $	*/
+/*	$NetBSD: rtc.c,v 1.30 2011/03/16 14:43:37 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 Shin Takemura. All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.29 2011/03/16 14:28:39 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.30 2011/03/16 14:43:37 tsutsui Exp $");
 
 #include "opt_vr41xx.h"
 
@@ -88,7 +88,7 @@
 	struct timecounter sc_tc;
 };
 
-void	vrrtc_init(struct device *);
+void	vrrtc_init(device_t);
 int	vrrtc_get(todr_chip_handle_t, struct timeval *);
 int	vrrtc_set(todr_chip_handle_t, struct timeval *);
 uint32_t vrrtc_get_timecount(struct timecounter *);
@@ -125,7 +125,7 @@
 vrrtc_attach(struct device *parent, struct device *self, void *aux)
 {
 	struct vrip_attach_args *va = aux;
-	struct vrrtc_softc *sc = (void *)self;
+	struct vrrtc_softc *sc = device_private(self);
 	int year;
 
 #ifndef SINGLE_VRIP_BASE
@@ -217,7 +217,7 @@
 	sc->sc_todr.cookie = sc;
 	todr_attach(&sc->sc_todr);
 
-	platform_clock_attach(sc, &vr_clock);
+	platform_clock_attach(self, &vr_clock);
 }
 
 int
@@ -236,9 +236,9 @@
 }
 
 void
-vrrtc_init(struct device *dev)
+vrrtc_init(device_t self)
 {
-	struct vrrtc_softc *sc = (struct vrrtc_softc *)dev;
+	struct vrrtc_softc *sc = device_private(self);
 
 	DDUMP_REGS(sc);
 	/*

Reply via email to