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

ALSA: hwdep: 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>

+12 -8
+12 -8
sound/core/hwdep.c
··· 375 375 *rhwdep = NULL; 376 376 hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL); 377 377 if (hwdep == NULL) { 378 - snd_printk(KERN_ERR "hwdep: cannot allocate\n"); 378 + dev_err(card->dev, "hwdep: cannot allocate\n"); 379 379 return -ENOMEM; 380 380 } 381 381 hwdep->card = card; ··· 415 415 static int snd_hwdep_dev_register(struct snd_device *device) 416 416 { 417 417 struct snd_hwdep *hwdep = device->device_data; 418 + struct snd_card *card = hwdep->card; 418 419 int err; 419 420 char name[32]; 420 421 421 422 mutex_lock(&register_mutex); 422 - if (snd_hwdep_search(hwdep->card, hwdep->device)) { 423 + if (snd_hwdep_search(card, hwdep->device)) { 423 424 mutex_unlock(&register_mutex); 424 425 return -EBUSY; 425 426 } ··· 429 428 if ((err = snd_register_device(SNDRV_DEVICE_TYPE_HWDEP, 430 429 hwdep->card, hwdep->device, 431 430 &snd_hwdep_f_ops, hwdep, name)) < 0) { 432 - snd_printk(KERN_ERR "unable to register hardware dependent device %i:%i\n", 433 - hwdep->card->number, hwdep->device); 431 + dev_err(card->dev, 432 + "unable to register hardware dependent device %i:%i\n", 433 + card->number, hwdep->device); 434 434 list_del(&hwdep->list); 435 435 mutex_unlock(&register_mutex); 436 436 return err; ··· 440 438 hwdep->ossreg = 0; 441 439 if (hwdep->oss_type >= 0) { 442 440 if ((hwdep->oss_type == SNDRV_OSS_DEVICE_TYPE_DMFM) && (hwdep->device != 0)) { 443 - snd_printk (KERN_WARNING "only hwdep device 0 can be registered as OSS direct FM device!\n"); 441 + dev_warn(card->dev, 442 + "only hwdep device 0 can be registered as OSS direct FM device!\n"); 444 443 } else { 445 444 if (snd_register_oss_device(hwdep->oss_type, 446 - hwdep->card, hwdep->device, 445 + card, hwdep->device, 447 446 &snd_hwdep_f_ops, hwdep) < 0) { 448 - snd_printk(KERN_ERR "unable to register OSS compatibility device %i:%i\n", 449 - hwdep->card->number, hwdep->device); 447 + dev_err(card->dev, 448 + "unable to register OSS compatibility device %i:%i\n", 449 + card->number, hwdep->device); 450 450 } else 451 451 hwdep->ossreg = 1; 452 452 }