Source-Changes-HG archive

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

[src/trunk]: src/sys/dev aprint-ify



details:   https://anonhg.NetBSD.org/src/rev/8cb7f18a9d46
branches:  trunk
changeset: 747088:8cb7f18a9d46
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Sep 01 21:46:52 2009 +0000

description:
aprint-ify

diffstat:

 sys/dev/ic/opl.c         |  11 ++++++-----
 sys/dev/ic/tulip.c       |  41 +++++++++++++++++++++--------------------
 sys/dev/isa/sbdsp.c      |   7 ++++---
 sys/dev/pci/if_tlp_pci.c |  20 ++++++++++----------
 4 files changed, 41 insertions(+), 38 deletions(-)

diffs (292 lines):

diff -r 61fe334125b0 -r 8cb7f18a9d46 sys/dev/ic/opl.c
--- a/sys/dev/ic/opl.c  Tue Sep 01 21:46:07 2009 +0000
+++ b/sys/dev/ic/opl.c  Tue Sep 01 21:46:52 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: opl.c,v 1.36 2009/03/14 21:04:20 dsl Exp $     */
+/*     $NetBSD: opl.c,v 1.37 2009/09/01 21:48:02 jmcneill Exp $        */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: opl.c,v 1.36 2009/03/14 21:04:20 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: opl.c,v 1.37 2009/09/01 21:48:02 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -160,7 +160,7 @@
 
        opl_reset(sc);
 
-       printf(": model OPL%d", sc->model);
+       aprint_normal(": model OPL%d", sc->model);
 
        /* Set up panpot */
        sc->panl = OPL_VOICE_TO_LEFT;
@@ -169,10 +169,11 @@
            device_cfdata(sc->mididev.dev)->cf_flags & OPL_FLAGS_SWAP_LR) {
                sc->panl = OPL_VOICE_TO_RIGHT;
                sc->panr = OPL_VOICE_TO_LEFT;
-               printf(": LR swapped");
+               aprint_normal(": LR swapped");
        }
 
-       printf("\n");
+       aprint_normal("\n");
+       aprint_naive("\n");
 
        sc->sc_mididev =
            midi_attach_mi(&midisyn_hw_if, &sc->syn, sc->mididev.dev);
diff -r 61fe334125b0 -r 8cb7f18a9d46 sys/dev/ic/tulip.c
--- a/sys/dev/ic/tulip.c        Tue Sep 01 21:46:07 2009 +0000
+++ b/sys/dev/ic/tulip.c        Tue Sep 01 21:46:52 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tulip.c,v 1.170 2009/08/27 20:24:16 dyoung Exp $       */
+/*     $NetBSD: tulip.c,v 1.171 2009/09/01 21:46:52 jmcneill Exp $     */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.170 2009/08/27 20:24:16 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.171 2009/09/01 21:46:52 jmcneill Exp $");
 
 #include "bpfilter.h"
 
@@ -490,7 +490,7 @@
        tlp_reset(sc);
 
        /* Announce ourselves. */
-       printf("%s: %s%sEthernet address %s\n", device_xname(self),
+       aprint_normal_dev(self, "%s%sEthernet address %s\n",
            sc->sc_name[0] != '\0' ? sc->sc_name : "",
            sc->sc_name[0] != '\0' ? ", " : "",
            ether_sprintf(enaddr));
@@ -752,8 +752,8 @@
                        if (m0->m_pkthdr.len > MHLEN) {
                                MCLGET(m, M_DONTWAIT);
                                if ((m->m_flags & M_EXT) == 0) {
-                                       printf("%s: unable to allocate Tx "
-                                           "cluster\n", device_xname(sc->sc_dev));
+                                       aprint_error_dev(sc->sc_dev,
+                                           "unable to allocate Tx cluster\n");
                                        m_freem(m);
                                        break;
                                }
@@ -763,8 +763,9 @@
                        error = bus_dmamap_load_mbuf(sc->sc_dmat, dmamap,
                            m, BUS_DMA_WRITE|BUS_DMA_NOWAIT);
                        if (error) {
-                               printf("%s: unable to load Tx buffer, "
-                                   "error = %d\n", device_xname(sc->sc_dev), error);
+                               aprint_error_dev(sc->sc_dev,
+                                   "unable to load Tx buffer, error = %d",
+                                   error);
                                break;
                        }
                }
@@ -4030,9 +4031,9 @@
        struct tulip_21x4x_media *tm;
        const char *sep = "";
 
-#define        PRINT(str)      printf("%s%s", sep, str); sep = ", "
-
-       printf("%s: ", device_xname(sc->sc_dev));
+#define        PRINT(str)      aprint_normal("%s%s", sep, str); sep = ", "
+
+       aprint_normal_dev(sc->sc_dev, "");
        TAILQ_FOREACH(ife, &sc->sc_mii.mii_media.ifm_list, ifm_list) {
                tm = ife->ifm_aux;
                if (tm == NULL) {
@@ -4046,7 +4047,7 @@
                        PRINT(tm->tm_name);
                }
        }
-       printf("\n");
+       aprint_normal("\n");
 
 #undef PRINT
 }
