Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c In iic_acquire_bus(), unlock the bus lock if the...



details:   https://anonhg.NetBSD.org/src/rev/7d3710e511d3
branches:  trunk
changeset: 930987:7d3710e511d3
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Apr 19 17:08:14 2020 +0000

description:
In iic_acquire_bus(), unlock the bus lock if the back-end returns an
error from its acquire-bus function.

diffstat:

 sys/dev/i2c/i2c_exec.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 6ac26e77d6c5 -r 7d3710e511d3 sys/dev/i2c/i2c_exec.c
--- a/sys/dev/i2c/i2c_exec.c    Sun Apr 19 16:45:08 2020 +0000
+++ b/sys/dev/i2c/i2c_exec.c    Sun Apr 19 17:08:14 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i2c_exec.c,v 1.15 2020/01/02 16:18:37 thorpej Exp $    */
+/*     $NetBSD: i2c_exec.c,v 1.16 2020/04/19 17:08:14 thorpej Exp $    */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c_exec.c,v 1.15 2020/01/02 16:18:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c_exec.c,v 1.16 2020/04/19 17:08:14 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -141,6 +141,10 @@
                error = (*tag->ic_acquire_bus)(tag->ic_cookie, flags);
        }
 
+       if (__predict_false(error)) {
+               mutex_exit(&tag->ic_bus_lock);
+       }
+
        return error;
 }
 



Home | Main Index | Thread Index | Old Index