Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c Bail early if gttwsi_send_start() fails in gttws...



details:   https://anonhg.NetBSD.org/src/rev/c431ff27a19e
branches:  trunk
changeset: 323516:c431ff27a19e
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Mon Jun 18 12:42:29 2018 +0000

description:
Bail early if gttwsi_send_start() fails in gttwsi_initiate_xfer() to
avoid unexpected state error message later (on Allwinner H5).

diffstat:

 sys/dev/i2c/gttwsi_core.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 720d0de80793 -r c431ff27a19e sys/dev/i2c/gttwsi_core.c
--- a/sys/dev/i2c/gttwsi_core.c Mon Jun 18 09:53:45 2018 +0000
+++ b/sys/dev/i2c/gttwsi_core.c Mon Jun 18 12:42:29 2018 +0000
@@ -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 @@
 
        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) {



Home | Main Index | Thread Index | Old Index