Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci don't attach iic@coram unless CORAM_ATTACH_I2C i...



details:   https://anonhg.NetBSD.org/src/rev/485590227326
branches:  trunk
changeset: 768006:485590227326
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Aug 06 11:37:56 2011 +0000

description:
don't attach iic@coram unless CORAM_ATTACH_I2C is defined

diffstat:

 sys/dev/pci/coram.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (57 lines):

diff -r 18a2a942081e -r 485590227326 sys/dev/pci/coram.c
--- a/sys/dev/pci/coram.c       Sat Aug 06 11:28:24 2011 +0000
+++ b/sys/dev/pci/coram.c       Sat Aug 06 11:37:56 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: coram.c,v 1.4 2011/08/05 21:20:27 jmcneill Exp $ */
+/* $NetBSD: coram.c,v 1.5 2011/08/06 11:37:56 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2008, 2011 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coram.c,v 1.4 2011/08/05 21:20:27 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coram.c,v 1.5 2011/08/06 11:37:56 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -52,6 +52,7 @@
 #include <dev/i2c/mt2131var.h>
 
 /* #define CORAM_DEBUG */
+/* #define CORAM_ATTACH_I2C */
 
 static int coram_match(device_t, cfdata_t, void *);
 static void coram_attach(device_t, device_t, void *);
@@ -160,8 +161,11 @@
        const char *intrstr;
        char devinfo[76];
        struct coram_iic_softc *cic;
+       uint32_t value;
+       int i;
+#ifdef CORAM_ATTACH_I2C
        struct i2cbus_attach_args iba;
-       uint32_t value;
+#endif
 
        sc = device_private(self);
 
@@ -207,8 +211,6 @@
        reg |= PCI_COMMAND_MASTER_ENABLE;
        pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, reg);
 
-       int i;
-
        /* I2C */
        for(i = 0; i < I2C_NUM; i++) {
                cic = &sc->sc_iic[i];
@@ -223,7 +225,7 @@
                cic->cic_i2c.ic_release_bus = coram_iic_release_bus;
                cic->cic_i2c.ic_exec = coram_iic_exec;
 
-#if 1
+#ifdef CORAM_ATTACH_I2C
                /* attach iic(4) */
                memset(&iba, 0, sizeof(iba));
                iba.iba_tag = &cic->cic_i2c;



Home | Main Index | Thread Index | Old Index