summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/macppc/dev/maci2c.c4
-rw-r--r--sys/arch/sparc64/dev/ofwi2c.c4
-rw-r--r--sys/dev/i2c/i2c.c3
-rw-r--r--sys/dev/i2c/i2c_scan.c3
-rw-r--r--sys/dev/i2c/i2cvar.h3
5 files changed, 10 insertions, 7 deletions
diff --git a/sys/arch/macppc/dev/maci2c.c b/sys/arch/macppc/dev/maci2c.c
index 39af02e2cd6..4454fdb20bd 100644
--- a/sys/arch/macppc/dev/maci2c.c
+++ b/sys/arch/macppc/dev/maci2c.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: maci2c.c,v 1.7 2006/01/09 01:48:17 deraadt Exp $ */
+/* $OpenBSD: maci2c.c,v 1.8 2006/02/08 23:15:58 dlg Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -39,9 +39,9 @@ maciic_scan(struct device *self, struct i2cbus_attach_args *iba, void *aux)
if (OF_getprop(node, "reg", &reg, sizeof reg) != sizeof reg &&
OF_getprop(node, "i2c-address", &reg, sizeof reg) != sizeof reg)
continue;
+ memset(&ia, 0, sizeof ia);
ia.ia_tag = iba->iba_tag;
ia.ia_addr = (reg >> 1);
- ia.ia_name = NULL;
memset(name, 0, sizeof name);
if (OF_getprop(node, "compatible", &name,
sizeof name) && name[0])
diff --git a/sys/arch/sparc64/dev/ofwi2c.c b/sys/arch/sparc64/dev/ofwi2c.c
index 1a7107992ef..ee2d01c0c55 100644
--- a/sys/arch/sparc64/dev/ofwi2c.c
+++ b/sys/arch/sparc64/dev/ofwi2c.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ofwi2c.c,v 1.1 2006/01/02 01:58:55 deraadt Exp $ */
+/* $OpenBSD: ofwi2c.c,v 1.2 2006/02/08 23:15:58 dlg Exp $ */
/*
* Copyright (c) 2006 Theo de Raadt
@@ -49,8 +49,8 @@ ofwiic_scan(struct device *self, struct i2cbus_attach_args *iba, void *aux)
if (strcmp(name, "i2c-smbus") == 0) {
for (node = OF_child(node); node; node = OF_peer(node)) {
+ memset(&ia, 0, sizeof ia);
ia.ia_tag = iba->iba_tag;
- ia.ia_name = NULL;
memset(name, 0, sizeof name);
if (OF_getprop(node, "compatible", &name,
sizeof name) && name[0]) {
diff --git a/sys/dev/i2c/i2c.c b/sys/dev/i2c/i2c.c
index 90efd50f0f6..15491a9ab74 100644
--- a/sys/dev/i2c/i2c.c
+++ b/sys/dev/i2c/i2c.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2c.c,v 1.12 2006/01/29 17:29:30 marco Exp $ */
+/* $OpenBSD: i2c.c,v 1.13 2006/02/08 23:15:58 dlg Exp $ */
/* $NetBSD: i2c.c,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */
/*
@@ -100,6 +100,7 @@ iic_search(struct device *parent, void *arg, void *aux)
struct i2c_attach_args ia;
if (cf->cf_loc[IICCF_ADDR] != -1) {
+ memset(&ia, 0, sizeof(ia));
ia.ia_tag = sc->sc_tag;
ia.ia_addr = cf->cf_loc[IICCF_ADDR];
ia.ia_size = cf->cf_loc[IICCF_SIZE];
diff --git a/sys/dev/i2c/i2c_scan.c b/sys/dev/i2c/i2c_scan.c
index cc0414effaf..0b8af0b91fb 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.67 2006/02/08 19:02:37 kettenis Exp $ */
+/* $OpenBSD: i2c_scan.c,v 1.68 2006/02/08 23:15:58 dlg Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt <deraadt@openbsd.org>
@@ -640,6 +640,7 @@ iic_probe(struct device *self, struct i2cbus_attach_args *iba, u_int8_t addr)
#endif /* I2C_DEBUG */
if (name) {
+ memset(&ia, 0, sizeof(ia));
ia.ia_tag = iba->iba_tag;
ia.ia_addr = addr;
ia.ia_size = 1;
diff --git a/sys/dev/i2c/i2cvar.h b/sys/dev/i2c/i2cvar.h
index 0d463f1d945..fc43ac9f5be 100644
--- a/sys/dev/i2c/i2cvar.h
+++ b/sys/dev/i2c/i2cvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2cvar.h,v 1.9 2006/01/01 20:52:25 deraadt Exp $ */
+/* $OpenBSD: i2cvar.h,v 1.10 2006/02/08 23:15:58 dlg Exp $ */
/* $NetBSD: i2cvar.h,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */
/*
@@ -105,6 +105,7 @@ struct i2c_attach_args {
i2c_addr_t ia_addr; /* address of device */
int ia_size; /* size (for EEPROMs) */
char *ia_name; /* chip name */
+ void *ia_cookie; /* pass extra info from bus to dev */
};
/*