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.



details:   https://anonhg.NetBSD.org/src/rev/0422f9c0b7f7
branches:  trunk
changeset: 968097:0422f9c0b7f7
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Jan 02 16:53:05 2020 +0000

description:
No need to use I2C_F_POLL here.

diffstat:

 sys/dev/i2c/pcf8583.c |  36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diffs (131 lines):

diff -r 259c7a95d6ff -r 0422f9c0b7f7 sys/dev/i2c/pcf8583.c
--- a/sys/dev/i2c/pcf8583.c     Thu Jan 02 16:52:55 2020 +0000
+++ b/sys/dev/i2c/pcf8583.c     Thu Jan 02 16:53:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcf8583.c,v 1.18 2018/06/16 21:22:13 thorpej Exp $     */
+/*     $NetBSD: pcf8583.c,v 1.19 2020/01/02 16:53:05 thorpej Exp $     */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcf8583.c,v 1.18 2018/06/16 21:22:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcf8583.c,v 1.19 2020/01/02 16:53:05 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -327,7 +327,7 @@
        u_int8_t bcd[10], cmdbuf[1];
        int i, err;
 
-       if ((err = iic_acquire_bus(sc->sc_tag, I2C_F_POLL))) {
+       if ((err = iic_acquire_bus(sc->sc_tag, 0))) {
                aprint_error_dev(sc->sc_dev,
                    "pcfrtc_clock_read: failed to acquire I2C bus\n");
                return err;
@@ -339,8 +339,8 @@
 
                if ((err = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP,
                             sc->sc_address, cmdbuf, 1,
-                            &bcd[i], 1, I2C_F_POLL))) {
-                       iic_release_bus(sc->sc_tag, I2C_F_POLL);
+                            &bcd[i], 1, 0))) {
+                       iic_release_bus(sc->sc_tag, 0);
                        aprint_error_dev(sc->sc_dev,
                            "pcfrtc_clock_read: failed to read rtc "
                            "at 0x%x\n",
@@ -350,7 +350,7 @@
        }
 
        /* Done with I2C */
-       iic_release_bus(sc->sc_tag, I2C_F_POLL);
+       iic_release_bus(sc->sc_tag, 0);
 
        /*
         * Convert the PCF8583's register values into something useable
@@ -405,7 +405,7 @@
        bcd[8]                    = dt->dt_year % 100;
        bcd[9]                    = dt->dt_year / 100;
 
-       if ((err = iic_acquire_bus(sc->sc_tag, I2C_F_POLL))) {
+       if ((err = iic_acquire_bus(sc->sc_tag, 0))) {
                aprint_error_dev(sc->sc_dev,
                    "pcfrtc_clock_write: failed to acquire I2C bus\n");
                return err;
@@ -416,8 +416,8 @@
                if ((err = iic_exec(sc->sc_tag,
                             i != 9 ? I2C_OP_WRITE : I2C_OP_WRITE_WITH_STOP,
                             sc->sc_address, cmdbuf, 1,
-                            &bcd[i], 1, I2C_F_POLL))) {
-                       iic_release_bus(sc->sc_tag, I2C_F_POLL);
+                            &bcd[i], 1, 0))) {
+                       iic_release_bus(sc->sc_tag, 0);
                        aprint_error_dev(sc->sc_dev,
                            "pcfrtc_clock_write: failed to write rtc "
                            " at 0x%x\n",
@@ -426,7 +426,7 @@
                }
        }
 
-       iic_release_bus(sc->sc_tag, I2C_F_POLL);
+       iic_release_bus(sc->sc_tag, 0);
 
        return 0;
 }
@@ -445,15 +445,15 @@
        if (len == 0)
                return (0);
 
-       if (iic_acquire_bus(tag, I2C_F_POLL) != 0)
+       if (iic_acquire_bus(tag, 0) != 0)
                return (-1);
 
        while (len) {
                /* Read a single byte. */
                cmdbuf[0] = offset;
                if (iic_exec(tag, I2C_OP_READ_WITH_STOP, i2caddr,
-                            cmdbuf, 1, rvp, 1, I2C_F_POLL)) {
-                       iic_release_bus(tag, I2C_F_POLL);
+                            cmdbuf, 1, rvp, 1, 0)) {
+                       iic_release_bus(tag, 0);
                        return (-1);
                }
 
@@ -462,7 +462,7 @@
                offset++;
        }
 
-       iic_release_bus(tag, I2C_F_POLL);
+       iic_release_bus(tag, 0);
        return (0);
 }
 
@@ -480,15 +480,15 @@
        if (len == 0)
                return (0);
 
-       if (iic_acquire_bus(tag, I2C_F_POLL) != 0)
+       if (iic_acquire_bus(tag, 0) != 0)
                return (-1);
 
        while (len) {
                /* Write a single byte. */
                cmdbuf[0] = offset;
                if (iic_exec(tag, I2C_OP_WRITE_WITH_STOP, i2caddr,
-                            cmdbuf, 1, rvp, 1, I2C_F_POLL)) {
-                       iic_release_bus(tag, I2C_F_POLL);
+                            cmdbuf, 1, rvp, 1, 0)) {
+                       iic_release_bus(tag, 0);
                        return (-1);
                }
 
@@ -497,6 +497,6 @@
                offset++;
        }
 
-       iic_release_bus(tag, I2C_F_POLL);
+       iic_release_bus(tag, 0);
        return (0);
 }



Home | Main Index | Thread Index | Old Index