Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

HariKrishna Sagala and committed by
Mark Brown
6ef8e042 ef371463

+5 -4
+5 -4
sound/soc/codecs/wm8400.c
··· 318 318 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); 319 319 struct soc_mixer_control *mc = 320 320 (struct soc_mixer_control *)kcontrol->private_value; 321 + struct wm8400_priv *wm8400 = snd_soc_component_get_drvdata(component); 321 322 u32 reg_shift = mc->shift; 322 323 int ret = 0; 323 324 u16 reg; ··· 327 326 case WM8400_SPEAKER_MIXER | (WM8400_LDSPK << 8) : 328 327 reg = snd_soc_component_read(component, WM8400_OUTPUT_MIXER1); 329 328 if (reg & WM8400_LDLO) { 330 - printk(KERN_WARNING 329 + dev_warn(wm8400->wm8400->dev, 331 330 "Cannot set as Output Mixer 1 LDLO Set\n"); 332 331 ret = -1; 333 332 } ··· 335 334 case WM8400_SPEAKER_MIXER | (WM8400_RDSPK << 8): 336 335 reg = snd_soc_component_read(component, WM8400_OUTPUT_MIXER2); 337 336 if (reg & WM8400_RDRO) { 338 - printk(KERN_WARNING 337 + dev_warn(wm8400->wm8400->dev, 339 338 "Cannot set as Output Mixer 2 RDRO Set\n"); 340 339 ret = -1; 341 340 } ··· 343 342 case WM8400_OUTPUT_MIXER1 | (WM8400_LDLO << 8): 344 343 reg = snd_soc_component_read(component, WM8400_SPEAKER_MIXER); 345 344 if (reg & WM8400_LDSPK) { 346 - printk(KERN_WARNING 345 + dev_warn(wm8400->wm8400->dev, 347 346 "Cannot set as Speaker Mixer LDSPK Set\n"); 348 347 ret = -1; 349 348 } ··· 351 350 case WM8400_OUTPUT_MIXER2 | (WM8400_RDRO << 8): 352 351 reg = snd_soc_component_read(component, WM8400_SPEAKER_MIXER); 353 352 if (reg & WM8400_RDSPK) { 354 - printk(KERN_WARNING 353 + dev_warn(wm8400->wm8400->dev, 355 354 "Cannot set as Speaker Mixer RDSPK Set\n"); 356 355 ret = -1; 357 356 }