Module Name: src Committed By: thorpej Date: Wed May 9 02:46:22 UTC 2018
Modified Files: src/sys/dev/i2c: ibmhawk.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/ibmhawk.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/ibmhawk.c diff -u src/sys/dev/i2c/ibmhawk.c:1.4 src/sys/dev/i2c/ibmhawk.c:1.5 --- src/sys/dev/i2c/ibmhawk.c:1.4 Thu Jul 14 04:01:32 2016 +++ src/sys/dev/i2c/ibmhawk.c Wed May 9 02:46:22 2018 @@ -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_match(device_t parent, cfdata_t 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))