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/3c5a1d9b3316
branches:  trunk
changeset: 968149:3c5a1d9b3316
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Jan 04 02:21:15 2020 +0000

description:
No need to use I2C_F_POLL here.

diffstat:

 sys/dev/i2c/as3722.c |  20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diffs (52 lines):

diff -r a2ec1d792dbc -r 3c5a1d9b3316 sys/dev/i2c/as3722.c
--- a/sys/dev/i2c/as3722.c      Fri Jan 03 21:01:16 2020 +0000
+++ b/sys/dev/i2c/as3722.c      Sat Jan 04 02:21:15 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: as3722.c,v 1.18 2019/12/23 15:48:51 thorpej Exp $ */
+/* $NetBSD: as3722.c,v 1.19 2020/01/04 02:21:15 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_fdt.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.18 2019/12/23 15:48:51 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.19 2020/01/04 02:21:15 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -850,13 +850,11 @@
        struct as3722_softc * const sc = device_private(dev);
        int error;
 
-       const int flags = I2C_F_POLL;
-
-       error = iic_acquire_bus(sc->sc_i2c, flags);
+       error = iic_acquire_bus(sc->sc_i2c, 0);
        if (error == 0) {
                error = as3722_write(sc, AS3722_RESET_CTRL_REG,
-                   AS3722_RESET_CTRL_POWER_OFF, flags);
-               iic_release_bus(sc->sc_i2c, flags);
+                   AS3722_RESET_CTRL_POWER_OFF, 0);
+               iic_release_bus(sc->sc_i2c, 0);
        }
        if (error) {
                device_printf(dev, "WARNING: unable to power off, error %d\n",
@@ -872,13 +870,11 @@
        struct as3722_softc * const sc = device_private(dev);
        int error;
 
-       const int flags = I2C_F_POLL;
-
-       error = iic_acquire_bus(sc->sc_i2c, flags);
+       error = iic_acquire_bus(sc->sc_i2c, 0);
        if (error == 0) {
                error = as3722_write(sc, AS3722_RESET_CTRL_REG,
-                   AS3722_RESET_CTRL_FORCE_RESET, flags);
-               iic_release_bus(sc->sc_i2c, flags);
+                   AS3722_RESET_CTRL_FORCE_RESET, 0);
+               iic_release_bus(sc->sc_i2c, 0);
        }
        if (error) {
                device_printf(dev, "WARNING: unable to reboot, error %d\n",



Home | Main Index | Thread Index | Old Index