Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/i2c Don't try to match a device if there's already a...
details: https://anonhg.NetBSD.org/src/rev/ba9c2d4e9f9a
branches: trunk
changeset: 778045:ba9c2d4e9f9a
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Wed Mar 14 02:57:10 2012 +0000
description:
Don't try to match a device if there's already a device attached at
the specified address.
diffstat:
sys/dev/i2c/i2c.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (33 lines):
diff -r 2ac72aa4409d -r ba9c2d4e9f9a sys/dev/i2c/i2c.c
--- a/sys/dev/i2c/i2c.c Wed Mar 14 00:25:19 2012 +0000
+++ b/sys/dev/i2c/i2c.c Wed Mar 14 02:57:10 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i2c.c,v 1.37 2011/10/11 15:19:09 macallan Exp $ */
+/* $NetBSD: i2c.c,v 1.38 2012/03/14 02:57:10 pgoyette Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.37 2011/10/11 15:19:09 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.38 2012/03/14 02:57:10 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -118,10 +118,10 @@
ia.ia_ncompat = 0;
ia.ia_compat = NULL;
- if (config_match(parent, cf, &ia) > 0) {
- if (ia.ia_addr != (i2c_addr_t)-1 &&
- ia.ia_addr <= I2C_MAX_ADDR &&
- !sc->sc_devices[ia.ia_addr])
+ if (ia.ia_addr != (i2c_addr_t)-1 &&
+ ia.ia_addr <= I2C_MAX_ADDR &&
+ !sc->sc_devices[ia.ia_addr])
+ if (config_match(parent, cf, &ia) > 0) {
sc->sc_devices[ia.ia_addr] =
config_attach(parent, cf, &ia, iic_print);
}
Home |
Main Index |
Thread Index |
Old Index