summaryrefslogtreecommitdiff
path: root/sys/dev/spi/tmp121.c
diff options
context:
space:
mode:
authorxtraeme <xtraeme@NetBSD.org>2008-04-04 10:11:01 +0000
committerxtraeme <xtraeme@NetBSD.org>2008-04-04 10:11:01 +0000
commit63e2f604f650cf8f13d5ff5dbfd39cc062f89b7a (patch)
tree80ab4e5b35cf128dcfdc0a36defdf7497a888886 /sys/dev/spi/tmp121.c
parentad882177bc5fab4049612a606acbb36477ac0c22 (diff)
Split device_t/softc and other related cosmetic changes.
Diffstat (limited to 'sys/dev/spi/tmp121.c')
-rw-r--r--sys/dev/spi/tmp121.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/sys/dev/spi/tmp121.c b/sys/dev/spi/tmp121.c
index ca790ffac4a..29844196eab 100644
--- a/sys/dev/spi/tmp121.c
+++ b/sys/dev/spi/tmp121.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tmp121.c,v 1.3 2007/11/16 08:00:16 xtraeme Exp $ */
+/* $NetBSD: tmp121.c,v 1.4 2008/04/04 10:13:59 xtraeme Exp $ */
/*-
* Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmp121.c,v 1.3 2007/11/16 08:00:16 xtraeme Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmp121.c,v 1.4 2008/04/04 10:13:59 xtraeme Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -54,24 +54,22 @@ __KERNEL_RCSID(0, "$NetBSD: tmp121.c,v 1.3 2007/11/16 08:00:16 xtraeme Exp $");
#include <dev/spi/spivar.h>
struct tmp121temp_softc {
- struct device sc_dev;
-
struct spi_handle *sc_sh;
struct sysmon_envsys *sc_sme;
envsys_data_t sc_sensor;
};
-static int tmp121temp_match(struct device *, struct cfdata *, void *);
-static void tmp121temp_attach(struct device *, struct device *, void *);
+static int tmp121temp_match(device_t, cfdata_t, void *);
+static void tmp121temp_attach(device_t, device_t, void *);
-static void tmp121temp_refresh(struct sysmon_envsys *, envsys_data_t *);
+static void tmp121temp_refresh(struct sysmon_envsys *, envsys_data_t *);
-CFATTACH_DECL(tmp121temp, sizeof(struct tmp121temp_softc),
+CFATTACH_DECL_NEW(tmp121temp, sizeof(struct tmp121temp_softc),
tmp121temp_match, tmp121temp_attach, NULL, NULL);
static int
-tmp121temp_match(struct device *parent, struct cfdata *cf, void *aux)
+tmp121temp_match(device_t parent, cfdata_t cf, void *aux)
{
struct spi_attach_args *sa = aux;
@@ -83,7 +81,7 @@ tmp121temp_match(struct device *parent, struct cfdata *cf, void *aux)
}
static void
-tmp121temp_attach(struct device *parent, struct device *self, void *aux)
+tmp121temp_attach(device_t parent, device_t self, void *aux)
{
struct tmp121temp_softc *sc = device_private(self);
struct spi_attach_args *sa = aux;
@@ -107,8 +105,7 @@ tmp121temp_attach(struct device *parent, struct device *self, void *aux)
sc->sc_sme->sme_cookie = sc;
if (sysmon_envsys_register(sc->sc_sme)) {
- aprint_error("%s: unable to register with sysmon\n",
- device_xname(self));
+ aprint_error_dev(self, "unable to register with sysmon\n");
sysmon_envsys_destroy(sc->sc_sme);
}
}