Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/dev/i2c/i2c.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/dev/i2c/i2c.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.44.2.2 retrieving revision 1.45 diff -u -p -r1.44.2.2 -r1.45 --- src/sys/dev/i2c/i2c.c 2015/05/16 04:06:04 1.44.2.2 +++ src/sys/dev/i2c/i2c.c 2014/12/07 00:32:35 1.45 @@ -1,4 +1,4 @@ -/* $NetBSD: i2c.c,v 1.44.2.2 2015/05/16 04:06:04 snj Exp $ */ +/* $NetBSD: i2c.c,v 1.45 2014/12/07 00:32:35 jmcneill Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -35,8 +35,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#ifdef _KERNEL_OPT +#include "opt_i2c.h" +#endif + #include -__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.44.2.2 2015/05/16 04:06:04 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.45 2014/12/07 00:32:35 jmcneill Exp $"); #include #include @@ -55,7 +59,9 @@ __KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.44 #include "locators.h" +#ifndef I2C_MAX_ADDR #define I2C_MAX_ADDR 0x3ff /* 10-bit address, max */ +#endif struct iic_softc { i2c_tag_t sc_tag; @@ -519,15 +525,6 @@ iic_ioctl_exec(struct iic_softc *sc, i2c } } - if (iie->iie_buf != NULL && I2C_OP_WRITE_P(iie->iie_op)) { - error = copyin(iie->iie_buf, buf, iie->iie_buflen); - if (error) { - if (cmd) - kmem_free(cmd, iie->iie_cmdlen); - return error; - } - } - iic_acquire_bus(ic, 0); error = iic_exec(ic, iie->iie_op, iie->iie_addr, cmd, iie->iie_cmdlen, buf, iie->iie_buflen, 0); @@ -545,7 +542,7 @@ iic_ioctl_exec(struct iic_softc *sc, i2c if (error) return error; - if (iie->iie_buf != NULL && I2C_OP_READ_P(iie->iie_op)) + if (iie->iie_buf) error = copyout(buf, iie->iie_buf, iie->iie_buflen); return error;