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

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: Takashi Iwai <tiwai@suse.de>

+8 -9
+7 -8
sound/core/control.c
··· 170 170 ev->mask = mask; 171 171 list_add_tail(&ev->list, &ctl->events); 172 172 } else { 173 - snd_printk(KERN_ERR "No memory available to allocate event\n"); 173 + dev_err(card->dev, "No memory available to allocate event\n"); 174 174 } 175 175 _found: 176 176 wake_up(&ctl->change_sleep); ··· 206 206 207 207 kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL); 208 208 if (kctl == NULL) { 209 - snd_printk(KERN_ERR "Cannot allocate control instance\n"); 209 + pr_err("ALSA: Cannot allocate control instance\n"); 210 210 return NULL; 211 211 } 212 212 *kctl = *control; ··· 241 241 if (ncontrol->name) { 242 242 strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name)); 243 243 if (strcmp(ncontrol->name, kctl.id.name) != 0) 244 - snd_printk(KERN_WARNING 245 - "Control name '%s' truncated to '%s'\n", 246 - ncontrol->name, kctl.id.name); 244 + pr_warn("ALSA: Control name '%s' truncated to '%s'\n", 245 + ncontrol->name, kctl.id.name); 247 246 } 248 247 kctl.id.index = ncontrol->index; 249 248 kctl.count = ncontrol->count ? ncontrol->count : 1; ··· 305 306 while (snd_ctl_remove_numid_conflict(card, count)) { 306 307 if (--iter == 0) { 307 308 /* this situation is very unlikely */ 308 - snd_printk(KERN_ERR "unable to allocate new control numid\n"); 309 + dev_err(card->dev, "unable to allocate new control numid\n"); 309 310 return -ENOMEM; 310 311 } 311 312 } ··· 340 341 down_write(&card->controls_rwsem); 341 342 if (snd_ctl_find_id(card, &id)) { 342 343 up_write(&card->controls_rwsem); 343 - snd_printd(KERN_ERR "control %i:%i:%i:%s:%i is already present\n", 344 + dev_err(card->dev, "control %i:%i:%i:%s:%i is already present\n", 344 345 id.iface, 345 346 id.device, 346 347 id.subdevice, ··· 1405 1406 } 1406 1407 } 1407 1408 up_read(&snd_ioctl_rwsem); 1408 - snd_printdd("unknown ioctl = 0x%x\n", cmd); 1409 + dev_dbg(card->dev, "unknown ioctl = 0x%x\n", cmd); 1409 1410 return -ENOTTY; 1410 1411 } 1411 1412
+1 -1
sound/core/control_compat.c
··· 247 247 } else { 248 248 size = get_elem_size(type, count); 249 249 if (size < 0) { 250 - printk(KERN_ERR "snd_ioctl32_ctl_elem_value: unknown type %d\n", type); 250 + dev_err(card->dev, "snd_ioctl32_ctl_elem_value: unknown type %d\n", type); 251 251 return -EINVAL; 252 252 } 253 253 if (copy_from_user(data->value.bytes.data,