Skip to content

Commit 4e76a88

Browse files
committed
ALSA: hda - Replace with standard printk
Use dev_err() and co for messages from HD-audio controller and codec drivers. The codec drivers are mostly bound with codec objects, so some helper macros, codec_err(), codec_info(), etc, are provided. They merely wrap the corresponding dev_xxx(). There are a few places still calling snd_printk() and its variants as they are called without the codec or device context. Signed-off-by: Takashi Iwai <[email protected]>
1 parent b989d04 commit 4e76a88

17 files changed

+434
-449
lines changed

sound/pci/hda/hda_auto_parser.c

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
313313
}
314314

315315
if (hsmic)
316-
snd_printdd("Told to look for a headset mic, but didn't find any.\n");
316+
codec_dbg(codec, "Told to look for a headset mic, but didn't find any.\n");
317317
if (hpmic)
318-
snd_printdd("Told to look for a headphone mic, but didn't find any.\n");
318+
codec_dbg(codec, "Told to look for a headphone mic, but didn't find any.\n");
319319
}
320320

321321
/* FIX-UP:
@@ -384,33 +384,33 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
384384
/*
385385
* debug prints of the parsed results
386386
*/
387-
snd_printd("autoconfig: line_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x) type:%s\n",
387+
codec_info(codec, "autoconfig: line_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x) type:%s\n",
388388
cfg->line_outs, cfg->line_out_pins[0], cfg->line_out_pins[1],
389389
cfg->line_out_pins[2], cfg->line_out_pins[3],
390390
cfg->line_out_pins[4],
391391
cfg->line_out_type == AUTO_PIN_HP_OUT ? "hp" :
392392
(cfg->line_out_type == AUTO_PIN_SPEAKER_OUT ?
393393
"speaker" : "line"));
394-
snd_printd(" speaker_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n",
394+
codec_info(codec, " speaker_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n",
395395
cfg->speaker_outs, cfg->speaker_pins[0],
396396
cfg->speaker_pins[1], cfg->speaker_pins[2],
397397
cfg->speaker_pins[3], cfg->speaker_pins[4]);
398-
snd_printd(" hp_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n",
398+
codec_info(codec, " hp_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n",
399399
cfg->hp_outs, cfg->hp_pins[0],
400400
cfg->hp_pins[1], cfg->hp_pins[2],
401401
cfg->hp_pins[3], cfg->hp_pins[4]);
402-
snd_printd(" mono: mono_out=0x%x\n", cfg->mono_out_pin);
402+
codec_info(codec, " mono: mono_out=0x%x\n", cfg->mono_out_pin);
403403
if (cfg->dig_outs)
404-
snd_printd(" dig-out=0x%x/0x%x\n",
404+
codec_info(codec, " dig-out=0x%x/0x%x\n",
405405
cfg->dig_out_pins[0], cfg->dig_out_pins[1]);
406-
snd_printd(" inputs:\n");
406+
codec_info(codec, " inputs:\n");
407407
for (i = 0; i < cfg->num_inputs; i++) {
408-
snd_printd(" %s=0x%x\n",
408+
codec_info(codec, " %s=0x%x\n",
409409
hda_get_autocfg_input_label(codec, cfg, i),
410410
cfg->inputs[i].pin);
411411
}
412412
if (cfg->dig_in_pin)
413-
snd_printd(" dig-in=0x%x\n", cfg->dig_in_pin);
413+
codec_info(codec, " dig-in=0x%x\n", cfg->dig_in_pin);
414414

415415
return 0;
416416
}
@@ -774,38 +774,33 @@ static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
774774
case HDA_FIXUP_PINS:
775775
if (action != HDA_FIXUP_ACT_PRE_PROBE || !fix->v.pins)
776776
break;
777-
snd_printdd(KERN_INFO SFX
778-
"%s: Apply pincfg for %s\n",
777+
codec_dbg(codec, "%s: Apply pincfg for %s\n",
779778
codec->chip_name, modelname);
780779
snd_hda_apply_pincfgs(codec, fix->v.pins);
781780
break;
782781
case HDA_FIXUP_VERBS:
783782
if (action != HDA_FIXUP_ACT_PROBE || !fix->v.verbs)
784783
break;
785-
snd_printdd(KERN_INFO SFX
786-
"%s: Apply fix-verbs for %s\n",
784+
codec_dbg(codec, "%s: Apply fix-verbs for %s\n",
787785
codec->chip_name, modelname);
788786
snd_hda_add_verbs(codec, fix->v.verbs);
789787
break;
790788
case HDA_FIXUP_FUNC:
791789
if (!fix->v.func)
792790
break;
793-
snd_printdd(KERN_INFO SFX
794-
"%s: Apply fix-func for %s\n",
791+
codec_dbg(codec, "%s: Apply fix-func for %s\n",
795792
codec->chip_name, modelname);
796793
fix->v.func(codec, fix, action);
797794
break;
798795
case HDA_FIXUP_PINCTLS:
799796
if (action != HDA_FIXUP_ACT_PROBE || !fix->v.pins)
800797
break;
801-
snd_printdd(KERN_INFO SFX
802-
"%s: Apply pinctl for %s\n",
798+
codec_dbg(codec, "%s: Apply pinctl for %s\n",
803799
codec->chip_name, modelname);
804800
set_pin_targets(codec, fix->v.pins);
805801
break;
806802
default:
807-
snd_printk(KERN_ERR SFX
808-
"%s: Invalid fixup type %d\n",
803+
codec_err(codec, "%s: Invalid fixup type %d\n",
809804
codec->chip_name, fix->type);
810805
break;
811806
}

sound/pci/hda/hda_beep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static int snd_hda_do_attach(struct hda_beep *beep)
172172
err = input_register_device(input_dev);
173173
if (err < 0) {
174174
input_free_device(input_dev);
175-
printk(KERN_INFO "hda_beep: unable to register input device\n");
175+
codec_err(codec, "hda_beep: unable to register input device\n");
176176
return err;
177177
}
178178
beep->dev = input_dev;

0 commit comments

Comments
 (0)