Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/i2c Direct config: Only match via the list of compat...
details: https://anonhg.NetBSD.org/src/rev/a3176ab3c254
branches: trunk
changeset: 340736:a3176ab3c254
user: phx <phx%NetBSD.org@localhost>
date: Sun Sep 27 13:02:21 2015 +0000
description:
Direct config: Only match via the list of compatible hardware when we have
such a list available (ia_ncompat > 0). Otherwise fall back to matching
the device name with ia_name.
diffstat:
sys/dev/i2c/adm1021.c | 15 ++++++++++-----
sys/dev/i2c/at24cxx.c | 13 +++++++++----
sys/dev/i2c/lm75.c | 15 ++++++++++-----
sys/dev/i2c/lm87.c | 15 ++++++++++-----
4 files changed, 39 insertions(+), 19 deletions(-)
diffs (145 lines):
diff -r a2f63c687010 -r a3176ab3c254 sys/dev/i2c/adm1021.c
--- a/sys/dev/i2c/adm1021.c Sun Sep 27 07:04:05 2015 +0000
+++ b/sys/dev/i2c/adm1021.c Sun Sep 27 13:02:21 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adm1021.c,v 1.8 2012/10/27 17:18:17 chs Exp $ */
+/* $NetBSD: adm1021.c,v 1.9 2015/09/27 13:02:21 phx Exp $ */
/* $OpenBSD: adm1021.c,v 1.27 2007/06/24 05:34:35 dlg Exp $ */
/*
@@ -18,7 +18,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.8 2012/10/27 17:18:17 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.9 2015/09/27 13:02:21 phx Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -83,10 +83,15 @@
} else {
/*
* Direct config - match via the list of compatible
- * hardware.
+ * hardware or simply match the device name.
*/
- if (iic_compat_match(ia, admtemp_compats))
- return 1;
+ if (ia->ia_ncompat > 0) {
+ if (iic_compat_match(ia, admtemp_compats))
+ return 1;
+ } else {
+ if (strcmp(ia->ia_name, "admtemp") == 0)
+ return 1;
+ }
}
return 0;
diff -r a2f63c687010 -r a3176ab3c254 sys/dev/i2c/at24cxx.c
--- a/sys/dev/i2c/at24cxx.c Sun Sep 27 07:04:05 2015 +0000
+++ b/sys/dev/i2c/at24cxx.c Sun Sep 27 13:02:21 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: at24cxx.c,v 1.19 2015/05/10 22:54:06 jmcneill Exp $ */
+/* $NetBSD: at24cxx.c,v 1.20 2015/09/27 13:02:21 phx Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.19 2015/05/10 22:54:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.20 2015/09/27 13:02:21 phx Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -122,8 +122,13 @@
struct i2c_attach_args *ia = aux;
if (ia->ia_name) {
- if (iic_compat_match(ia, seeprom_compats))
- return (1);
+ if (ia->ia_ncompat > 0) {
+ if (iic_compat_match(ia, seeprom_compats))
+ return (1);
+ } else {
+ if (strcmp(ia->ia_name, "seeprom") == 0)
+ return (1);
+ }
} else {
if ((ia->ia_addr & AT24CXX_ADDRMASK) == AT24CXX_ADDR)
return (1);
diff -r a2f63c687010 -r a3176ab3c254 sys/dev/i2c/lm75.c
--- a/sys/dev/i2c/lm75.c Sun Sep 27 07:04:05 2015 +0000
+++ b/sys/dev/i2c/lm75.c Sun Sep 27 13:02:21 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lm75.c,v 1.25 2012/10/27 17:18:17 chs Exp $ */
+/* $NetBSD: lm75.c,v 1.26 2015/09/27 13:02:21 phx Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.25 2012/10/27 17:18:17 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.26 2015/09/27 13:02:21 phx Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -132,10 +132,15 @@
} else {
/*
* Direct config - match via the list of compatible
- * hardware.
+ * hardware or simply match the device name.
*/
- if (iic_compat_match(ia, lmtemp_compats))
- return 1;
+ if (ia->ia_ncompat > 0) {
+ if (iic_compat_match(ia, lmtemp_compats))
+ return 1;
+ } else {
+ if (strcmp(ia->ia_name, "lmtemp") == 0)
+ return 1;
+ }
}
diff -r a2f63c687010 -r a3176ab3c254 sys/dev/i2c/lm87.c
--- a/sys/dev/i2c/lm87.c Sun Sep 27 07:04:05 2015 +0000
+++ b/sys/dev/i2c/lm87.c Sun Sep 27 13:02:21 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lm87.c,v 1.4 2013/11/04 15:06:26 jdc Exp $ */
+/* $NetBSD: lm87.c,v 1.5 2015/09/27 13:02:21 phx Exp $ */
/* $OpenBSD: lm87.c,v 1.20 2008/11/10 05:19:48 cnst Exp $ */
/*
@@ -18,7 +18,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lm87.c,v 1.4 2013/11/04 15:06:26 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lm87.c,v 1.5 2015/09/27 13:02:21 phx Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -132,10 +132,15 @@
} else {
/*
* Direct config - match via the list of compatible
- * hardware.
+ * hardware or simply match the device name.
*/
- if (iic_compat_match(ia, lmenv_compats))
- return 1;
+ if (ia->ia_ncompat > 0) {
+ if (iic_compat_match(ia, lmenv_compats))
+ return 1;
+ } else {
+ if (strcmp(ia->ia_name, "lmenv") == 0)
+ return 1;
+ }
}
return 0;
Home |
Main Index |
Thread Index |
Old Index