Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c titemp_match: filter on ia_addr for indirect con...



details:   https://anonhg.NetBSD.org/src/rev/2d09444f953c
branches:  trunk
changeset: 832122:2d09444f953c
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Apr 30 20:37:01 2018 +0000

description:
titemp_match: filter on ia_addr for indirect config (device is expected at 0x4c)

diffstat:

 sys/dev/i2c/titemp.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 7a77e0a55462 -r 2d09444f953c sys/dev/i2c/titemp.c
--- a/sys/dev/i2c/titemp.c      Mon Apr 30 20:33:09 2018 +0000
+++ b/sys/dev/i2c/titemp.c      Mon Apr 30 20:37:01 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: titemp.c,v 1.3 2016/08/16 23:47:45 jakllsch Exp $ */
+/* $NetBSD: titemp.c,v 1.4 2018/04/30 20:37:01 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: titemp.c,v 1.3 2016/08/16 23:47:45 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: titemp.c,v 1.4 2018/04/30 20:37:01 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -97,6 +97,9 @@
        int error;
 
        if (ia->ia_name == NULL) {
+               if (ia->ia_addr != 0x4c)
+                       return 0;
+
                if (iic_acquire_bus(ia->ia_tag, I2C_F_POLL) != 0)
                        return 0;
                error = iic_smbus_read_byte(ia->ia_tag, ia->ia_addr,



Home | Main Index | Thread Index | Old Index