Convert with dev_err() and co from snd_printk(), etc.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
static int debug;
module_param(debug, int, 0644);
#define verbose_debug(fmt, args...) \
- do { if (debug > 1) printk(KERN_DEBUG SFX fmt, ##args); } while (0)
+ do { if (debug > 1) pr_debug(SFX fmt, ##args); } while (0)
#else
#define verbose_debug(fmt, args...)
#endif
verbose_debug("get_response: %x, %x\n",
chip->res, chip->res_ex);
if (chip->res_ex & LOLA_RIRB_EX_ERROR) {
- printk(KERN_WARNING SFX "RIRB ERROR: "
+ dev_warn(chip->card->dev, "RIRB ERROR: "
"NID=%x, verb=%x, data=%x, ext=%x\n",
chip->last_cmd_nid,
chip->last_verb, chip->last_data,
udelay(20);
cond_resched();
}
- printk(KERN_WARNING SFX "RIRB response error\n");
+ dev_warn(chip->card->dev, "RIRB response error\n");
if (!chip->polling_mode) {
- printk(KERN_WARNING SFX "switching to polling mode\n");
+ dev_warn(chip->card->dev, "switching to polling mode\n");
chip->polling_mode = 1;
goto again;
}
break;
} while (time_before(jiffies, end_time));
if (!gctl) {
- printk(KERN_ERR SFX "cannot reset controller\n");
+ dev_err(chip->card->dev, "cannot reset controller\n");
return -EIO;
}
return 0;
err = lola_read_param(chip, 0, LOLA_PAR_VENDOR_ID, &val);
if (err < 0) {
- printk(KERN_ERR SFX "Can't read VENDOR_ID\n");
+ dev_err(chip->card->dev, "Can't read VENDOR_ID\n");
return err;
}
val >>= 16;
if (val != 0x1369) {
- printk(KERN_ERR SFX "Unknown codec vendor 0x%x\n", val);
+ dev_err(chip->card->dev, "Unknown codec vendor 0x%x\n", val);
return -EINVAL;
}
err = lola_read_param(chip, 1, LOLA_PAR_FUNCTION_TYPE, &val);
if (err < 0) {
- printk(KERN_ERR SFX "Can't read FUNCTION_TYPE\n");
+ dev_err(chip->card->dev, "Can't read FUNCTION_TYPE\n");
return err;
}
if (val != 1) {
- printk(KERN_ERR SFX "Unknown function type %d\n", val);
+ dev_err(chip->card->dev, "Unknown function type %d\n", val);
return -EINVAL;
}
err = lola_read_param(chip, 1, LOLA_PAR_SPECIFIC_CAPS, &val);
if (err < 0) {
- printk(KERN_ERR SFX "Can't read SPECCAPS\n");
+ dev_err(chip->card->dev, "Can't read SPECCAPS\n");
return err;
}
chip->lola_caps = val;
chip->pin[CAPT].num_pins = LOLA_AFG_INPUT_PIN_COUNT(chip->lola_caps);
chip->pin[PLAY].num_pins = LOLA_AFG_OUTPUT_PIN_COUNT(chip->lola_caps);
- snd_printdd(SFX "speccaps=0x%x, pins in=%d, out=%d\n",
+ dev_dbg(chip->card->dev, "speccaps=0x%x, pins in=%d, out=%d\n",
chip->lola_caps,
chip->pin[CAPT].num_pins, chip->pin[PLAY].num_pins);
if (chip->pin[CAPT].num_pins > MAX_AUDIO_INOUT_COUNT ||
chip->pin[PLAY].num_pins > MAX_AUDIO_INOUT_COUNT) {
- printk(KERN_ERR SFX "Invalid Lola-spec caps 0x%x\n", val);
+ dev_err(chip->card->dev, "Invalid Lola-spec caps 0x%x\n", val);
return -EINVAL;
}
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (!chip) {
- snd_printk(KERN_ERR SFX "cannot allocate chip\n");
+ dev_err(chip->card->dev, "cannot allocate chip\n");
pci_disable_device(pci);
return -ENOMEM;
}
chip->sample_rate_max = 192000;
break;
default:
- snd_printk(KERN_WARNING SFX
+ dev_warn(chip->card->dev,
"Invalid granularity %d, reset to %d\n",
chip->granularity, LOLA_GRANULARITY_MAX);
chip->granularity = LOLA_GRANULARITY_MAX;
}
chip->sample_rate_min = sample_rate_min[dev];
if (chip->sample_rate_min > chip->sample_rate_max) {
- snd_printk(KERN_WARNING SFX
+ dev_warn(chip->card->dev,
"Invalid sample_rate_min %d, reset to 16000\n",
chip->sample_rate_min);
chip->sample_rate_min = 16000;
chip->bar[1].addr = pci_resource_start(pci, 2);
chip->bar[1].remap_addr = pci_ioremap_bar(pci, 2);
if (!chip->bar[0].remap_addr || !chip->bar[1].remap_addr) {
- snd_printk(KERN_ERR SFX "ioremap error\n");
+ dev_err(chip->card->dev, "ioremap error\n");
err = -ENXIO;
goto errout;
}
if (request_irq(pci->irq, lola_interrupt, IRQF_SHARED,
KBUILD_MODNAME, chip)) {
- printk(KERN_ERR SFX "unable to grab IRQ %d\n", pci->irq);
+ dev_err(chip->card->dev, "unable to grab IRQ %d\n", pci->irq);
err = -EBUSY;
goto errout;
}
chip->pcm[CAPT].num_streams = (dever >> 0) & 0x3ff;
chip->pcm[PLAY].num_streams = (dever >> 10) & 0x3ff;
chip->version = (dever >> 24) & 0xff;
- snd_printdd(SFX "streams in=%d, out=%d, version=0x%x\n",
+ dev_dbg(chip->card->dev, "streams in=%d, out=%d, version=0x%x\n",
chip->pcm[CAPT].num_streams, chip->pcm[PLAY].num_streams,
chip->version);
chip->pcm[PLAY].num_streams > MAX_STREAM_OUT_COUNT ||
(!chip->pcm[CAPT].num_streams &&
!chip->pcm[PLAY].num_streams)) {
- printk(KERN_ERR SFX "invalid DEVER = %x\n", dever);
+ dev_err(chip->card->dev, "invalid DEVER = %x\n", dever);
err = -EINVAL;
goto errout;
}
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
if (err < 0) {
- snd_printk(KERN_ERR SFX "Error creating device [card]!\n");
+ dev_err(chip->card->dev, "Error creating device [card]!\n");
goto errout;
}
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0) {
- snd_printk(KERN_ERR SFX "Error creating card!\n");
+ dev_err(card->dev, "Error creating card!\n");
return err;
}
err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val);
if (err < 0) {
- printk(KERN_ERR SFX "Can't read wcaps for 0x%x\n", nid);
+ dev_err(chip->card->dev, "Can't read wcaps for 0x%x\n", nid);
return err;
}
if ((val & 0xfff00000) != 0x01f00000) { /* test SubType and Type */
- snd_printdd("No valid clock widget\n");
+ dev_dbg(chip->card->dev, "No valid clock widget\n");
return 0;
}
chip->clock.nid = nid;
chip->clock.items = val & 0xff;
- snd_printdd("clock_list nid=%x, entries=%d\n", nid,
+ dev_dbg(chip->card->dev, "clock_list nid=%x, entries=%d\n", nid,
chip->clock.items);
if (chip->clock.items > MAX_SAMPLE_CLOCK_COUNT) {
- printk(KERN_ERR SFX "CLOCK_LIST too big: %d\n",
+ dev_err(chip->card->dev, "CLOCK_LIST too big: %d\n",
chip->clock.items);
return -EINVAL;
}
err = lola_codec_read(chip, nid, LOLA_VERB_GET_CLOCK_LIST,
idx, 0, &val, &res_ex);
if (err < 0) {
- printk(KERN_ERR SFX "Can't read CLOCK_LIST\n");
+ dev_err(chip->card->dev, "Can't read CLOCK_LIST\n");
return -EINVAL;
}
if (err < 0)
return err;
if (res) {
- printk(KERN_WARNING SFX "error in enable_clock_events %d\n",
+ dev_warn(chip->card->dev, "error in enable_clock_events %d\n",
res);
return -EINVAL;
}
if (err < 0)
return err;
if (res) {
- printk(KERN_WARNING SFX "error in set_clock %d\n", res);
+ dev_warn(chip->card->dev, "error in set_clock %d\n", res);
return -EINVAL;
}
return 0;
pin->nid = nid;
err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val);
if (err < 0) {
- printk(KERN_ERR SFX "Can't read wcaps for 0x%x\n", nid);
+ dev_err(chip->card->dev, "Can't read wcaps for 0x%x\n", nid);
return err;
}
val &= 0x00f00fff; /* test TYPE and bits 0..11 */
else if (val == 0x0040000c && dir == PLAY) /* Dig=0, OutAmp/ovrd */
pin->is_analog = true;
else {
- printk(KERN_ERR SFX "Invalid wcaps 0x%x for 0x%x\n", val, nid);
+ dev_err(chip->card->dev, "Invalid wcaps 0x%x for 0x%x\n", val, nid);
return -EINVAL;
}
else
err = lola_read_param(chip, nid, LOLA_PAR_AMP_IN_CAP, &val);
if (err < 0) {
- printk(KERN_ERR SFX "Can't read AMP-caps for 0x%x\n", nid);
+ dev_err(chip->card->dev, "Can't read AMP-caps for 0x%x\n", nid);
return err;
}
err = lola_codec_read(chip, nid, LOLA_VERB_GET_MAX_LEVEL, 0, 0, &val,
NULL);
if (err < 0) {
- printk(KERN_ERR SFX "Can't get MAX_LEVEL 0x%x\n", nid);
+ dev_err(chip->card->dev, "Can't get MAX_LEVEL 0x%x\n", nid);
return err;
}
pin->max_level = val & 0x3ff; /* 10 bits */
err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val);
if (err < 0) {
- printk(KERN_ERR SFX "Can't read wcaps for 0x%x\n", nid);
+ dev_err(chip->card->dev, "Can't read wcaps for 0x%x\n", nid);
return err;
}
if ((val & 0xfff00000) != 0x02f00000) { /* test SubType and Type */
- snd_printdd("No valid mixer widget\n");
+ dev_dbg(chip->card->dev, "No valid mixer widget\n");
return 0;
}
*/
if (chip->mixer.src_stream_out_ofs > MAX_AUDIO_INOUT_COUNT ||
chip->mixer.dest_phys_out_ofs > MAX_STREAM_IN_COUNT) {
- printk(KERN_ERR SFX "Invalid mixer widget size\n");
+ dev_err(chip->card->dev, "Invalid mixer widget size\n");
return -EINVAL;
}
(((1U << chip->mixer.dest_phys_outs) - 1)
<< chip->mixer.dest_phys_out_ofs);
- snd_printdd("Mixer src_mask=%x, dest_mask=%x\n",
+ dev_dbg(chip->card->dev, "Mixer src_mask=%x, dest_mask=%x\n",
chip->mixer.src_mask, chip->mixer.dest_mask);
return 0;
(gain == readw(&chip->mixer.array->src_gain[id])))
return 0;
- snd_printdd("lola_mixer_set_src_gain (id=%d, gain=%d) enable=%x\n",
+ dev_dbg(chip->card->dev,
+ "lola_mixer_set_src_gain (id=%d, gain=%d) enable=%x\n",
id, gain, val);
writew(gain, &chip->mixer.array->src_gain[id]);
writel(val, &chip->mixer.array->src_gain_enable);
return 0;
if (external_call)
lola_codec_flush(chip);
- snd_printdd("set_analog_volume (dir=%d idx=%d, volume=%d)\n",
+ dev_dbg(chip->card->dev,
+ "set_analog_volume (dir=%d idx=%d, volume=%d)\n",
dir, idx, val);
err = lola_codec_write(chip, pin->nid,
LOLA_VERB_SET_AMP_GAIN_MUTE, val, 0);
return;
msleep(1);
}
- printk(KERN_WARNING SFX "SRST not clear (stream %d)\n", str->dsd);
+ dev_warn(chip->card->dev, "SRST not clear (stream %d)\n", str->dsd);
}
static int lola_stream_wait_for_fifo(struct lola *chip,
return 0;
msleep(1);
}
- printk(KERN_WARNING SFX "FIFO not ready (stream %d)\n", str->dsd);
+ dev_warn(chip->card->dev, "FIFO not ready (stream %d)\n", str->dsd);
return -EIO;
}
return 0;
msleep(1);
}
- printk(KERN_WARNING SFX "FIFO not ready (pending %d)\n", pending - 1);
+ dev_warn(chip->card->dev, "FIFO not ready (pending %d)\n", pending - 1);
return -EIO;
}
return 0;
error:
- snd_printk(KERN_ERR SFX "Too many BDL entries: buffer=%d, period=%d\n",
+ dev_err(chip->card->dev, "Too many BDL entries: buffer=%d, period=%d\n",
str->bufsize, period_bytes);
return -EINVAL;
}
err = lola_codec_read(chip, str->nid, LOLA_VERB_SET_STREAM_FORMAT,
str->format_verb, 0, &val, NULL);
if (err < 0) {
- printk(KERN_ERR SFX "Cannot set stream format 0x%x\n",
+ dev_err(chip->card->dev, "Cannot set stream format 0x%x\n",
str->format_verb);
return err;
}
LOLA_VERB_SET_CHANNEL_STREAMID, 0, verb,
&val, NULL);
if (err < 0) {
- printk(KERN_ERR SFX "Cannot set stream channel %d\n", i);
+ dev_err(chip->card->dev,
+ "Cannot set stream channel %d\n", i);
return err;
}
}
str->dsd += MAX_STREAM_IN_COUNT;
err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val);
if (err < 0) {
- printk(KERN_ERR SFX "Can't read wcaps for 0x%x\n", nid);
+ dev_err(chip->card->dev, "Can't read wcaps for 0x%x\n", nid);
return err;
}
if (dir == PLAY) {
/* test TYPE and bits 0..11 (no test bit9 : Digital = 0/1) */
if ((val & 0x00f00dff) != 0x00000010) {
- printk(KERN_ERR SFX "Invalid wcaps 0x%x for 0x%x\n",
+ dev_err(chip->card->dev,
+ "Invalid wcaps 0x%x for 0x%x\n",
val, nid);
return -EINVAL;
}
* (bug : ignore bit8: Conn list = 0/1)
*/
if ((val & 0x00f00cff) != 0x00100010) {
- printk(KERN_ERR SFX "Invalid wcaps 0x%x for 0x%x\n",
+ dev_err(chip->card->dev,
+ "Invalid wcaps 0x%x for 0x%x\n",
val, nid);
return -EINVAL;
}
err = lola_read_param(chip, nid, LOLA_PAR_STREAM_FORMATS, &val);
if (err < 0) {
- printk(KERN_ERR SFX "Can't read FORMATS 0x%x\n", nid);
+ dev_err(chip->card->dev, "Can't read FORMATS 0x%x\n", nid);
return err;
}
val &= 3;
if (val == 3)
str->can_float = true;
if (!(val & 1)) {
- printk(KERN_ERR SFX "Invalid formats 0x%x for 0x%x", val, nid);
+ dev_err(chip->card->dev,
+ "Invalid formats 0x%x for 0x%x", val, nid);
return -EINVAL;
}
return 0;