Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c The probe this driver uses is poten...



details:   https://anonhg.NetBSD.org/src/rev/26a38001eaea
branches:  trunk
changeset: 318890:26a38001eaea
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed May 09 02:46:22 2018 +0000
description:
The probe this driver uses is potentially destructive; at the very
least, filter on the I2C address the device is expected at before we
unleash its fury.

diffstat:

 sys/dev/i2c/ibmhawk.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 84794cf7f04d -r 26a38001eaea sys/dev/i2c/ibmhawk.c
--- a/sys/dev/i2c/ibmhawk.c     Wed May 09 01:04:01 2018 +0000
+++ b/sys/dev/i2c/ibmhawk.c     Wed May 09 02:46:22 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ibmhawk.c,v 1.4 2016/07/14 04:01:32 msaitoh Exp $ */
+/* $NetBSD: ibmhawk.c,v 1.5 2018/05/09 02:46:22 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -99,6 +99,12 @@
        ibmhawk_response_t resp;
        static struct ibmhawk_softc sc;
 
+       /* There is an expected address for this device: */
+       if (ia->ia_addr != 0x37)
+               return 0;
+
+       /* XXX Probe is potentially destructive. */
+
        sc.sc_tag = ia->ia_tag;
        sc.sc_addr = ia->ia_addr;
        if (ibmhawk_request(&sc, IHR_EQUIP, &resp))



Home | Main Index | Thread Index | Old Index