aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/device.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-02-04 12:21:03 -0500
committerTakashi Iwai <tiwai@suse.de>2014-02-14 02:14:15 -0500
commitf2f9307a4f26a9fbe47fff486a9cee5885af748f (patch)
tree52e3cf57d91763c7f284e654c9d10a4152214656 /sound/core/device.c
parent09e56df8b37f5e751614a0d140b8bf8250812912 (diff)
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.c21
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,
50 return -ENXIO; 50 return -ENXIO;
51 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 51 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
52 if (dev == NULL) { 52 if (dev == NULL) {
53 snd_printk(KERN_ERR "Cannot allocate device\n"); 53 dev_err(card->dev, "Cannot allocate device, type=%d\n", type);
54 return -ENOMEM; 54 return -ENOMEM;
55 } 55 }
56 dev->card = card; 56 dev->card = card;
@@ -90,17 +90,17 @@ int snd_device_free(struct snd_card *card, void *device_data)
90 if (dev->state == SNDRV_DEV_REGISTERED && 90 if (dev->state == SNDRV_DEV_REGISTERED &&
91 dev->ops->dev_disconnect) 91 dev->ops->dev_disconnect)
92 if (dev->ops->dev_disconnect(dev)) 92 if (dev->ops->dev_disconnect(dev))
93 snd_printk(KERN_ERR 93 dev_err(card->dev,
94 "device disconnect failure\n"); 94 "device disconnect failure\n");
95 if (dev->ops->dev_free) { 95 if (dev->ops->dev_free) {
96 if (dev->ops->dev_free(dev)) 96 if (dev->ops->dev_free(dev))
97 snd_printk(KERN_ERR "device free failure\n"); 97 dev_err(card->dev, "device free failure\n");
98 } 98 }
99 kfree(dev); 99 kfree(dev);
100 return 0; 100 return 0;
101 } 101 }
102 snd_printd("device free %p (from %pF), not found\n", device_data, 102 dev_dbg(card->dev, "device free %p (from %pF), not found\n",
103 __builtin_return_address(0)); 103 device_data, __builtin_return_address(0));
104 return -ENXIO; 104 return -ENXIO;
105} 105}
106 106
@@ -131,13 +131,14 @@ int snd_device_disconnect(struct snd_card *card, void *device_data)
131 if (dev->state == SNDRV_DEV_REGISTERED && 131 if (dev->state == SNDRV_DEV_REGISTERED &&
132 dev->ops->dev_disconnect) { 132 dev->ops->dev_disconnect) {
133 if (dev->ops->dev_disconnect(dev)) 133 if (dev->ops->dev_disconnect(dev))
134 snd_printk(KERN_ERR "device disconnect failure\n"); 134 dev_err(card->dev,
135 "device disconnect failure\n");
135 dev->state = SNDRV_DEV_DISCONNECTED; 136 dev->state = SNDRV_DEV_DISCONNECTED;
136 } 137 }
137 return 0; 138 return 0;
138 } 139 }
139 snd_printd("device disconnect %p (from %pF), not found\n", device_data, 140 dev_dbg(card->dev, "device disconnect %p (from %pF), not found\n",
140 __builtin_return_address(0)); 141 device_data, __builtin_return_address(0));
141 return -ENXIO; 142 return -ENXIO;
142} 143}
143 144
@@ -170,7 +171,7 @@ int snd_device_register(struct snd_card *card, void *device_data)
170 dev->state = SNDRV_DEV_REGISTERED; 171 dev->state = SNDRV_DEV_REGISTERED;
171 return 0; 172 return 0;
172 } 173 }
173 snd_printd("snd_device_register busy\n"); 174 dev_dbg(card->dev, "snd_device_register busy\n");
174 return -EBUSY; 175 return -EBUSY;
175 } 176 }
176 snd_BUG(); 177 snd_BUG();