Module Name: src
Committed By: jakllsch
Date: Mon Jun 18 12:42:29 UTC 2018
Modified Files:
src/sys/dev/i2c: gttwsi_core.c
Log Message:
Bail early if gttwsi_send_start() fails in gttwsi_initiate_xfer() to
avoid unexpected state error message later (on Allwinner H5).
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/gttwsi_core.c
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.6 src/sys/dev/i2c/gttwsi_core.c:1.7
--- src/sys/dev/i2c/gttwsi_core.c:1.6 Tue Jun 12 13:18:48 2018
+++ src/sys/dev/i2c/gttwsi_core.c Mon Jun 18 12:42:29 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gttwsi_core.c,v 1.6 2018/06/12 13:18:48 thorpej Exp $ */
+/* $NetBSD: gttwsi_core.c,v 1.7 2018/06/18 12:42:29 jakllsch 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.6 2018/06/12 13:18:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gttwsi_core.c,v 1.7 2018/06/18 12:42:29 jakllsch Exp $");
#include "locators.h"
#include <sys/param.h>
@@ -283,7 +283,9 @@ gttwsi_initiate_xfer(void *v, i2c_addr_t
KASSERT(sc->sc_inuse);
- gttwsi_send_start(v, flags);
+ error = gttwsi_send_start(v, flags);
+ if (error)
+ return error;
read = (flags & I2C_F_READ) != 0;
if (read) {