summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-12-23 01:26:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-12-23 01:26:23 +0000
commit5b47c5aa67d75726b0b2428d780dd3f8340dbcc8 (patch)
treecd3d4449d807c253c4d244d418066cbd6c4fed3d
parentd0ebc67babc8cabc21586312dd2c32814f1f7eb7 (diff)
upon startup, only scan-and-attach devices which specify an address
attribute; if that is not set, then we hope something later will guess the address. this must be revisited later on, to avoid double-attachment
-rw-r--r--sys/dev/i2c/i2c.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/dev/i2c/i2c.c b/sys/dev/i2c/i2c.c
index f2c39042448..151013ffaf7 100644
--- a/sys/dev/i2c/i2c.c
+++ b/sys/dev/i2c/i2c.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2c.c,v 1.5 2005/12/22 23:53:58 deraadt Exp $ */
+/* $OpenBSD: i2c.c,v 1.6 2005/12/23 01:26:22 deraadt Exp $ */
/* $NetBSD: i2c.c,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */
/*
@@ -95,15 +95,16 @@ iic_search(struct device *parent, void *arg, void *aux)
struct cfdata *cf = arg;
struct i2c_attach_args ia;
- ia.ia_tag = sc->sc_tag;
- ia.ia_addr = cf->cf_loc[IICCF_ADDR];
- ia.ia_size = cf->cf_loc[IICCF_SIZE];
- ia.ia_name = NULL;
- ia.ia_compat = NULL;
-
- if (cf->cf_attach->ca_match(parent, cf, &ia) > 0)
- config_attach(parent, cf, &ia, iic_print);
+ if (cf->cf_loc[IICCF_ADDR] != -1) {
+ ia.ia_tag = sc->sc_tag;
+ ia.ia_addr = cf->cf_loc[IICCF_ADDR];
+ ia.ia_size = cf->cf_loc[IICCF_SIZE];
+ ia.ia_name = NULL;
+ ia.ia_compat = NULL;
+ if (cf->cf_attach->ca_match(parent, cf, &ia) > 0)
+ config_attach(parent, cf, &ia, iic_print);
+ }
return (0);
}