summaryrefslogtreecommitdiffstats
path: root/sys/dev/i2c
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2006-02-25 21:38:56 +0000
committerkettenis <kettenis@openbsd.org>2006-02-25 21:38:56 +0000
commitc450b2327c9d6acc7e6ac75fb84c003ed55f9f73 (patch)
treeb35395d20e65ff14a7d23fe648b65a92cc3232d4 /sys/dev/i2c
parent#undef I2C_VERBOSE; re-enable after release. (diff)
downloadwireguard-openbsd-c450b2327c9d6acc7e6ac75fb84c003ed55f9f73.tar.xz
wireguard-openbsd-c450b2327c9d6acc7e6ac75fb84c003ed55f9f73.zip
Make sure we print something for unidentified devices.
ok deraadt@
Diffstat (limited to 'sys/dev/i2c')
-rw-r--r--sys/dev/i2c/i2c_scan.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/i2c/i2c_scan.c b/sys/dev/i2c/i2c_scan.c
index b968850e3df..39547169f16 100644
--- a/sys/dev/i2c/i2c_scan.c
+++ b/sys/dev/i2c/i2c_scan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2c_scan.c,v 1.69 2006/02/25 17:58:01 kettenis Exp $ */
+/* $OpenBSD: i2c_scan.c,v 1.70 2006/02/25 21:38:56 kettenis Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt <deraadt@openbsd.org>
@@ -639,6 +639,11 @@ iic_probe(struct device *self, struct i2cbus_attach_args *iba, u_int8_t addr)
iic_dump(self, addr, name);
#endif /* I2C_DEBUG */
+#if !defined(I2C_VERBOSE) && !defined(I2C_DEBUG)
+ if (name == NULL)
+ name = "unknown";
+#endif
+
if (name) {
memset(&ia, 0, sizeof(ia));
ia.ia_tag = iba->iba_tag;