Commit bb009457 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: control: Use standard printk helpers

Use dev_err() & co as much as possible.  If not available (no device
assigned at the calling point), use pr_xxx() helpers instead.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent a67ca25b
...@@ -170,7 +170,7 @@ void snd_ctl_notify(struct snd_card *card, unsigned int mask, ...@@ -170,7 +170,7 @@ void snd_ctl_notify(struct snd_card *card, unsigned int mask,
ev->mask = mask; ev->mask = mask;
list_add_tail(&ev->list, &ctl->events); list_add_tail(&ev->list, &ctl->events);
} else { } else {
snd_printk(KERN_ERR "No memory available to allocate event\n"); dev_err(card->dev, "No memory available to allocate event\n");
} }
_found: _found:
wake_up(&ctl->change_sleep); wake_up(&ctl->change_sleep);
...@@ -206,7 +206,7 @@ static struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol *control, ...@@ -206,7 +206,7 @@ static struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol *control,
kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL); kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL);
if (kctl == NULL) { if (kctl == NULL) {
snd_printk(KERN_ERR "Cannot allocate control instance\n"); pr_err("ALSA: Cannot allocate control instance\n");
return NULL; return NULL;
} }
*kctl = *control; *kctl = *control;
...@@ -241,8 +241,7 @@ struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new *ncontrol, ...@@ -241,8 +241,7 @@ struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new *ncontrol,
if (ncontrol->name) { if (ncontrol->name) {
strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name)); strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name));
if (strcmp(ncontrol->name, kctl.id.name) != 0) if (strcmp(ncontrol->name, kctl.id.name) != 0)
snd_printk(KERN_WARNING pr_warn("ALSA: Control name '%s' truncated to '%s'\n",
"Control name '%s' truncated to '%s'\n",
ncontrol->name, kctl.id.name); ncontrol->name, kctl.id.name);
} }
kctl.id.index = ncontrol->index; kctl.id.index = ncontrol->index;
...@@ -306,7 +305,7 @@ static int snd_ctl_find_hole(struct snd_card *card, unsigned int count) ...@@ -306,7 +305,7 @@ static int snd_ctl_find_hole(struct snd_card *card, unsigned int count)
while (snd_ctl_remove_numid_conflict(card, count)) { while (snd_ctl_remove_numid_conflict(card, count)) {
if (--iter == 0) { if (--iter == 0) {
/* this situation is very unlikely */ /* this situation is very unlikely */
snd_printk(KERN_ERR "unable to allocate new control numid\n"); dev_err(card->dev, "unable to allocate new control numid\n");
return -ENOMEM; return -ENOMEM;
} }
} }
...@@ -341,7 +340,7 @@ int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) ...@@ -341,7 +340,7 @@ int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol)
down_write(&card->controls_rwsem); down_write(&card->controls_rwsem);
if (snd_ctl_find_id(card, &id)) { if (snd_ctl_find_id(card, &id)) {
up_write(&card->controls_rwsem); up_write(&card->controls_rwsem);
snd_printd(KERN_ERR "control %i:%i:%i:%s:%i is already present\n", dev_err(card->dev, "control %i:%i:%i:%s:%i is already present\n",
id.iface, id.iface,
id.device, id.device,
id.subdevice, id.subdevice,
...@@ -1406,7 +1405,7 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg ...@@ -1406,7 +1405,7 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg
} }
} }
up_read(&snd_ioctl_rwsem); up_read(&snd_ioctl_rwsem);
snd_printdd("unknown ioctl = 0x%x\n", cmd); dev_dbg(card->dev, "unknown ioctl = 0x%x\n", cmd);
return -ENOTTY; return -ENOTTY;
} }
......
...@@ -247,7 +247,7 @@ static int copy_ctl_value_from_user(struct snd_card *card, ...@@ -247,7 +247,7 @@ static int copy_ctl_value_from_user(struct snd_card *card,
} else { } else {
size = get_elem_size(type, count); size = get_elem_size(type, count);
if (size < 0) { if (size < 0) {
printk(KERN_ERR "snd_ioctl32_ctl_elem_value: unknown type %d\n", type); dev_err(card->dev, "snd_ioctl32_ctl_elem_value: unknown type %d\n", type);
return -EINVAL; return -EINVAL;
} }
if (copy_from_user(data->value.bytes.data, if (copy_from_user(data->value.bytes.data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment