Module Name:    src
Committed By:   tsutsui
Date:           Tue Aug 31 15:17:20 UTC 2010

Modified Files:
        src/sys/arch/dreamcast/dev: gdrom.c

Log Message:
- split device_t/softc
- include "ioconf.h" for struct cfdriver


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/dreamcast/dev/gdrom.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/dreamcast/dev/gdrom.c
diff -u src/sys/arch/dreamcast/dev/gdrom.c:1.27 src/sys/arch/dreamcast/dev/gdrom.c:1.28
--- src/sys/arch/dreamcast/dev/gdrom.c:1.27	Tue Aug 31 12:12:48 2010
+++ src/sys/arch/dreamcast/dev/gdrom.c	Tue Aug 31 15:17:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gdrom.c,v 1.27 2010/08/31 12:12:48 tsutsui Exp $	*/
+/*	$NetBSD: gdrom.c,v 1.28 2010/08/31 15:17:20 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2001 Marcus Comstedt
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: gdrom.c,v 1.27 2010/08/31 12:12:48 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdrom.c,v 1.28 2010/08/31 15:17:20 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -50,8 +50,10 @@
 
 #include <machine/sysasicvar.h>
 
-int	gdrommatch(struct device *, struct cfdata *, void *);
-void	gdromattach(struct device *, struct device *, void *);
+#include "ioconf.h"
+
+int	gdrommatch(device_t, cfdata_t, void *);
+void	gdromattach(device_t, device_t, void *);
 
 dev_type_open(gdromopen);
 dev_type_close(gdromclose);
@@ -71,7 +73,7 @@
 };
 
 struct gdrom_softc {
-	struct device sc_dv;	/* generic device info; must come first */
+	device_t sc_dev;	/* generic device info */
 	struct disk dkdev;	/* generic disk info */
 	struct buf curbuf;	/* state of current I/O operation */
 
@@ -85,13 +87,11 @@
 	int cmd_cond;		/* resulting condition of command */
 };
 
-CFATTACH_DECL(gdrom, sizeof(struct gdrom_softc),
+CFATTACH_DECL_NEW(gdrom, sizeof(struct gdrom_softc),
     gdrommatch, gdromattach, NULL, NULL);
 
 struct dkdriver gdromdkdriver = { gdromstrategy };
 
-extern struct cfdriver gdrom_cd;
-
 
 struct gd_toc {
 	unsigned int entry[99];
@@ -368,7 +368,7 @@
 }
 
 int
-gdrommatch(struct device *parent, struct cfdata *cf, void *aux)
+gdrommatch(device_t parent, cfdata_t cf, void *aux)
 {
 	static int gdrom_matched = 0;
 
@@ -381,17 +381,18 @@
 }
 
 void
-gdromattach(struct device *parent, struct device *self, void *aux)
+gdromattach(device_t parent, device_t self, void *aux)
 {
 	struct gdrom_softc *sc;
 	uint32_t p, x;
 
-	sc = (struct gdrom_softc *)self;
+	sc = device_private(self);
+	sc->sc_dev = self;
 
 	/*
 	 * Initialize and attach the disk structure.
 	 */
-	disk_init(&sc->dkdev, sc->sc_dv.dv_xname, &gdromdkdriver);
+	disk_init(&sc->dkdev, device_xname(self), &gdromdkdriver);
 	disk_attach(&sc->dkdev);
 
 	/*

Reply via email to