summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHariKrishna Sagala <hariconscious@gmail.com>2025-10-25 07:30:11 +0300
committerMark Brown <broonie@kernel.org>2025-10-30 15:35:05 +0300
commit6ef8e042cdcaabe3e3c68592ba8bfbaee2fa10a3 (patch)
treef19dc4a1c3f2e24dc5ebd53977d51f98357ac72d
parentef37146360385282b5f6a5b4bf695db30d609887 (diff)
downloadlinux-6ef8e042cdcaabe3e3c68592ba8bfbaee2fa10a3.tar.xz
ASoC: codec: wm8400: replace printk() calls with dev_*() device aware logging
Replace direct printk() calls with the appropriate dev_*() logging APIs.Use dev_err, dev_warn, dev_info, or dev_dbg to reflect the correct severity level. Pass the canonical struct device pointer so logs include device context and become traceable to specific hardware instances.Improve log clarity, make messages filterable by device and align the driver with kernel logging conventions to aid debugging and maintenance. Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251025043011.598300-1-hariconscious@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/wm8400.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
index 4f5a4de60e3b..096f8fdbdff5 100644
--- a/sound/soc/codecs/wm8400.c
+++ b/sound/soc/codecs/wm8400.c
@@ -318,6 +318,7 @@ static int outmixer_event (struct snd_soc_dapm_widget *w,
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
+ struct wm8400_priv *wm8400 = snd_soc_component_get_drvdata(component);
u32 reg_shift = mc->shift;
int ret = 0;
u16 reg;
@@ -326,7 +327,7 @@ static int outmixer_event (struct snd_soc_dapm_widget *w,
case WM8400_SPEAKER_MIXER | (WM8400_LDSPK << 8) :
reg = snd_soc_component_read(component, WM8400_OUTPUT_MIXER1);
if (reg & WM8400_LDLO) {
- printk(KERN_WARNING
+ dev_warn(wm8400->wm8400->dev,
"Cannot set as Output Mixer 1 LDLO Set\n");
ret = -1;
}
@@ -334,7 +335,7 @@ static int outmixer_event (struct snd_soc_dapm_widget *w,
case WM8400_SPEAKER_MIXER | (WM8400_RDSPK << 8):
reg = snd_soc_component_read(component, WM8400_OUTPUT_MIXER2);
if (reg & WM8400_RDRO) {
- printk(KERN_WARNING
+ dev_warn(wm8400->wm8400->dev,
"Cannot set as Output Mixer 2 RDRO Set\n");
ret = -1;
}
@@ -342,7 +343,7 @@ static int outmixer_event (struct snd_soc_dapm_widget *w,
case WM8400_OUTPUT_MIXER1 | (WM8400_LDLO << 8):
reg = snd_soc_component_read(component, WM8400_SPEAKER_MIXER);
if (reg & WM8400_LDSPK) {
- printk(KERN_WARNING
+ dev_warn(wm8400->wm8400->dev,
"Cannot set as Speaker Mixer LDSPK Set\n");
ret = -1;
}
@@ -350,7 +351,7 @@ static int outmixer_event (struct snd_soc_dapm_widget *w,
case WM8400_OUTPUT_MIXER2 | (WM8400_RDRO << 8):
reg = snd_soc_component_read(component, WM8400_SPEAKER_MIXER);
if (reg & WM8400_RDSPK) {
- printk(KERN_WARNING
+ dev_warn(wm8400->wm8400->dev,
"Cannot set as Speaker Mixer RDSPK Set\n");
ret = -1;
}