Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic use aprint.



details:   https://anonhg.NetBSD.org/src/rev/851f7d38d058
branches:  trunk
changeset: 326954:851f7d38d058
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Feb 23 15:29:11 2014 +0000

description:
use aprint.

diffstat:

 sys/dev/ic/arn5008.c |  39 +++++++++++++++++++--------------------
 sys/dev/ic/arn9003.c |  34 +++++++++++++++++-----------------
 sys/dev/ic/athn.c    |  17 +++++++++--------
 3 files changed, 45 insertions(+), 45 deletions(-)

diffs (281 lines):

diff -r e91542d85f57 -r 851f7d38d058 sys/dev/ic/arn5008.c
--- a/sys/dev/ic/arn5008.c      Sun Feb 23 13:22:32 2014 +0000
+++ b/sys/dev/ic/arn5008.c      Sun Feb 23 15:29:11 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arn5008.c,v 1.5 2013/10/22 13:04:25 skrll Exp $        */
+/*     $NetBSD: arn5008.c,v 1.6 2014/02/23 15:29:11 christos Exp $     */
 /*     $OpenBSD: ar5008.c,v 1.21 2012/08/25 12:14:31 kettenis Exp $    */
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arn5008.c,v 1.5 2013/10/22 13:04:25 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arn5008.c,v 1.6 2014/02/23 15:29:11 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -210,7 +210,7 @@
 
        /* Read entire ROM content in memory. */
        if ((error = ar5008_read_rom(sc)) != 0) {
-               printf("%s: could not read ROM\n", device_xname(sc->sc_dev));
+               aprint_error_dev(sc->sc_dev, "could not read ROM\n");
                return error;
        }
 
@@ -221,8 +221,8 @@
        eep_ver = (base->version >> 12) & 0xf;
        sc->sc_eep_rev = (base->version & 0xfff);
        if (eep_ver != AR_EEP_VER || sc->sc_eep_rev == 0) {
-               printf("%s: unsupported ROM version %d.%d\n",
-                   device_xname(sc->sc_dev), eep_ver, sc->sc_eep_rev);
+               aprint_error_dev(sc->sc_dev, "unsupported ROM version %d.%d\n",
+                   eep_ver, sc->sc_eep_rev);
                return EINVAL;
        }
 
@@ -330,8 +330,7 @@
                sum ^= *eep;
        }
        if (sum != 0xffff) {
-               printf("%s: bad ROM checksum 0x%04x\n",
-                   device_xname(sc->sc_dev), sum);
+               aprint_error_dev(sc->sc_dev, "bad ROM checksum 0x%04x\n", sum);
                return EIO;
        }
        if (need_swap)
@@ -532,8 +531,8 @@
                    AR5008_MAX_SCATTER, ATHN_TXBUFSZ, 0, BUS_DMA_NOWAIT,
                    &bf->bf_map);
                if (error != 0) {
-                       printf("%s: could not create Tx buf DMA map\n",
-                           device_xname(sc->sc_dev));
+                       aprint_error_dev(sc->sc_dev,
+                           "could not create Tx buf DMA map\n");
                        goto fail;
                }
 
@@ -620,8 +619,8 @@
                    ATHN_RXBUFSZ, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW,
                    &bf->bf_map);
                if (error != 0) {
-                       printf("%s: could not create Rx buf DMA map\n",
-                           device_xname(sc->sc_dev));
+                       aprint_error_dev(sc->sc_dev,
+                           " could not create Rx buf DMA map\n");
                        goto fail;
                }
                /*
@@ -630,8 +629,8 @@
                 */
                bf->bf_m = MCLGETI(NULL, M_DONTWAIT, NULL, ATHN_RXBUFSZ);
                if (bf->bf_m == NULL) {
-                       printf("%s: could not allocate Rx mbuf\n",
-                           device_xname(sc->sc_dev));
+                       aprint_error_dev(sc->sc_dev,
+                           "could not allocate Rx mbuf\n");
                        error = ENOBUFS;
                        goto fail;
                }
@@ -640,8 +639,8 @@
                    mtod(bf->bf_m, void *), ATHN_RXBUFSZ, NULL,
                    BUS_DMA_NOWAIT | BUS_DMA_READ);
                if (error != 0) {
-                       printf("%s: could not DMA map Rx buffer\n",
-                           device_xname(sc->sc_dev));
+                       aprint_error_dev(sc->sc_dev,
+                           "could not DMA map Rx buffer\n");
                        goto fail;
                }
 
