Remove assertions that no longer make sense now that the bus acquire / release

logic is handled by the upper layer.
This commit is contained in:
thorpej 2019-12-25 14:08:47 +00:00
parent 3408cd769d
commit 9c6d8a8de4
2 changed files with 3 additions and 16 deletions

View File

@ -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 addr, int flags)
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, int flags)
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, int flags)
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, uint32_t control, uint32_t expect,
uint32_t status;
int timo, error = 0;
KASSERT(sc->sc_inuse);
DELAY(5);
if (!(flags & I2C_F_POLL))
control |= CONTROL_INTEN;

View File

@ -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;