Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c Remove assertions that no longer make sense now ...



details:   https://anonhg.NetBSD.org/src/rev/7c560afbcf67
branches:  trunk
changeset: 967874:7c560afbcf67
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Dec 25 14:08:47 2019 +0000

description:
Remove assertions that no longer make sense now that the bus acquire / release
logic is handled by the upper layer.

diffstat:

 sys/dev/i2c/gttwsi_core.c |  16 ++--------------
 sys/dev/i2c/gttwsivar.h   |   3 +--
 2 files changed, 3 insertions(+), 16 deletions(-)

diffs (89 lines):

diff -r 606cec85a7a8 -r 7c560afbcf67 sys/dev/i2c/gttwsi_core.c
--- a/sys/dev/i2c/gttwsi_core.c Wed Dec 25 10:51:20 2019 +0000
+++ b/sys/dev/i2c/gttwsi_core.c Wed Dec 25 14:08:47 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gttwsi_core.c,v 1.9 2019/12/22 23:23:32 thorpej Exp $  */
+/*     $NetBSD: gttwsi_core.c,v 1.10 2019/12/25 14:08:47 thorpej Exp $ */
 /*
  * Copyright (c) 2008 Eiji Kawauchi.
  * All rights reserved.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gttwsi_core.c,v 1.9 2019/12/22 23:23:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gttwsi_core.c,v 1.10 2019/12/25 14:08:47 thorpej Exp $");
 #include "locators.h"
 
 #include <sys/param.h>
@@ -205,8 +205,6 @@
        struct gttwsi_softc *sc = v;
        int expect;
 
-       KASSERT(sc->sc_inuse);
-
        if (sc->sc_started)
                expect = STAT_RSCT;
        else
@@ -222,8 +220,6 @@
        int retry = TWSI_RETRY_COUNT;
        uint32_t control;
 
-       KASSERT(sc->sc_inuse);
-
        sc->sc_started = false;
 
        /* Interrupt is not generated for STAT_NRS. */
@@ -249,8 +245,6 @@
        uint32_t data, expect, alt;
        int error, read;
 
-       KASSERT(sc->sc_inuse);
-
        error = gttwsi_send_start(v, flags);
        if (error)
                return error;
@@ -303,8 +297,6 @@
        struct gttwsi_softc *sc = v;
        int error;
 
-       KASSERT(sc->sc_inuse);
-
        if (flags & I2C_F_LAST)
                error = gttwsi_wait(sc, 0, STAT_MRRD_ANT, 0, flags);
        else
@@ -322,8 +314,6 @@
        struct gttwsi_softc *sc = v;
        int error;
 
-       KASSERT(sc->sc_inuse);
-
        gttwsi_write_4(sc, TWSI_DATA, val);
        error = gttwsi_wait(sc, 0, STAT_MTDB_AR, 0, flags);
        if (flags & I2C_F_STOP)
@@ -338,8 +328,6 @@
        uint32_t status;
        int timo, error = 0;
 
-       KASSERT(sc->sc_inuse);
-
        DELAY(5);
        if (!(flags & I2C_F_POLL))
                control |= CONTROL_INTEN;
diff -r 606cec85a7a8 -r 7c560afbcf67 sys/dev/i2c/gttwsivar.h
--- a/sys/dev/i2c/gttwsivar.h   Wed Dec 25 10:51:20 2019 +0000
+++ b/sys/dev/i2c/gttwsivar.h   Wed Dec 25 14:08:47 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gttwsivar.h,v 1.4 2018/05/07 15:03:19 jmcneill Exp $   */
+/*     $NetBSD: gttwsivar.h,v 1.5 2019/12/25 14:08:47 thorpej Exp $    */
 /*
  * Copyright (c) 2008 Eiji Kawauchi.
  * All rights reserved.
@@ -86,7 +86,6 @@
        struct i2c_controller sc_i2c;
        kmutex_t sc_buslock;
        kmutex_t sc_mtx;
-       bool sc_inuse;
        kcondvar_t sc_cv;
 
        bool sc_iflg_rwc;



Home | Main Index | Thread Index | Old Index