@@ -802,7 +801,7 @@
 
        bf = SIMPLEQ_FIRST(&rxq->head);
        if (__predict_false(bf == NULL)) {      /* Should not happen. */
-               printf("%s: Rx queue is empty!\n", device_xname(sc->sc_dev));
+               aprint_error_dev(sc->sc_dev, "Rx queue is empty!\n");
                return ENOENT;
        }
        ds = bf->bf_desc;
@@ -1393,8 +1392,8 @@
            BUS_DMA_NOWAIT | BUS_DMA_WRITE);
        if (__predict_false(error != 0)) {
                if (error != EFBIG) {
-                       printf("%s: can't map mbuf (error %d)\n",
-                           device_xname(sc->sc_dev), error);
+                       aprint_error_dev(sc->sc_dev,
+                           "can't map mbuf (error %d)\n", error);
                        m_freem(m);
                        return error;
                }
@@ -1423,8 +1422,8 @@
                error = bus_dmamap_load_mbuf(sc->sc_dmat, bf->bf_map, m,
                    BUS_DMA_NOWAIT | BUS_DMA_WRITE);
                if (error != 0) {
-                       printf("%s: can't map mbuf (error %d)\n",
-                           device_xname(sc->sc_dev), error);
+                       aprint_error_dev(sc->sc_dev,
+                           "can't map mbuf (error %d)\n", error);
                        m_freem(m);
                        return error;
                }
diff -r e91542d85f57 -r 851f7d38d058 sys/dev/ic/arn9003.c
--- a/sys/dev/ic/arn9003.c      Sun Feb 23 13:22:32 2014 +0000
+++ b/sys/dev/ic/arn9003.c      Sun Feb 23 15:29:11 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arn9003.c,v 1.5 2013/10/22 13:04:25 skrll Exp $        */
+/*     $NetBSD: arn9003.c,v 1.6 2014/02/23 15:29:12 christos Exp $     */
 /*     $OpenBSD: ar9003.c,v 1.25 2012/10/20 09:53:32 stsp Exp $        */
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arn9003.c,v 1.5 2013/10/22 13:04:25 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arn9003.c,v 1.6 2014/02/23 15:29:12 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -228,12 +228,12 @@
 
        /* Determine ROM type and location. */
        if ((error = ar9003_find_rom(sc)) != 0) {
-               printf("%s: could not find ROM\n", device_xname(sc->sc_dev));
+               aprint_error_dev(sc->sc_dev, "could not find ROM\n");
                return error;
        }
        /* Read entire ROM content in memory. */
        if ((error = ar9003_read_rom(sc)) != 0) {
-               printf("%s: could not read ROM\n", device_xname(sc->sc_dev));
+               aprint_error_dev(sc->sc_dev, "could not read ROM\n");
                return error;
        }
 
@@ -694,8 +694,8 @@
                    AR9003_MAX_SCATTER, ATHN_TXBUFSZ, 0, BUS_DMA_NOWAIT,
                    &bf->bf_map);
                if (error != 0) {
-                       printf("%s: could not create Tx buf DMA map\n",
-                           device_xname(sc->sc_dev));
+                       aprint_error_dev(sc->sc_dev,
+                           "could not create Tx buf DMA map\n");
                        goto fail;
                }
 
@@ -766,8 +766,8 @@
                    ATHN_RXBUFSZ, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW,
                    &bf->bf_map);
                if (error != 0) {
-                       printf("%s: could not create Rx buf DMA map\n",
-                           device_xname(sc->sc_dev));
+                       aprint_error_dev(sc->sc_dev,
+                           "could not create Rx buf DMA map\n");
                        goto fail;
                }
                /*
@@ -775,8 +775,8 @@
                 */
                bf->bf_m = MCLGETI(NULL, M_DONTWAIT, NULL, ATHN_RXBUFSZ);
                if (bf->bf_m == NULL) {
-                       printf("%s: could not allocate Rx mbuf\n",
-                           device_xname(sc->sc_dev));
+                       aprint_error_dev(sc->sc_dev,
+                           "could not allocate Rx mbuf\n");
                        error = ENOBUFS;
                        goto fail;
                }