@@ -4534,8 +4535,8 @@
                        break;
 
                default:
-                       printf("%s: unknown media code 0x%02x\n",
-                           device_xname(sc->sc_dev),
+                       aprint_error_dev(sc->sc_dev,
+                           "unknown media code 0x%02x\n",
                            mb & TULIP_ROM_MB_MEDIA_CODE);
                        free(tm, M_DEVBUF);
                }
@@ -5066,12 +5067,12 @@
                        break;
 
                case TULIP_ROM_MB_21143_RESET:
-                       printf("%s: 21143 reset block\n", device_xname(sc->sc_dev));
+                       aprint_normal_dev(sc->sc_dev, "21143 reset block\n");
                        break;
 
                default:
-                       printf("%s: unknown ISV media block type 0x%02x\n",
-                           device_xname(sc->sc_dev), type);
+                       aprint_error_dev(sc->sc_dev,
+                           "unknown ISV media block type 0x%02x\n", type);
                }
        }
 
@@ -5079,7 +5080,7 @@
         * Deal with the case where no media is configured.
         */
        if (TAILQ_FIRST(&sc->sc_mii.mii_media.ifm_list) == NULL) {
-               printf("%s: no media found!\n", device_xname(sc->sc_dev));
+               aprint_error_dev(sc->sc_dev, "no media found!\n");
                ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE, 0, NULL);
                ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE);
                return;
@@ -5489,7 +5490,7 @@
        const char *sep = "";
 
 #define        ADD(m, c)       ifmedia_add(&sc->sc_mii.mii_media, (m), (c), NULL)
-#define        PRINT(str)      printf("%s%s", sep, str); sep = ", "
+#define        PRINT(str)      aprint_normal("%s%s", sep, str); sep = ", "
 
        sc->sc_mii.mii_ifp = ifp;
        sc->sc_mii.mii_readreg = tlp_pnic_mii_readreg;
@@ -5501,7 +5502,7 @@
            MII_OFFSET_ANY, 0);
        if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {
                /* XXX What about AUI/BNC support? */
-               printf("%s: ", device_xname(sc->sc_dev));
+               aprint_normal_dev(sc->sc_dev, "");
 
                tlp_pnic_nway_reset(sc);
 
@@ -5528,7 +5529,7 @@
                    PNIC_NWAY_CAP100TXFDX|PNIC_NWAY_CAP100TX);
                PRINT("auto");
 
-               printf("\n");
+               aprint_normal("\n");
 
                sc->sc_statchg = tlp_pnic_nway_statchg;
                sc->sc_tick = tlp_pnic_nway_tick;
diff -r 61fe334125b0 -r 8cb7f18a9d46 sys/dev/isa/sbdsp.c
--- a/sys/dev/isa/sbdsp.c       Tue Sep 01 21:46:07 2009 +0000
+++ b/sys/dev/isa/sbdsp.c       Tue Sep 01 21:46:52 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbdsp.c,v 1.131 2008/04/28 20:23:52 martin Exp $       */
+/*     $NetBSD: sbdsp.c,v 1.132 2009/09/01 21:47:30 jmcneill Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbdsp.c,v 1.131 2008/04/28 20:23:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbdsp.c,v 1.132 2009/09/01 21:47:30 jmcneill Exp $");
 
 #include "midi.h"
 #include "mpu.h"
@@ -401,7 +401,8 @@
                sc->in_filter = 0;      /* no filters turned on, please */
        }
 
