Module Name:    src
Committed By:   mrg
Date:           Tue Jul 26 08:56:27 UTC 2011

Modified Files:
        src/sys/arch/shark/ofw: igsfb_ofbus.c ofrom.c
        src/sys/arch/shark/shark: opms.c scr.c

Log Message:
convert to device_t, cfdata_t and CFATTACH_DECL_NEW.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/shark/ofw/igsfb_ofbus.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/shark/ofw/ofrom.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/shark/shark/opms.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/shark/shark/scr.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/shark/ofw/igsfb_ofbus.c
diff -u src/sys/arch/shark/ofw/igsfb_ofbus.c:1.12 src/sys/arch/shark/ofw/igsfb_ofbus.c:1.13
--- src/sys/arch/shark/ofw/igsfb_ofbus.c:1.12	Tue Jul 19 15:07:43 2011
+++ src/sys/arch/shark/ofw/igsfb_ofbus.c	Tue Jul 26 08:56:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: igsfb_ofbus.c,v 1.12 2011/07/19 15:07:43 dyoung Exp $ */
+/*	$NetBSD: igsfb_ofbus.c,v 1.13 2011/07/26 08:56:26 mrg Exp $ */
 
 /*
  * Copyright (c) 2006 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.12 2011/07/19 15:07:43 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.13 2011/07/26 08:56:26 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -65,12 +65,12 @@
 
 
 
-static int	igsfb_ofbus_match(struct device *, struct cfdata *, void *);
-static void	igsfb_ofbus_attach(struct device *, struct device *, void *);
+static int	igsfb_ofbus_match(device_t, cfdata_t, void *);
+static void	igsfb_ofbus_attach(device_t, device_t, void *);
 static int	igsfb_setup_dc(struct igsfb_devconfig *);
 static paddr_t	igsfb_ofbus_mmap(void *, void *, off_t, int);
 
-CFATTACH_DECL(igsfb_ofbus, sizeof(struct igsfb_softc),
+CFATTACH_DECL_NEW(igsfb_ofbus, sizeof(struct igsfb_softc),
     igsfb_ofbus_match, igsfb_ofbus_attach, NULL, NULL);
     
 static const char const *compat_strings[] = { "igs,cyperpro2010", NULL };
@@ -196,7 +196,7 @@
 
 
 static int
-igsfb_ofbus_match(struct device *parent, struct cfdata *match, void *aux)
+igsfb_ofbus_match(device_t parent, cfdata_t match, void *aux)
 {
 	struct ofbus_attach_args *oba = aux;
 
@@ -207,13 +207,14 @@
 }
 
 static void
-igsfb_ofbus_attach(struct device *parent, struct device *self, void *aux)
+igsfb_ofbus_attach(device_t parent, device_t self, void *aux)
 {
 	struct igsfb_softc *sc = (struct igsfb_softc *)self;
 	struct ofbus_attach_args *oba = aux;
 	uint32_t regs[16];
 	int isconsole, ret;
 	
+	sc->sc_dev = self;
 	if (igsfb_ofbus_is_console(oba->oba_phandle)) {
 		isconsole = 1;
 		sc->sc_dc = &igsfb_console_dc;

Index: src/sys/arch/shark/ofw/ofrom.c
diff -u src/sys/arch/shark/ofw/ofrom.c:1.22 src/sys/arch/shark/ofw/ofrom.c:1.23
--- src/sys/arch/shark/ofw/ofrom.c:1.22	Tue Jul 19 15:07:43 2011
+++ src/sys/arch/shark/ofw/ofrom.c	Tue Jul 26 08:56:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofrom.c,v 1.22 2011/07/19 15:07:43 dyoung Exp $	*/
+/*	$NetBSD: ofrom.c,v 1.23 2011/07/26 08:56:26 mrg Exp $	*/
 
 /*
  * Copyright 1998
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofrom.c,v 1.22 2011/07/19 15:07:43 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofrom.c,v 1.23 2011/07/26 08:56:26 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -52,16 +52,15 @@
 #include <dev/ofw/openfirm.h>
 
 struct ofrom_softc {
-	struct device	sc_dev;
 	int		enabled;
 	paddr_t		base;
 	paddr_t		size;
 };
 
-int ofromprobe(struct device *, struct cfdata *, void *);
-void ofromattach(struct device *, struct device *, void *);
+int ofromprobe(device_t, cfdata_t, void *);
+void ofromattach(device_t, device_t, void *);
 
-CFATTACH_DECL(ofrom, sizeof(struct ofrom_softc),
+CFATTACH_DECL_NEW(ofrom, sizeof(struct ofrom_softc),
     ofromprobe, ofromattach, NULL, NULL);
 
 extern struct cfdriver ofrom_cd;
@@ -76,7 +75,7 @@
 };
 
 int
-ofromprobe(struct device *parent, struct cfdata *cf, void *aux)
+ofromprobe(device_t parent, cfdata_t cf, void *aux)
 {
 	struct ofbus_attach_args *oba = aux;
 	static const char *const compatible_strings[] = { "rom", NULL };
@@ -87,9 +86,9 @@
 
 
 void
-ofromattach(struct device *parent, struct device *self, void *aux)
+ofromattach(device_t parent, device_t self, void *aux)
 {
-	struct ofrom_softc *sc = (struct ofrom_softc *)self;
+	struct ofrom_softc *sc = device_private(self);
 	struct ofbus_attach_args *oba = aux;
 	char regbuf[8];
 

Index: src/sys/arch/shark/shark/opms.c
diff -u src/sys/arch/shark/shark/opms.c:1.23 src/sys/arch/shark/shark/opms.c:1.24
--- src/sys/arch/shark/shark/opms.c:1.23	Sat Mar 14 15:36:13 2009
+++ src/sys/arch/shark/shark/opms.c	Tue Jul 26 08:56:26 2011
@@ -1,4 +1,4 @@
-/*      $NetBSD: opms.c,v 1.23 2009/03/14 15:36:13 dsl Exp $        */
+/*      $NetBSD: opms.c,v 1.24 2011/07/26 08:56:26 mrg Exp $        */
 
 /*
  * Copyright 1997
@@ -91,7 +91,7 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: opms.c,v 1.23 2009/03/14 15:36:13 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: opms.c,v 1.24 2011/07/26 08:56:26 mrg Exp $");
 
 #include "opms.h"
 #if NOPMS > 1
@@ -166,7 +166,6 @@
 /* Softc structure for the mouse */
 struct opms_softc 
 {               
-    struct device      sc_dev;
     void               *sc_ih;
     struct clist       sc_q;
     struct selinfo     sc_rsel;
@@ -182,20 +181,16 @@
 /*
 ** Forward routine declarations
 */
-int                  opmsprobe(struct device *, 
-                                         struct cfdata *, 
-                                         void *);
-void                 opmsattach(struct device *, 
-                                         struct device *, 
-                                         void *);
-int                  opmsintr(void *);
+int           opmsprobe(device_t, cfdata_t, void *);
+void          opmsattach(device_t, device_t, void *);
+int           opmsintr(void *);
 
 /* 
 ** Global variables 
 */
 
 /* Autoconfiguration data structures */
-CFATTACH_DECL(opms, sizeof(struct opms_softc),
+CFATTACH_DECL_NEW(opms, sizeof(struct opms_softc),
     opmsprobe, opmsattach, NULL, NULL);
 
 extern struct cfdriver opms_cd;
@@ -254,7 +249,7 @@
 **--
 */
 int
-opmsprobe(struct device *parent, struct cfdata *match, void *aux)
+opmsprobe(device_t parent, cfdata_t match, void *aux)
 {
     struct cfdata             *cf     = match;
     int                       probeOk = 0;    /* assume failure */
@@ -352,9 +347,9 @@
 **--
 */
 void
-opmsattach(struct device *parent, struct device *self, void *aux)
+opmsattach(device_t parent, device_t self, void *aux)
 {
-    struct opms_softc          *sc = (void *)self;
+    struct opms_softc         *sc = device_private(self);
     int                       irq = device_cfdata(self)->cf_loc[SPCKBDCF_IRQ];
     struct isa_attach_args    *ia = aux;                   
 

Index: src/sys/arch/shark/shark/scr.c
diff -u src/sys/arch/shark/shark/scr.c:1.25 src/sys/arch/shark/shark/scr.c:1.26
--- src/sys/arch/shark/shark/scr.c:1.25	Fri Nov 27 03:23:13 2009
+++ src/sys/arch/shark/shark/scr.c	Tue Jul 26 08:56:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: scr.c,v 1.25 2009/11/27 03:23:13 rmind Exp $	*/
+/*	$NetBSD: scr.c,v 1.26 2011/07/26 08:56:26 mrg Exp $	*/
 
 /*
  * Copyright 1997
@@ -102,7 +102,7 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scr.c,v 1.25 2009/11/27 03:23:13 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scr.c,v 1.26 2011/07/26 08:56:26 mrg Exp $");
 
 #include "opt_ddb.h"
 
@@ -450,8 +450,7 @@
 /* our soft c structure */
 struct scr_softc 
 {
-    struct device       dev;
-    int                 open;
+    int     open;
 
     /* configuration information */
     int     status;                 /* status to be returned */
@@ -577,8 +576,8 @@
 */
 
 /* configure routines */
-int     scrprobe(struct device *, struct cfdata *, void *);
-void    scrattach(struct device *, struct device *, void *);
+int     scrprobe(device_t, cfdata_t, void *);
+void    scrattach(device_t, device_t, void *);
 
 static void   initStates(struct scr_softc * sc); 
 
@@ -632,7 +631,7 @@
 
 
 
-CFATTACH_DECL(scr, sizeof(struct scr_softc),
+CFATTACH_DECL_NEW(scr, sizeof(struct scr_softc),
     scrprobe, scrattach, NULL, NULL);
 
 extern struct cfdriver scr_cd;
@@ -680,10 +679,8 @@
 **     none.
 **--
 */
-int scrprobe(parent, match, aux)
-    struct  device  *parent;
-    struct cfdata   *match;
-    void            *aux;
+int
+scrprobe(device_t parent, cfdata_t match, void *aux)
 {
     struct isa_attach_args  *ia = aux;
     int                     rv = 0;           
@@ -746,10 +743,8 @@
 **      none.
 **--
 */
-void scrattach(parent, self, aux)
-    struct device *parent;
-    struct device *self;
-    void         *aux;
+void
+scrattach(device_t parent, device_t self, void *aux)
 {
     struct scr_softc       *sc = (void *)self;
 

Reply via email to