@@ -785,8 +785,8 @@
                    mtod(bf->bf_m, void *), ATHN_RXBUFSZ, NULL,
                    BUS_DMA_NOWAIT);
                if (error != 0) {
-                       printf("%s: could not DMA map Rx buffer\n",
-                           device_xname(sc->sc_dev));
+                       aprint_error_dev(sc->sc_dev,
+                           "could not DMA map Rx buffer\n");
                        goto fail;
                }
 
@@ -953,7 +953,7 @@
 
        bf = SIMPLEQ_FIRST(&rxq->head);
        if (__predict_false(bf == NULL)) {      /* Should not happen. */
-               printf("%s: Rx queue is empty!\n", device_xname(sc->sc_dev));
+               aprint_error_dev(sc->sc_dev, "Rx queue is empty!\n");
                return ENOENT;
        }
        bus_dmamap_sync(sc->sc_dmat, bf->bf_map, 0, ATHN_RXBUFSZ,
@@ -1548,8 +1548,8 @@
            BUS_DMA_NOWAIT | BUS_DMA_WRITE);
        if (__predict_false(error != 0)) {
                if (error != EFBIG) {
-                       printf("%s: can't map mbuf (error %d)\n",
-                           device_xname(sc->sc_dev), error);
+                       aprint_error_dev(sc->sc_dev,
+                           "can't map mbuf (error %d)\n", error);
                        m_freem(m);
                        return error;
                }
@@ -1578,8 +1578,8 @@
                error = bus_dmamap_load_mbuf(sc->sc_dmat, bf->bf_map, m,
                    BUS_DMA_NOWAIT | BUS_DMA_WRITE);
                if (error != 0) {
-                       printf("%s: can't map mbuf (error %d)\n",
-                           device_xname(sc->sc_dev), error);
+                       aprint_error_dev(sc->sc_dev,
+                           "can't map mbuf (error %d)\n", error);
                        m_freem(m);
                        return error;
                }
diff -r e91542d85f57 -r 851f7d38d058 sys/dev/ic/athn.c
--- a/sys/dev/ic/athn.c Sun Feb 23 13:22:32 2014 +0000
+++ b/sys/dev/ic/athn.c Sun Feb 23 15:29:11 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: athn.c,v 1.7 2013/10/17 21:24:24 christos Exp $        */
+/*     $NetBSD: athn.c,v 1.8 2014/02/23 15:29:12 christos Exp $        */
 /*     $OpenBSD: athn.c,v 1.75 2013/01/14 09:50:31 jsing Exp $ */
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: athn.c,v 1.7 2013/10/17 21:24:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: athn.c,v 1.8 2014/02/23 15:29:12 christos Exp $");
 
 #ifndef _MODULE
 #include "athn_usb.h"          /* for NATHN_USB */
@@ -234,15 +234,16 @@
            ((sc->sc_rxchainmask >> 0) & 1);
 
        if (AR_SINGLE_CHIP(sc)) {
-               aprint_normal(": Atheros %s\n", athn_get_mac_name(sc));
+               aprint_normal_dev(sc->sc_dev,
+                   "Atheros %s\n", athn_get_mac_name(sc));
                aprint_verbose_dev(sc->sc_dev,
                    "rev %d (%dT%dR), ROM rev %d, address %s\n",
                    sc->sc_mac_rev,
                    sc->sc_ntxchains, sc->sc_nrxchains, sc->sc_eep_rev,
                    ether_sprintf(ic->ic_myaddr));
-       }
-       else {
-               aprint_normal(": Atheros %s, RF %s\n", athn_get_mac_name(sc),
+       } else {
+               aprint_normal_dev(sc->sc_dev,
+                   "Atheros %s, RF %s\n", athn_get_mac_name(sc),
                    athn_get_rf_name(sc));
                aprint_verbose_dev(sc->sc_dev,
                    "rev %d (%dT%dR), ROM rev %d, address %s\n",
@@ -2824,8 +2825,8 @@
                /* avoid recursion in athn_resume */
                if (!pmf_device_subtree_resume(sc->sc_dev, &sc->sc_qual) ||
                    !device_is_active(sc->sc_dev)) {
-                       printf("%s: failed to power up device\n",
-                           device_xname(sc->sc_dev));
+                       aprint_error_dev(sc->sc_dev,
+                           "failed to power up device\n");
                        return 0;
                }
                ifp->if_flags = flags;



Home | Main Index | Thread Index | Old Index