Use device_private().

This commit is contained in:
thorpej 2006-03-29 06:41:24 +00:00
parent 92c7bba3df
commit 8fc3572573
21 changed files with 63 additions and 63 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: adm1030.c,v 1.5 2006/02/17 18:45:40 macallan Exp $ */
/* $NetBSD: adm1030.c,v 1.6 2006/03/29 06:41:24 thorpej Exp $ */
/*-
* Copyright (C) 2005 Michael Lorenz.
@ -33,7 +33,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: adm1030.c,v 1.5 2006/02/17 18:45:40 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: adm1030.c,v 1.6 2006/03/29 06:41:24 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -85,7 +85,7 @@ adm1030c_attach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
struct adm1030c_softc *sc = (struct adm1030c_softc *)self;
struct adm1030c_softc *sc = device_private(self);
struct i2c_attach_args *args = aux;
sc->parent = parent;

View File

@ -1,4 +1,4 @@
/* $NetBSD: adt7463.c,v 1.2 2006/02/19 08:40:12 xtraeme Exp $ */
/* $NetBSD: adt7463.c,v 1.3 2006/03/29 06:41:24 thorpej Exp $ */
/*
* Copyright (c) 2005 Anil Gopinath (anil_public@yahoo.com)
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: adt7463.c,v 1.2 2006/02/19 08:40:12 xtraeme Exp $");
__KERNEL_RCSID(0, "$NetBSD: adt7463.c,v 1.3 2006/03/29 06:41:24 thorpej Exp $");
/* Fan speed control added by Hanns Hartman */
#include <sys/param.h>
@ -87,7 +87,7 @@ adt7463c_match(struct device *parent, struct cfdata *cf, void *aux)
static void
adt7463c_attach(struct device *parent, struct device *self, void *aux)
{
struct adt7463c_softc *sc = (struct adt7463c_softc *)self;
struct adt7463c_softc *sc = device_private(self);
struct i2c_attach_args *ia = aux;
int i = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: adt7467.c,v 1.5 2006/02/17 18:45:40 macallan Exp $ */
/* $NetBSD: adt7467.c,v 1.6 2006/03/29 06:41:24 thorpej Exp $ */
/*-
* Copyright (C) 2005 Michael Lorenz
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: adt7467.c,v 1.5 2006/02/17 18:45:40 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: adt7467.c,v 1.6 2006/03/29 06:41:24 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -87,7 +87,7 @@ adt7467c_attach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
struct adt7467c_softc *sc = (struct adt7467c_softc *)self;
struct adt7467c_softc *sc = device_private(self);
struct i2c_attach_args *args = aux;
sc->parent = parent;

View File

@ -1,4 +1,4 @@
/* $NetBSD: at24cxx.c,v 1.4 2005/12/13 20:55:46 abs Exp $ */
/* $NetBSD: at24cxx.c,v 1.5 2006/03/29 06:41:24 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -109,7 +109,7 @@ seeprom_match(struct device *parent, struct cfdata *cf, void *aux)
static void
seeprom_attach(struct device *parent, struct device *self, void *aux)
{
struct seeprom_softc *sc = (struct seeprom_softc *)self;
struct seeprom_softc *sc = device_private(self);
struct i2c_attach_args *ia = aux;
sc->sc_tag = ia->ia_tag;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ds1307.c,v 1.4 2005/12/13 20:55:46 abs Exp $ */
/* $NetBSD: ds1307.c,v 1.5 2006/03/29 06:41:24 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -95,7 +95,7 @@ dsrtc_match(struct device *parent, struct cfdata *cf, void *arg)
static void
dsrtc_attach(struct device *parent, struct device *self, void *arg)
{
struct dsrtc_softc *sc = (struct dsrtc_softc *)self;
struct dsrtc_softc *sc = device_private(self);
struct i2c_attach_args *ia = arg;
aprint_naive(": Real-time Clock/NVRAM\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: i2c.c,v 1.6 2006/03/27 23:59:38 jmcneill Exp $ */
/* $NetBSD: i2c.c,v 1.7 2006/03/29 06:41:24 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -103,7 +103,7 @@ iic_match(struct device *parent, struct cfdata *cf, void *aux)
static void
iic_attach(struct device *parent, struct device *self, void *aux)
{
struct iic_softc *sc = (void *) self;
struct iic_softc *sc = device_private(self);
struct i2cbus_attach_args *iba = aux;
aprint_naive(": I2C bus\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: lm75.c,v 1.5 2006/03/29 04:16:49 thorpej Exp $ */
/* $NetBSD: lm75.c,v 1.6 2006/03/29 06:41:24 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -91,7 +91,7 @@ lmtemp_match(struct device *parent, struct cfdata *cf, void *aux)
static void
lmtemp_attach(struct device *parent, struct device *self, void *aux)
{
struct lmtemp_softc *sc = (struct lmtemp_softc *)self;
struct lmtemp_softc *sc = device_private(self);
struct i2c_attach_args *ia = aux;
int ptype;

View File

@ -1,4 +1,4 @@
/* $NetBSD: m41st84.c,v 1.6 2005/12/13 20:55:46 abs Exp $ */
/* $NetBSD: m41st84.c,v 1.7 2006/03/29 06:41:24 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -95,7 +95,7 @@ strtc_match(struct device *parent, struct cfdata *cf, void *arg)
static void
strtc_attach(struct device *parent, struct device *self, void *arg)
{
struct strtc_softc *sc = (struct strtc_softc *)self;
struct strtc_softc *sc = device_private(self);
struct i2c_attach_args *ia = arg;
aprint_naive(": Real-time Clock/NVRAM\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: m41t00.c,v 1.5 2005/12/11 12:21:22 christos Exp $ */
/* $NetBSD: m41t00.c,v 1.6 2006/03/29 06:41:24 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -99,7 +99,7 @@ m41t00_match(struct device *parent, struct cfdata *cf, void *aux)
void
m41t00_attach(struct device *parent, struct device *self, void *aux)
{
struct m41t00_softc *sc = (struct m41t00_softc *)self;
struct m41t00_softc *sc = device_private(self);
struct i2c_attach_args *ia = aux;
sc->sc_tag = ia->ia_tag;

View File

@ -1,4 +1,4 @@
/* $NetBSD: max6900.c,v 1.4 2005/12/13 20:55:46 abs Exp $ */
/* $NetBSD: max6900.c,v 1.5 2006/03/29 06:41:24 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -95,7 +95,7 @@ maxrtc_match(struct device *parent, struct cfdata *cf, void *aux)
void
maxrtc_attach(struct device *parent, struct device *self, void *aux)
{
struct maxrtc_softc *sc = (struct maxrtc_softc *)self;
struct maxrtc_softc *sc = device_private(self);
struct i2c_attach_args *ia = aux;
sc->sc_tag = ia->ia_tag;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcf8583.c,v 1.3 2005/12/11 12:21:23 christos Exp $ */
/* $NetBSD: pcf8583.c,v 1.4 2006/03/29 06:41:24 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -105,7 +105,7 @@ pcfrtc_match(struct device *parent, struct cfdata *cf, void *aux)
void
pcfrtc_attach(struct device *parent, struct device *self, void *aux)
{
struct pcfrtc_softc *sc = (struct pcfrtc_softc *)self;
struct pcfrtc_softc *sc = device_private(self);
struct i2c_attach_args *ia = aux;
uint8_t cmdbuf[1], csr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: r2025.c,v 1.1 2006/03/06 19:55:08 shige Exp $ */
/* $NetBSD: r2025.c,v 1.2 2006/03/29 06:41:24 thorpej Exp $ */
/*-
* Copyright (c) 2006 Shigeyuki Fukushima.
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: r2025.c,v 1.1 2006/03/06 19:55:08 shige Exp $");
__KERNEL_RCSID(0, "$NetBSD: r2025.c,v 1.2 2006/03/29 06:41:24 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -89,7 +89,7 @@ r2025rtc_match(struct device *parent, struct cfdata *cf, void *arg)
static void
r2025rtc_attach(struct device *parent, struct device *self, void *arg)
{
struct r2025rtc_softc *sc = (struct r2025rtc_softc *)self;
struct r2025rtc_softc *sc = device_private(self);
struct i2c_attach_args *ia = arg;
aprint_normal(": RICOH R2025S/D Real-time Clock\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: rs5c372.c,v 1.4 2005/12/11 12:21:23 christos Exp $ */
/* $NetBSD: rs5c372.c,v 1.5 2006/03/29 06:41:24 thorpej Exp $ */
/*
* Copyright (c) 2005 Kimihiro Nonaka
@ -74,7 +74,7 @@ rs5c372rtc_match(struct device *parent, struct cfdata *cf, void *arg)
static void
rs5c372rtc_attach(struct device *parent, struct device *self, void *arg)
{
struct rs5c372rtc_softc *sc = (struct rs5c372rtc_softc *)self;
struct rs5c372rtc_softc *sc = device_private(self);
struct i2c_attach_args *ia = arg;
aprint_naive(": Real-time Clock\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: x1226.c,v 1.7 2005/12/11 12:21:23 christos Exp $ */
/* $NetBSD: x1226.c,v 1.8 2006/03/29 06:41:24 thorpej Exp $ */
/*
* Copyright (c) 2003 Shigeyuki Fukushima.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: x1226.c,v 1.7 2005/12/11 12:21:23 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: x1226.c,v 1.8 2006/03/29 06:41:24 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -106,7 +106,7 @@ xrtc_match(struct device *parent, struct cfdata *cf, void *arg)
static void
xrtc_attach(struct device *parent, struct device *self, void *arg)
{
struct xrtc_softc *sc = (struct xrtc_softc *)self;
struct xrtc_softc *sc = device_private(self);
struct i2c_attach_args *ia = arg;
aprint_naive(": Real-time Clock/NVRAM\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: dpti.c,v 1.23 2006/03/28 17:38:30 thorpej Exp $ */
/* $NetBSD: dpti.c,v 1.24 2006/03/29 06:45:05 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dpti.c,v 1.23 2006/03/28 17:38:30 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: dpti.c,v 1.24 2006/03/29 06:45:05 thorpej Exp $");
#include "opt_i2o.h"
@ -185,8 +185,8 @@ dpti_attach(struct device *parent, struct device *self, void *aux)
} __attribute__ ((__packed__)) param;
int rv;
sc = (struct dpti_softc *)self;
iop = (struct iop_softc *)parent;
sc = device_private(self);
iop = device_private(parent);
/*
* Tell the world what we are. The description in the signature

View File

@ -1,4 +1,4 @@
/* $NetBSD: iop.c,v 1.53 2006/03/28 17:38:30 thorpej Exp $ */
/* $NetBSD: iop.c,v 1.54 2006/03/29 06:45:05 thorpej Exp $ */
/*-
* Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.53 2006/03/28 17:38:30 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.54 2006/03/29 06:45:05 thorpej Exp $");
#include "opt_i2o.h"
#include "iop.h"
@ -486,7 +486,7 @@ iop_config_interrupts(struct device *self)
int rv, i, niop;
int locs[IOPCF_NLOCS];
sc = (struct iop_softc *)self;
sc = device_private(self);
LIST_INIT(&sc->sc_iilist);
printf("%s: configuring...\n", sc->sc_dv.dv_xname);

View File

@ -1,4 +1,4 @@
/* $NetBSD: iopl.c,v 1.20 2006/03/25 23:04:31 thorpej Exp $ */
/* $NetBSD: iopl.c,v 1.21 2006/03/29 06:45:05 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: iopl.c,v 1.20 2006/03/25 23:04:31 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: iopl.c,v 1.21 2006/03/29 06:45:05 thorpej Exp $");
#include "opt_i2o.h"
#include "opt_inet.h"
@ -218,7 +218,7 @@ iopl_attach(struct device *parent, struct device *self, void *aux)
u_int tmp;
u_int32_t tmp1, tmp2, tmp3;
sc = (struct iopl_softc *)self;
sc = device_private(self);
iop = (struct iop_softc *)parent;
ia = (struct iop_attach_args *)aux;
ifp = &sc->sc_if.sci_if;

View File

@ -1,4 +1,4 @@
/* $NetBSD: iopsp.c,v 1.22 2006/03/25 23:04:31 thorpej Exp $ */
/* $NetBSD: iopsp.c,v 1.23 2006/03/29 06:45:05 thorpej Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: iopsp.c,v 1.22 2006/03/25 23:04:31 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: iopsp.c,v 1.23 2006/03/29 06:45:05 thorpej Exp $");
#include "opt_i2o.h"
@ -136,8 +136,8 @@ iopsp_attach(struct device *parent, struct device *self, void *aux)
#endif
ia = (struct iop_attach_args *)aux;
sc = (struct iopsp_softc *)self;
iop = (struct iop_softc *)parent;
sc = device_private(self);
iop = device_private(parent);
/* Register us as an initiator. */
sc->sc_ii.ii_dv = self;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld_iop.c,v 1.19 2006/03/25 23:04:31 thorpej Exp $ */
/* $NetBSD: ld_iop.c,v 1.20 2006/03/29 06:45:05 thorpej Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ld_iop.c,v 1.19 2006/03/25 23:04:31 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ld_iop.c,v 1.20 2006/03/29 06:45:05 thorpej Exp $");
#include "opt_i2o.h"
#include "rnd.h"
@ -146,9 +146,9 @@ ld_iop_attach(struct device *parent, struct device *self, void *aux)
} p;
} __attribute__ ((__packed__)) param;
sc = (struct ld_iop_softc *)self;
sc = device_private(self);
ld = &sc->sc_ld;
iop = (struct iop_softc *)parent;
iop = device_private(parent);
ia = (struct iop_attach_args *)aux;
evreg = 0;
@ -334,8 +334,8 @@ ld_iop_detach(struct device *self, int flags)
struct iop_softc *iop;
int rv;
sc = (struct ld_iop_softc *)self;
iop = (struct iop_softc *)device_parent(self);
sc = device_private(self);
iop = device_private(device_parent(self));
if ((rv = ldbegindetach(&sc->sc_ld, flags)) != 0)
return (rv);

View File

@ -1,4 +1,4 @@
/* $NetBSD: cir.c,v 1.13 2006/03/28 17:38:33 thorpej Exp $ */
/* $NetBSD: cir.c,v 1.14 2006/03/29 06:47:06 thorpej Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cir.c,v 1.13 2006/03/28 17:38:33 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: cir.c,v 1.14 2006/03/29 06:47:06 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -89,7 +89,7 @@ cir_match(struct device *parent, struct cfdata *match, void *aux)
void
cir_attach(struct device *parent, struct device *self, void *aux)
{
struct cir_softc *sc = (struct cir_softc *)self;
struct cir_softc *sc = device_private(self);
struct ir_attach_args *ia = aux;
sc->sc_methods = ia->ia_methods;
@ -107,7 +107,7 @@ cir_attach(struct device *parent, struct device *self, void *aux)
int
cir_activate(struct device *self, enum devact act)
{
/*struct cir_softc *sc = (struct cir_softc *)self;*/
/*struct cir_softc *sc = device_private(self);*/
switch (act) {
case DVACT_ACTIVATE:
@ -123,7 +123,7 @@ cir_activate(struct device *self, enum devact act)
int
cir_detach(struct device *self, int flags)
{
/*struct cir_softc *sc = (struct cir_softc *)self;*/
/*struct cir_softc *sc = device_private(self);*/
int maj, mn;
/* locate the major number */

View File

@ -1,4 +1,4 @@
/* $NetBSD: irframe.c,v 1.32 2006/03/28 17:38:33 thorpej Exp $ */
/* $NetBSD: irframe.c,v 1.33 2006/03/29 06:47:06 thorpej Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irframe.c,v 1.32 2006/03/28 17:38:33 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: irframe.c,v 1.33 2006/03/29 06:47:06 thorpej Exp $");
#include "irframe.h"
@ -109,7 +109,7 @@ irframe_match(struct device *parent, struct cfdata *match, void *aux)
void
irframe_attach(struct device *parent, struct device *self, void *aux)
{
struct irframe_softc *sc = (struct irframe_softc *)self;
struct irframe_softc *sc = device_private(self);
struct ir_attach_args *ia = aux;
const char *delim;
int speeds = 0;
@ -153,7 +153,7 @@ irframe_attach(struct device *parent, struct device *self, void *aux)
int
irframe_activate(struct device *self, enum devact act)
{
/*struct irframe_softc *sc = (struct irframe_softc *)self;*/
/*struct irframe_softc *sc = device_private(self);*/
switch (act) {
case DVACT_ACTIVATE:
@ -168,7 +168,7 @@ irframe_activate(struct device *self, enum devact act)
int
irframe_detach(struct device *self, int flags)
{
/*struct irframe_softc *sc = (struct irframe_softc *)self;*/
/*struct irframe_softc *sc = device_private(self);*/
int maj, mn;
/* XXX needs reference count */