Module Name:    src
Committed By:   thorpej
Date:           Wed Dec 25 14:08:47 UTC 2019

Modified Files:
        src/sys/dev/i2c: gttwsi_core.c gttwsivar.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/i2c/gttwsi_core.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/gttwsivar.h

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/gttwsi_core.c
diff -u src/sys/dev/i2c/gttwsi_core.c:1.9 src/sys/dev/i2c/gttwsi_core.c:1.10
--- src/sys/dev/i2c/gttwsi_core.c:1.9	Sun Dec 22 23:23:32 2019
+++ src/sys/dev/i2c/gttwsi_core.c	Wed Dec 25 14:08:47 2019
@@ -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 @@ gttwsi_send_start(void *v, int flags)
 	struct gttwsi_softc *sc = v;
 	int expect;
 
-	KASSERT(sc->sc_inuse);
-
 	if (sc->sc_started)
 		expect = STAT_RSCT;
 	else
@@ -222,8 +220,6 @@ gttwsi_send_stop(void *v, int flags)
 	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 @@ gttwsi_initiate_xfer(void *v, i2c_addr_t
 	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 @@ gttwsi_read_byte(void *v, uint8_t *valp,
 	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 @@ gttwsi_write_byte(void *v, uint8_t val, 
 	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 @@ gttwsi_wait(struct gttwsi_softc *sc, uin
 	uint32_t status;
 	int timo, error = 0;
 
-	KASSERT(sc->sc_inuse);
-
 	DELAY(5);
 	if (!(flags & I2C_F_POLL))
 		control |= CONTROL_INTEN;

Index: src/sys/dev/i2c/gttwsivar.h
diff -u src/sys/dev/i2c/gttwsivar.h:1.4 src/sys/dev/i2c/gttwsivar.h:1.5
--- src/sys/dev/i2c/gttwsivar.h:1.4	Mon May  7 15:03:19 2018
+++ src/sys/dev/i2c/gttwsivar.h	Wed Dec 25 14:08:47 2019
@@ -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 gttwsi_softc {
 	struct i2c_controller sc_i2c;
 	kmutex_t sc_buslock;
 	kmutex_t sc_mtx;
-	bool sc_inuse;
 	kcondvar_t sc_cv;
 
 	bool sc_iflg_rwc;

Reply via email to