From 0a6a643faa6dbc73764ba6df3fbc285e9bcbdd54 Mon Sep 17 00:00:00 2001 From: nat Date: Sat, 21 Jan 2017 23:37:17 +0000 Subject: [PATCH] Use more specific error messages if the setting of channel parameters fails. Use aprint_error_dev for this. As suggested by pgoyette@ --- sys/dev/audio.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/dev/audio.c b/sys/dev/audio.c index 1c47149c48a7..949a61794d1a 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.293 2017/01/21 22:54:11 nat Exp $ */ +/* $NetBSD: audio.c,v 1.294 2017/01/21 23:37:17 nat Exp $ */ /*- * Copyright (c) 2016 Nathanial Sloss @@ -148,7 +148,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.293 2017/01/21 22:54:11 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.294 2017/01/21 23:37:17 nat Exp $"); #include "audio.h" #if NAUDIO > 0 @@ -5780,8 +5780,8 @@ audio_sysctl_frequency(SYSCTLFN_ARGS) error = audio_set_vchan_defaults(sc, AUMODE_PLAY | AUMODE_PLAY_ALL | AUMODE_RECORD, &sc->sc_format[0], 0); if (error) - aprint_error("Invalid channel format, please check hardware " - "capabilities\n"); + aprint_error_dev(sc->sc_dev, "Error setting frequency, " + "please check hardware capabilities\n"); mutex_exit(sc->sc_lock); return error; @@ -5832,8 +5832,8 @@ audio_sysctl_precision(SYSCTLFN_ARGS) error = audio_set_vchan_defaults(sc, AUMODE_PLAY | AUMODE_PLAY_ALL | AUMODE_RECORD, &sc->sc_format[0], 0); if (error) - aprint_error("Invalid channel format, please check hardware " - "capabilities\n"); + aprint_error_dev(sc->sc_dev, "Error setting precision, " + "please check hardware capabilities\n"); mutex_exit(sc->sc_lock); return error; @@ -5873,8 +5873,8 @@ audio_sysctl_channels(SYSCTLFN_ARGS) error = audio_set_vchan_defaults(sc, AUMODE_PLAY | AUMODE_PLAY_ALL | AUMODE_RECORD, &sc->sc_format[0], 0); if (error) - aprint_error("Invalid channel format, please check hardware " - "capabilities\n"); + aprint_error_dev(sc->sc_dev, "Error setting channels, " + "please check hardware capabilities\n"); mutex_exit(sc->sc_lock); return error; @@ -5910,8 +5910,8 @@ vchan_autoconfig(struct audio_softc *sc) error = EINVAL; if (error == 0) { - aprint_normal("Virtual format " - "configured - " + aprint_normal_dev(sc->sc_dev, + "Virtual format configured - " "Format SLINEAR, precision %d, " "channels %d, frequency %d\n", sc->sc_precision, sc->sc_channels, @@ -5924,7 +5924,7 @@ vchan_autoconfig(struct audio_softc *sc) } } - aprint_error("Virtual format auto config failed!\n" + aprint_error_dev(sc->sc_dev, "Virtual format auto config failed!\n" "Please check hardware capabilities\n"); mutex_exit(sc->sc_lock);