diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-02-04 12:21:54 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-14 02:14:16 -0500 |
commit | 2ebef69fc5a69ff8ef04922020d8ceeb4f6c8fbb (patch) | |
tree | 604b14564c62ca94c0b4717914a468344f3ac067 /sound/core | |
parent | ca20d29275b90986e43de58ac6c218e826a4f985 (diff) |
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>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/hwdep.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index 0f73f6951110..8c778659fa03 100644 --- a/sound/core/hwdep.c +++ b/sound/core/hwdep.c | |||
@@ -375,7 +375,7 @@ int snd_hwdep_new(struct snd_card *card, char *id, int device, | |||
375 | *rhwdep = NULL; | 375 | *rhwdep = NULL; |
376 | hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL); | 376 | hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL); |
377 | if (hwdep == NULL) { | 377 | if (hwdep == NULL) { |
378 | snd_printk(KERN_ERR "hwdep: cannot allocate\n"); | 378 | dev_err(card->dev, "hwdep: cannot allocate\n"); |
379 | return -ENOMEM; | 379 | return -ENOMEM; |
380 | } | 380 | } |
381 | hwdep->card = card; | 381 | hwdep->card = card; |
@@ -415,11 +415,12 @@ static int snd_hwdep_dev_free(struct snd_device *device) | |||
415 | static int snd_hwdep_dev_register(struct snd_device *device) | 415 | static int snd_hwdep_dev_register(struct snd_device *device) |
416 | { | 416 | { |
417 | struct snd_hwdep *hwdep = device->device_data; | 417 | struct snd_hwdep *hwdep = device->device_data; |
418 | struct snd_card *card = hwdep->card; | ||
418 | int err; | 419 | int err; |
419 | char name[32]; | 420 | char name[32]; |
420 | 421 | ||
421 | mutex_lock(®ister_mutex); | 422 | mutex_lock(®ister_mutex); |
422 | if (snd_hwdep_search(hwdep->card, hwdep->device)) { | 423 | if (snd_hwdep_search(card, hwdep->device)) { |
423 | mutex_unlock(®ister_mutex); | 424 | mutex_unlock(®ister_mutex); |
424 | return -EBUSY; | 425 | return -EBUSY; |
425 | } | 426 | } |
@@ -428,8 +429,9 @@ static int snd_hwdep_dev_register(struct snd_device *device) | |||
428 | if ((err = snd_register_device(SNDRV_DEVICE_TYPE_HWDEP, | 429 | if ((err = snd_register_device(SNDRV_DEVICE_TYPE_HWDEP, |
429 | hwdep->card, hwdep->device, | 430 | hwdep->card, hwdep->device, |
430 | &snd_hwdep_f_ops, hwdep, name)) < 0) { | 431 | &snd_hwdep_f_ops, hwdep, name)) < 0) { |
431 | snd_printk(KERN_ERR "unable to register hardware dependent device %i:%i\n", | 432 | dev_err(card->dev, |
432 | hwdep->card->number, hwdep->device); | 433 | "unable to register hardware dependent device %i:%i\n", |
434 | card->number, hwdep->device); | ||
433 | list_del(&hwdep->list); | 435 | list_del(&hwdep->list); |
434 | mutex_unlock(®ister_mutex); | 436 | mutex_unlock(®ister_mutex); |
435 | return err; | 437 | return err; |
@@ -438,13 +440,15 @@ static int snd_hwdep_dev_register(struct snd_device *device) | |||
438 | hwdep->ossreg = 0; | 440 | hwdep->ossreg = 0; |
439 | if (hwdep->oss_type >= 0) { | 441 | if (hwdep->oss_type >= 0) { |
440 | if ((hwdep->oss_type == SNDRV_OSS_DEVICE_TYPE_DMFM) && (hwdep->device != 0)) { | 442 | if ((hwdep->oss_type == SNDRV_OSS_DEVICE_TYPE_DMFM) && (hwdep->device != 0)) { |
441 | snd_printk (KERN_WARNING "only hwdep device 0 can be registered as OSS direct FM device!\n"); | 443 | dev_warn(card->dev, |
444 | "only hwdep device 0 can be registered as OSS direct FM device!\n"); | ||
442 | } else { | 445 | } else { |
443 | if (snd_register_oss_device(hwdep->oss_type, | 446 | if (snd_register_oss_device(hwdep->oss_type, |
444 | hwdep->card, hwdep->device, | 447 | card, hwdep->device, |
445 | &snd_hwdep_f_ops, hwdep) < 0) { | 448 | &snd_hwdep_f_ops, hwdep) < 0) { |
446 | snd_printk(KERN_ERR "unable to register OSS compatibility device %i:%i\n", | 449 | dev_err(card->dev, |
447 | hwdep->card->number, hwdep->device); | 450 | "unable to register OSS compatibility device %i:%i\n", |
451 | card->number, hwdep->device); | ||
448 | } else | 452 | } else |
449 | hwdep->ossreg = 1; | 453 | hwdep->ossreg = 1; |
450 | } | 454 | } |