always set *data to appease gcc -03 (some users of cx24227_readreg() don't
check return value for error).
This commit is contained in:
parent
e15100e94c
commit
5358272642
|
@ -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, uint8_t reg, uint16_t *data)
|
|||
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue