Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic fix attach message if wdt isn't attach.



details:   https://anonhg.NetBSD.org/src/rev/98c33b5cd87f
branches:  trunk
changeset: 777711:98c33b5cd87f
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Fri Mar 02 12:56:51 2012 +0000

description:
fix attach message if wdt isn't attach.

diffstat:

 sys/dev/ic/gcscpcib.c |  16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r 3fd12cb9fc34 -r 98c33b5cd87f sys/dev/ic/gcscpcib.c
--- a/sys/dev/ic/gcscpcib.c     Fri Mar 02 12:08:44 2012 +0000
+++ b/sys/dev/ic/gcscpcib.c     Fri Mar 02 12:56:51 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gcscpcib.c,v 1.2 2011/08/29 18:34:42 bouyer Exp $ */
+/* $NetBSD: gcscpcib.c,v 1.3 2012/03/02 12:56:51 nonaka Exp $ */
 /* $OpenBSD: gcscpcib.c,v 1.6 2007/11/17 17:02:47 mbalmer Exp $        */
 
 /*
@@ -24,7 +24,7 @@
  * AMD CS5535/CS5536 series LPC bridge also containing timer, watchdog and GPIO.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gcscpcib.c,v 1.2 2011/08/29 18:34:42 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gcscpcib.c,v 1.3 2012/03/02 12:56:51 nonaka Exp $");
 
 #include "gpio.h"
 
@@ -88,11 +88,11 @@
 {
        struct timecounter *tc = &sc->sc_timecounter;
        bus_addr_t wdtbase;
-       int wdt = 0;
+       int wdt = 0, gpio = 0;
 #if NGPIO > 0
        struct gpiobus_attach_args gba;
        bus_addr_t gpiobase;
-       int i, gpio;
+       int i;
 #endif
 
        sc->sc_iot = iot;
@@ -153,7 +153,10 @@
        gpiobase = gcsc_rdmsr(MSR_LBAR_GPIO) & 0xffff;
        if (!bus_space_map(sc->sc_gpio_iot, gpiobase, 0xff, 0,
            &sc->sc_gpio_ioh)) {
-               aprint_normal(", GPIO");
+               if (wdt)
+                       aprint_normal(", GPIO");
+               else
+                       aprint_normal_dev(self, "GPIO");
 
                /* initialize pin array */
                for (i = 0; i < AMD553X_GPIO_NPINS; i++) {
@@ -181,7 +184,8 @@
                gpio = 1;
        }
 #endif
-       aprint_normal("\n");
+       if (wdt || gpio)
+               aprint_normal("\n");
 
 #if NGPIO > 0
        /* Attach GPIO framework */



Home | Main Index | Thread Index | Old Index