-       printf(": dsp v%d.%02d%s\n",
+       aprint_naive("\n");
+       aprint_normal(": dsp v%d.%02d%s\n",
               SBVER_MAJOR(sc->sc_version), SBVER_MINOR(sc->sc_version),
               sc->sc_model == SB_JAZZ ? ": <Jazz16>" : "");
 
diff -r 61fe334125b0 -r 8cb7f18a9d46 sys/dev/pci/if_tlp_pci.c
--- a/sys/dev/pci/if_tlp_pci.c  Tue Sep 01 21:46:07 2009 +0000
+++ b/sys/dev/pci/if_tlp_pci.c  Tue Sep 01 21:46:52 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tlp_pci.c,v 1.114 2009/05/06 09:25:16 cegger Exp $  */
+/*     $NetBSD: if_tlp_pci.c,v 1.115 2009/09/01 21:46:53 jmcneill Exp $        */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tlp_pci.c,v 1.114 2009/05/06 09:25:16 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tlp_pci.c,v 1.115 2009/09/01 21:46:53 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1208,7 +1208,7 @@
        case 0x2b:      /* ZX244 */
        case 0x2c:      /* ZX424 */
        case 0x2e:      /* ZX422 */
-               printf("%s: QS6611 PHY\n", device_xname(sc->sc_dev));
+               aprint_normal_dev(sc->sc_dev, "QS6611 PHY\n");
                sc->sc_reset = tlp_pci_znyx_21142_qs6611_reset;
                break;
        }
@@ -1402,14 +1402,14 @@
 
        ifmedia_init(&sc->sc_mii.mii_media, 0, tlp_mediachange,
            tlp_mediastatus);
-       printf("%s: ", device_xname(sc->sc_dev));
+       aprint_normal_dev(sc->sc_dev, "");
 
 #define        ADD(m, c) \
        tm = malloc(sizeof(*tm), M_DEVBUF, M_WAITOK|M_ZERO);            \
        tm->tm_opmode = (c);                                            \
        tm->tm_gpdata = GPP_SMC9332DST_INIT;                            \
        ifmedia_add(&sc->sc_mii.mii_media, (m), 0, tm)
-#define        PRINT(str)      printf("%s%s", sep, str); sep = ", "
+#define        PRINT(str)      aprint_normal("%s%s", sep, str); sep = ", "
 
        ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, 0), OPMODE_TTM);
        PRINT("10baseT");
@@ -1429,7 +1429,7 @@
 #undef ADD
 #undef PRINT
 
-       printf("\n");
+       aprint_normal("\n");
 
        tlp_reset(sc);
        TULIP_WRITE(sc, CSR_OPMODE, sc->sc_opmode | OPMODE_PCS | OPMODE_SCR);
@@ -1611,14 +1611,14 @@
 
        ifmedia_init(&sc->sc_mii.mii_media, 0, tlp_mediachange,
            tlp_mediastatus);
-       printf("%s: ", device_xname(sc->sc_dev));
+       aprint_normal_dev(sc->sc_dev, "");
 
 #define        ADD(m, c) \
        tm = malloc(sizeof(*tm), M_DEVBUF, M_WAITOK|M_ZERO);            \
        tm->tm_opmode = (c);                                            \
        tm->tm_gpdata = GPP_COGENT_EM1x0_INIT;                          \
        ifmedia_add(&sc->sc_mii.mii_media, (m), 0, tm)
-#define        PRINT(str)      printf("%s%s", sep, str); sep = ", "
+#define        PRINT(str)      aprint_normal("%s%s", sep, str); sep = ", "
 
        if (sc->sc_srom[32] == 0x15) {
                ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_FX, 0, 0),
@@ -1628,7 +1628,7 @@
                ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_FX, IFM_FDX, 0),
                    OPMODE_PS | OPMODE_PCS | OPMODE_FD);
                PRINT("100baseFX-FDX");
-               printf("\n");
+               aprint_normal("\n");
 
                ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_100_FX);
        } else {
@@ -1639,7 +1639,7 @@
                ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_FX, IFM_FDX, 0),
                    OPMODE_PS | OPMODE_PCS | OPMODE_SCR | OPMODE_FD);
                PRINT("100baseTX-FDX");
-               printf("\n");
+               aprint_normal("\n");
 
                ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_100_TX);
        }



Home | Main Index | Thread Index | Old Index