diff options
| author | xtraeme <xtraeme@NetBSD.org> | 2007-07-02 10:36:47 +0000 |
|---|---|---|
| committer | xtraeme <xtraeme@NetBSD.org> | 2007-07-02 10:36:47 +0000 |
| commit | 02974d235ee40f3efdfcd63c8bd0370b8dff073f (patch) | |
| tree | 11a0cb8bd857c9e37fa50e3e4aed94c8e3389c98 /sys/dev | |
| parent | ecb89ffa1a53e187cb96e33d00a21bfc3e5ce1e6 (diff) | |
pic16lc_update: use the edata pointer rather than using softc's array
index.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/i2c/pic16lc.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/i2c/pic16lc.c b/sys/dev/i2c/pic16lc.c index 648825a5942..e3918c3fcc1 100644 --- a/sys/dev/i2c/pic16lc.c +++ b/sys/dev/i2c/pic16lc.c @@ -1,4 +1,4 @@ -/* $NetBSD: pic16lc.c,v 1.7 2007/07/01 07:37:17 xtraeme Exp $ */ +/* $NetBSD: pic16lc.c,v 1.8 2007/07/02 10:36:47 xtraeme Exp $ */ /*- * Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca> @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pic16lc.c,v 1.7 2007/07/01 07:37:17 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pic16lc.c,v 1.8 2007/07/02 10:36:47 xtraeme Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -201,14 +201,12 @@ pic16lc_update(struct pic16lc_softc *sc, envsys_data_t *edata) if (edata->sensor == XBOX_SENSOR_CPU) { pic16lc_read_1(sc, PIC16LC_REG_CPUTEMP, &cputemp); - sc->sc_data[XBOX_SENSOR_CPU].state = ENVSYS_SVALID; - sc->sc_data[XBOX_SENSOR_CPU].value_cur = - (int)cputemp * 1000000 + 273150000; + edata->state = ENVSYS_SVALID; + edata->value_cur = (int)cputemp * 1000000 + 273150000; } else { pic16lc_read_1(sc, PIC16LC_REG_BOARDTEMP, &boardtemp); - sc->sc_data[XBOX_SENSOR_BOARD].state = ENVSYS_SVALID; - sc->sc_data[XBOX_SENSOR_BOARD].value_cur = - (int)boardtemp * 1000000 + 273150000; + edata->state = ENVSYS_SVALID; + edata->value_cur = (int)boardtemp * 1000000 + 273150000; } iic_release_bus(sc->sc_tag, 0); |
