Module Name: src
Committed By: tsutsui
Date: Fri Apr 9 12:50:34 UTC 2010
Modified Files:
src/sys/arch/atari/dev: zs.c
Log Message:
Split device_t/softc.
To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/atari/dev/zs.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/atari/dev/zs.c
diff -u src/sys/arch/atari/dev/zs.c:1.68 src/sys/arch/atari/dev/zs.c:1.69
--- src/sys/arch/atari/dev/zs.c:1.68 Fri Apr 9 12:38:48 2010
+++ src/sys/arch/atari/dev/zs.c Fri Apr 9 12:50:34 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.68 2010/04/09 12:38:48 tsutsui Exp $ */
+/* $NetBSD: zs.c,v 1.69 2010/04/09 12:50:34 tsutsui Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.68 2010/04/09 12:38:48 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.69 2010/04/09 12:50:34 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -122,7 +122,7 @@
* Software state per found chip.
*/
struct zs_softc {
- struct device sc_dev; /* base device */
+ device_t sc_dev; /* base device */
struct zsdevice *sc_zs; /* chip registers */
struct zs_chanstate sc_cs[2]; /* chan A and B software state */
};
@@ -220,10 +220,10 @@
static u_long *zs_frequencies;
/* Definition of the driver for autoconfig. */
-static int zsmatch(struct device *, struct cfdata *, void *);
-static void zsattach(struct device *, struct device *, void *);
+static int zsmatch(device_t, cfdata_t, void *);
+static void zsattach(device_t, device_t, void *);
-CFATTACH_DECL(zs, sizeof(struct zs_softc),
+CFATTACH_DECL_NEW(zs, sizeof(struct zs_softc),
zsmatch, zsattach, NULL, NULL);
/* {b,c}devsw[] function prototypes */
@@ -262,11 +262,11 @@
static void zs_shutdown(struct zs_chanstate *);
static int
-zsmatch(struct device *pdp, struct cfdata *cfp, void *auxp)
+zsmatch(device_t parent, cfdata_t cf, void *aux)
{
static int zs_matched = 0;
- if (strcmp("zs", auxp) || zs_matched)
+ if (strcmp("zs", aux) || zs_matched)
return 0;
zs_matched = 1;
return 1;
@@ -276,7 +276,7 @@
* Attach a found zs.
*/
static void
-zsattach(struct device *parent, struct device *dev, void *aux)
+zsattach(device_t parent, device_t self, void *aux)
{
struct zs_softc *sc;
struct zs_chanstate *cs;
@@ -284,7 +284,8 @@
uint8_t tmp;
addr = (struct zsdevice *)AD_SCC;
- sc = (struct zs_softc *)dev;
+ sc = device_private(self);
+ sc->sc_dev = self;
sc->sc_zs = addr;
cs = sc->sc_cs;