diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-02-04 18:21:03 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-14 08:14:15 +0100 |
commit | f2f9307a4f26a9fbe47fff486a9cee5885af748f (patch) | |
tree | 52e3cf57d91763c7f284e654c9d10a4152214656 /sound/core/device.c | |
parent | 09e56df8b37f5e751614a0d140b8bf8250812912 (diff) | |
download | linux-f2f9307a4f26a9fbe47fff486a9cee5885af748f.tar.bz2 |
ALSA: core: 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/device.c')
-rw-r--r-- | sound/core/device.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sound/core/device.c b/sound/core/device.c index df88defed176..ad9869dfa10c 100644 --- a/sound/core/device.c +++ b/sound/core/device.c @@ -50,7 +50,7 @@ int snd_device_new(struct snd_card *card, snd_device_type_t type, return -ENXIO; dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (dev == NULL) { - snd_printk(KERN_ERR "Cannot allocate device\n"); + dev_err(card->dev, "Cannot allocate device, type=%d\n", type); return -ENOMEM; } dev->card = card; @@ -90,17 +90,17 @@ int snd_device_free(struct snd_card *card, void *device_data) if (dev->state == SNDRV_DEV_REGISTERED && dev->ops->dev_disconnect) if (dev->ops->dev_disconnect(dev)) - snd_printk(KERN_ERR - "device disconnect failure\n"); + dev_err(card->dev, + "device disconnect failure\n"); if (dev->ops->dev_free) { if (dev->ops->dev_free(dev)) - snd_printk(KERN_ERR "device free failure\n"); + dev_err(card->dev, "device free failure\n"); } kfree(dev); return 0; } - snd_printd("device free %p (from %pF), not found\n", device_data, - __builtin_return_address(0)); + dev_dbg(card->dev, "device free %p (from %pF), not found\n", + device_data, __builtin_return_address(0)); return -ENXIO; } @@ -131,13 +131,14 @@ int snd_device_disconnect(struct snd_card *card, void *device_data) if (dev->state == SNDRV_DEV_REGISTERED && dev->ops->dev_disconnect) { if (dev->ops->dev_disconnect(dev)) - snd_printk(KERN_ERR "device disconnect failure\n"); + dev_err(card->dev, + "device disconnect failure\n"); dev->state = SNDRV_DEV_DISCONNECTED; } return 0; } - snd_printd("device disconnect %p (from %pF), not found\n", device_data, - __builtin_return_address(0)); + dev_dbg(card->dev, "device disconnect %p (from %pF), not found\n", + device_data, __builtin_return_address(0)); return -ENXIO; } @@ -170,7 +171,7 @@ int snd_device_register(struct snd_card *card, void *device_data) dev->state = SNDRV_DEV_REGISTERED; return 0; } - snd_printd("snd_device_register busy\n"); + dev_dbg(card->dev, "snd_device_register busy\n"); return -EBUSY; } snd_BUG(); |