Module Name: src Committed By: thorpej Date: Mon Dec 23 20:49:09 UTC 2019
Modified Files: src/sys/dev/i2c: tea5767.c Log Message: No need to use I2C_F_POLL here. Also fix an uninitialized error variable in tea5767_read(). To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/tea5767.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/tea5767.c diff -u src/sys/dev/i2c/tea5767.c:1.1 src/sys/dev/i2c/tea5767.c:1.2 --- src/sys/dev/i2c/tea5767.c:1.1 Fri Jul 27 12:02:26 2018 +++ src/sys/dev/i2c/tea5767.c Mon Dec 23 20:49:09 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: tea5767.c,v 1.1 2018/07/27 12:02:26 rkujawa Exp $ */ +/* $NetBSD: tea5767.c,v 1.2 2019/12/23 20:49:09 thorpej Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tea5767.c,v 1.1 2018/07/27 12:02:26 rkujawa Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tea5767.c,v 1.2 2019/12/23 20:49:09 thorpej Exp $"); #include <sys/proc.h> #include <sys/kernel.h> @@ -151,22 +151,22 @@ tea5767_write(struct tea5767_softc *sc, { int exec_result; - if (iic_acquire_bus(sc->sc_i2c_tag, I2C_F_POLL)) { + if (iic_acquire_bus(sc->sc_i2c_tag, 0)) { device_printf(sc->sc_dev, "bus acquiration failed.\n"); return 1; } exec_result = iic_exec(sc->sc_i2c_tag, I2C_OP_WRITE_WITH_STOP, - sc->sc_addr, NULL, 0, reg, 5, I2C_F_POLL); + sc->sc_addr, NULL, 0, reg, 5, 0); if (exec_result) { - iic_release_bus(sc->sc_i2c_tag, I2C_F_POLL); + iic_release_bus(sc->sc_i2c_tag, 0); device_printf(sc->sc_dev, "write operation failed %d.\n", exec_result); return 1; } - iic_release_bus(sc->sc_i2c_tag, I2C_F_POLL); + iic_release_bus(sc->sc_i2c_tag, 0); return 0; } @@ -177,21 +177,21 @@ tea5767_read(struct tea5767_softc *sc, u { int exec_result; - if (iic_acquire_bus(sc->sc_i2c_tag, I2C_F_POLL)) { + if (iic_acquire_bus(sc->sc_i2c_tag, 0)) { device_printf(sc->sc_dev, "bus acquiration failed.\n"); return 1; } - iic_exec(sc->sc_i2c_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, - NULL, 0, reg, 5, I2C_F_POLL); + exec_result = iic_exec(sc->sc_i2c_tag, I2C_OP_READ_WITH_STOP, + sc->sc_addr, NULL, 0, reg, 5, 0); if (exec_result) { - iic_release_bus(sc->sc_i2c_tag, I2C_F_POLL); + iic_release_bus(sc->sc_i2c_tag, 0); device_printf(sc->sc_dev, "read operation failed.\n"); return 1; } - iic_release_bus(sc->sc_i2c_tag, I2C_F_POLL); + iic_release_bus(sc->sc_i2c_tag, 0); return 0; }