Module Name:    src
Committed By:   thorpej
Date:           Sat Jul 23 03:05:27 UTC 2022

Modified Files:
        src/sys/dev/i2c: i2c.c

Log Message:
If there is a compat string list, parenthetically print the first one
in iic_print_direct().  (From thorpej-i2c-spi-conf2 branch.)


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/i2c/i2c.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/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.87 src/sys/dev/i2c/i2c.c:1.88
--- src/sys/dev/i2c/i2c.c:1.87	Wed Jun 29 15:33:45 2022
+++ src/sys/dev/i2c/i2c.c	Sat Jul 23 03:05:27 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c.c,v 1.87 2022/06/29 15:33:45 mlelstv Exp $	*/
+/*	$NetBSD: i2c.c,v 1.88 2022/07/23 03:05:27 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -53,7 +53,7 @@
 #endif /* _KERNEL_OPT */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.87 2022/06/29 15:33:45 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.88 2022/07/23 03:05:27 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -129,8 +129,11 @@ iic_print_direct(void *aux, const char *
 	struct i2c_attach_args *ia = aux;
 
 	if (pnp != NULL)
-		aprint_normal("%s at %s addr 0x%02x",
+		aprint_normal("%s%s%s%s at %s addr 0x%02x",
 			      ia->ia_name ? ia->ia_name : "(unknown)",
+			      ia->ia_ncompat ? " (" : "",
+			      ia->ia_ncompat ? ia->ia_compat[0] : "",
+			      ia->ia_ncompat ? ")" : "",
 			      pnp, ia->ia_addr);
 	else
 		aprint_normal(" addr 0x%02x", ia->ia_addr);

Reply via email to