Module Name: src Committed By: bouyer Date: Thu Mar 15 16:20:36 UTC 2012
Modified Files: src/sys/dev/i2c: cx24227.c Log Message: always set *data to appease gcc -03 (some users of cx24227_readreg() don't check return value for error). To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/dev/i2c/cx24227.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/dev/i2c/cx24227.c diff -u src/sys/dev/i2c/cx24227.c:1.5 src/sys/dev/i2c/cx24227.c:1.6 --- src/sys/dev/i2c/cx24227.c:1.5 Sun Oct 2 19:03:56 2011 +++ src/sys/dev/i2c/cx24227.c Thu Mar 15 16:20:36 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: cx24227.c,v 1.5 2011/10/02 19:03:56 jmcneill Exp $ */ +/* $NetBSD: cx24227.c,v 1.6 2012/03/15 16:20:36 bouyer Exp $ */ /* * Copyright (c) 2008, 2011 Jonathan A. Kollasch @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cx24227.c,v 1.5 2011/10/02 19:03:56 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cx24227.c,v 1.6 2012/03/15 16:20:36 bouyer Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -128,11 +128,11 @@ cx24227_readreg(struct cx24227 *sc, uint int error; uint8_t r[2]; + *data = 0x0000; + if (iic_acquire_bus(sc->tag, I2C_F_POLL) != 0) return -1; - *data = 0x0000; - error = iic_exec(sc->tag, I2C_OP_READ_WITH_STOP, sc->addr, ®, 1, r, 2, I2C_F_POLL);