Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Correctly use device_printf() rather than aprint_...



details:   https://anonhg.NetBSD.org/src/rev/34cdbaaf68fb
branches:  trunk
changeset: 993716:34cdbaaf68fb
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Wed Sep 26 18:06:59 2018 +0000

description:
Correctly use device_printf() rather than aprint_error_dev() for errors
that can occur at runtime.

diffstat:

 sys/dev/ic/dwiic.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (81 lines):

diff -r b0181ebb3b8f -r 34cdbaaf68fb sys/dev/ic/dwiic.c
--- a/sys/dev/ic/dwiic.c        Wed Sep 26 16:55:34 2018 +0000
+++ b/sys/dev/ic/dwiic.c        Wed Sep 26 18:06:59 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwiic.c,v 1.2 2018/09/25 16:29:41 jakllsch Exp $ */
+/* $NetBSD: dwiic.c,v 1.3 2018/09/26 18:06:59 jakllsch Exp $ */
 
 /* $OpenBSD dwiic.c,v 1.24 2017/08/17 20:41:16 kettenis Exp $ */
 
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwiic.c,v 1.2 2018/09/25 16:29:41 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwiic.c,v 1.3 2018/09/26 18:06:59 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -228,7 +228,7 @@
        dwiic_read(sc, DW_IC_CLR_INTR);
        if (sc->sc_power != NULL) {
                if (!sc->sc_power(sc, 0)) {
-                       aprint_error_dev(sc->sc_dev, "failed to power off\n");
+                       device_printf(sc->sc_dev, "failed to power off\n");
                }
        }
        return true;
@@ -240,7 +240,7 @@
        struct dwiic_softc *sc = device_private(self);
        if (sc->sc_power != NULL) {
                if (!sc->sc_power(sc, 1)) {
-                       aprint_error_dev(sc->sc_dev, "failed to power up\n");
+                       device_printf(sc->sc_dev, "failed to power up\n");
                        return false;
                }
        }
@@ -346,7 +346,7 @@
                DELAY(25);
        }
 
-       aprint_error_dev(sc->sc_dev, "failed to %sable\n",
+       device_printf(sc->sc_dev, "failed to %sable\n",
            (enable ? "en" : "dis"));
 }
 
@@ -412,7 +412,7 @@
 
                if (cv_timedwait(&sc->sc_int_writewait,
                    &sc->sc_int_lock, hz / 2) != 0)
-                       aprint_error_dev(sc->sc_dev,
+                       device_printf(sc->sc_dev,
                            "timed out waiting for tx_empty intr\n");
                dwiic_write(sc, DW_IC_INTR_MASK, 0);
                dwiic_read(sc, DW_IC_CLR_INTR);
@@ -432,7 +432,7 @@
                tx_limit = sc->tx_fifo_depth - dwiic_read(sc, DW_IC_TXFLR);
                if (cmdlen > tx_limit) {
                        /* TODO */
-                       aprint_error_dev(sc->sc_dev, "can't write %zu (> %d)\n",
+                       device_printf(sc->sc_dev, "can't write %zu (> %d)\n",
                            cmdlen, tx_limit);
                        sc->sc_i2c_xfer.error = 1;
                        return (1);
@@ -504,7 +504,7 @@
 
                                if (cv_timedwait(&sc->sc_int_readwait,
                                    &sc->sc_int_lock, hz / 2) != 0)
-                                       aprint_error_dev(sc->sc_dev,
+                                       device_printf(sc->sc_dev,
                                            "timed out waiting for "
                                            "rx_full intr\n");
 
@@ -515,7 +515,7 @@
                        }
 
                        if (rx_avail == 0) {
-                               aprint_error_dev(sc->sc_dev,
+                               device_printf(sc->sc_dev,
                                    "timed out reading remaining %d\n",
                                    (int)(len - 1 - readpos));
                                sc->sc_i2c_xfer.error = 1;



Home | Main Index | Thread Index | Old Index