Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hpcmips Fix device_t/softc confusion.



details:   https://anonhg.NetBSD.org/src/rev/ad03a832ba75
branches:  trunk
changeset: 763296:ad03a832ba75
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Wed Mar 16 14:43:36 2011 +0000

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

diffstat:

 sys/arch/hpcmips/hpcmips/clock.c   |   8 ++++----
 sys/arch/hpcmips/include/sysconf.h |   6 +++---
 sys/arch/hpcmips/tx/tx39clock.c    |  10 +++++-----
 sys/arch/hpcmips/vr/rtc.c          |  14 +++++++-------
 4 files changed, 19 insertions(+), 19 deletions(-)

diffs (153 lines):

diff -r 9ab7cf751512 -r ad03a832ba75 sys/arch/hpcmips/hpcmips/clock.c
--- a/sys/arch/hpcmips/hpcmips/clock.c  Wed Mar 16 14:39:26 2011 +0000
+++ b/sys/arch/hpcmips/hpcmips/clock.c  Wed Mar 16 14:43:36 2011 +0000
@@ -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;
 }
 
diff -r 9ab7cf751512 -r ad03a832ba75 sys/arch/hpcmips/include/sysconf.h
--- a/sys/arch/hpcmips/include/sysconf.h        Wed Mar 16 14:39:26 2011 +0000
+++ b/sys/arch/hpcmips/include/sysconf.h        Wed Mar 16 14:43:36 2011 +0000
@@ -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_ */
diff -r 9ab7cf751512 -r ad03a832ba75 sys/arch/hpcmips/tx/tx39clock.c
--- a/sys/arch/hpcmips/tx/tx39clock.c   Wed Mar 16 14:39:26 2011 +0000
+++ b/sys/arch/hpcmips/tx/tx39clock.c   Wed Mar 16 14:43:36 2011 +0000
@@ -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;
diff -r 9ab7cf751512 -r ad03a832ba75 sys/arch/hpcmips/vr/rtc.c
--- a/sys/arch/hpcmips/vr/rtc.c Wed Mar 16 14:39:26 2011 +0000
+++ b/sys/arch/hpcmips/vr/rtc.c Wed Mar 16 14:43:36 2011 +0000
@@ -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);
        /*



Home | Main Index | Thread Index | Old Index