From 3b8ef19613b202a26ab7380d0a767675a3298de7 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 26 Feb 2006 20:24:47 +0000 Subject: if ipmi is on the machine: instead of (confusingly) failing in match, bail out in attach, and also say why; ok marco --- sys/dev/i2c/i2c.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/i2c/i2c.c b/sys/dev/i2c/i2c.c index 15491a9ab74..be0a8dc710f 100644 --- a/sys/dev/i2c/i2c.c +++ b/sys/dev/i2c/i2c.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i2c.c,v 1.13 2006/02/08 23:15:58 dlg Exp $ */ +/* $OpenBSD: i2c.c,v 1.14 2006/02/26 20:24:46 deraadt Exp $ */ /* $NetBSD: i2c.c,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */ /* @@ -118,13 +118,6 @@ iic_match(struct device *parent, void *arg, void *aux) struct cfdata *cf = arg; struct i2cbus_attach_args *iba = aux; -#if NIPMI > 0 - extern int ipmi_enabled; - - if (ipmi_enabled) - return (0); -#endif - /* Just make sure we're looking for i2c. */ return (strcmp(iba->iba_name, cf->cf_driver->cd_name) == 0); } @@ -137,6 +130,15 @@ iic_attach(struct device *parent, struct device *self, void *aux) sc->sc_tag = iba->iba_tag; +#if NIPMI > 0 + extern int ipmi_enabled; + + if (ipmi_enabled) { + printf(": disabled to avoid ipmi0 interactions\n"); + return; + } +#endif + printf("\n"); /* -- cgit v1.2.3