Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/i2c No need to use I2C_F_POLL here. Also fix an uni...



details:   https://anonhg.NetBSD.org/src/rev/173775b67e5d
branches:  trunk
changeset: 967848:173775b67e5d
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Dec 23 20:49:09 2019 +0000

description:
No need to use I2C_F_POLL here.  Also fix an uninitialized error variable
in tea5767_read().

diffstat:

 sys/dev/i2c/tea5767.c |  22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diffs (72 lines):

diff -r 3ee20f30a083 -r 173775b67e5d sys/dev/i2c/tea5767.c
--- a/sys/dev/i2c/tea5767.c     Mon Dec 23 20:38:08 2019 +0000
+++ b/sys/dev/i2c/tea5767.c     Mon Dec 23 20:49:09 2019 +0000
@@ -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 @@
 {
        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 @@
 {
        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;
 }
 



Home | Main Index | Thread Index | Old Index