diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-02-26 09:51:04 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-26 11:22:09 -0500 |
commit | e3b3757b92a4df4addff74e179438afbfd8bb643 (patch) | |
tree | 38497244675921f9a90b08d40839f35d8c02921f /sound/usb | |
parent | 0ba41d917eeb87f608cf147f870ff2f4c1056bab (diff) |
ALSA: 6fire: Use standard printk helpers
Convert with dev_err() and co from snd_printk(), etc.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/6fire/chip.c | 8 | ||||
-rw-r--r-- | sound/usb/6fire/comm.c | 4 | ||||
-rw-r--r-- | sound/usb/6fire/control.c | 18 | ||||
-rw-r--r-- | sound/usb/6fire/firmware.c | 70 | ||||
-rw-r--r-- | sound/usb/6fire/midi.c | 12 | ||||
-rw-r--r-- | sound/usb/6fire/pcm.c | 46 |
6 files changed, 86 insertions, 72 deletions
diff --git a/sound/usb/6fire/chip.c b/sound/usb/6fire/chip.c index e0fe0d92db8c..dcddfc354ba6 100644 --- a/sound/usb/6fire/chip.c +++ b/sound/usb/6fire/chip.c | |||
@@ -106,7 +106,7 @@ static int usb6fire_chip_probe(struct usb_interface *intf, | |||
106 | } | 106 | } |
107 | if (regidx < 0) { | 107 | if (regidx < 0) { |
108 | mutex_unlock(®ister_mutex); | 108 | mutex_unlock(®ister_mutex); |
109 | snd_printk(KERN_ERR PREFIX "too many cards registered.\n"); | 109 | dev_err(&intf->dev, "too many cards registered.\n"); |
110 | return -ENODEV; | 110 | return -ENODEV; |
111 | } | 111 | } |
112 | devices[regidx] = device; | 112 | devices[regidx] = device; |
@@ -121,13 +121,13 @@ static int usb6fire_chip_probe(struct usb_interface *intf, | |||
121 | 121 | ||
122 | /* if we are here, card can be registered in alsa. */ | 122 | /* if we are here, card can be registered in alsa. */ |
123 | if (usb_set_interface(device, 0, 0) != 0) { | 123 | if (usb_set_interface(device, 0, 0) != 0) { |
124 | snd_printk(KERN_ERR PREFIX "can't set first interface.\n"); | 124 | dev_err(&intf->dev, "can't set first interface.\n"); |
125 | return -EIO; | 125 | return -EIO; |
126 | } | 126 | } |
127 | ret = snd_card_new(&intf->dev, index[regidx], id[regidx], | 127 | ret = snd_card_new(&intf->dev, index[regidx], id[regidx], |
128 | THIS_MODULE, sizeof(struct sfire_chip), &card); | 128 | THIS_MODULE, sizeof(struct sfire_chip), &card); |
129 | if (ret < 0) { | 129 | if (ret < 0) { |
130 | snd_printk(KERN_ERR PREFIX "cannot create alsa card.\n"); | 130 | dev_err(&intf->dev, "cannot create alsa card.\n"); |
131 | return ret; | 131 | return ret; |
132 | } | 132 | } |
133 | strcpy(card->driver, "6FireUSB"); | 133 | strcpy(card->driver, "6FireUSB"); |
@@ -168,7 +168,7 @@ static int usb6fire_chip_probe(struct usb_interface *intf, | |||
168 | 168 | ||
169 | ret = snd_card_register(card); | 169 | ret = snd_card_register(card); |
170 | if (ret < 0) { | 170 | if (ret < 0) { |
171 | snd_printk(KERN_ERR PREFIX "cannot register card."); | 171 | dev_err(&intf->dev, "cannot register card."); |
172 | usb6fire_chip_destroy(chip); | 172 | usb6fire_chip_destroy(chip); |
173 | return ret; | 173 | return ret; |
174 | } | 174 | } |
diff --git a/sound/usb/6fire/comm.c b/sound/usb/6fire/comm.c index 23452ee617e1..161215d78d95 100644 --- a/sound/usb/6fire/comm.c +++ b/sound/usb/6fire/comm.c | |||
@@ -51,7 +51,7 @@ static void usb6fire_comm_receiver_handler(struct urb *urb) | |||
51 | urb->status = 0; | 51 | urb->status = 0; |
52 | urb->actual_length = 0; | 52 | urb->actual_length = 0; |
53 | if (usb_submit_urb(urb, GFP_ATOMIC) < 0) | 53 | if (usb_submit_urb(urb, GFP_ATOMIC) < 0) |
54 | snd_printk(KERN_WARNING PREFIX | 54 | dev_warn(&urb->dev->dev, |
55 | "comm data receiver aborted.\n"); | 55 | "comm data receiver aborted.\n"); |
56 | } | 56 | } |
57 | } | 57 | } |
@@ -179,7 +179,7 @@ int usb6fire_comm_init(struct sfire_chip *chip) | |||
179 | if (ret < 0) { | 179 | if (ret < 0) { |
180 | kfree(rt->receiver_buffer); | 180 | kfree(rt->receiver_buffer); |
181 | kfree(rt); | 181 | kfree(rt); |
182 | snd_printk(KERN_ERR PREFIX "cannot create comm data receiver."); | 182 | dev_err(&chip->dev->dev, "cannot create comm data receiver."); |
183 | return ret; | 183 | return ret; |
184 | } | 184 | } |
185 | chip->comm = rt; | 185 | chip->comm = rt; |
diff --git a/sound/usb/6fire/control.c b/sound/usb/6fire/control.c index f6434c245720..184e3987ac24 100644 --- a/sound/usb/6fire/control.c +++ b/sound/usb/6fire/control.c | |||
@@ -194,7 +194,8 @@ static int usb6fire_control_output_vol_put(struct snd_kcontrol *kcontrol, | |||
194 | int changed = 0; | 194 | int changed = 0; |
195 | 195 | ||
196 | if (ch > 4) { | 196 | if (ch > 4) { |
197 | snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); | 197 | dev_err(&rt->chip->dev->dev, |
198 | "Invalid channel in volume control."); | ||
198 | return -EINVAL; | 199 | return -EINVAL; |
199 | } | 200 | } |
200 | 201 | ||
@@ -222,7 +223,8 @@ static int usb6fire_control_output_vol_get(struct snd_kcontrol *kcontrol, | |||
222 | unsigned int ch = kcontrol->private_value; | 223 | unsigned int ch = kcontrol->private_value; |
223 | 224 | ||
224 | if (ch > 4) { | 225 | if (ch > 4) { |
225 | snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); | 226 | dev_err(&rt->chip->dev->dev, |
227 | "Invalid channel in volume control."); | ||
226 | return -EINVAL; | 228 | return -EINVAL; |
227 | } | 229 | } |
228 | 230 | ||
@@ -240,7 +242,8 @@ static int usb6fire_control_output_mute_put(struct snd_kcontrol *kcontrol, | |||
240 | u8 value = 0; | 242 | u8 value = 0; |
241 | 243 | ||
242 | if (ch > 4) { | 244 | if (ch > 4) { |
243 | snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); | 245 | dev_err(&rt->chip->dev->dev, |
246 | "Invalid channel in volume control."); | ||
244 | return -EINVAL; | 247 | return -EINVAL; |
245 | } | 248 | } |
246 | 249 | ||
@@ -265,7 +268,8 @@ static int usb6fire_control_output_mute_get(struct snd_kcontrol *kcontrol, | |||
265 | u8 value = rt->output_mute >> ch; | 268 | u8 value = rt->output_mute >> ch; |
266 | 269 | ||
267 | if (ch > 4) { | 270 | if (ch > 4) { |
268 | snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); | 271 | dev_err(&rt->chip->dev->dev, |
272 | "Invalid channel in volume control."); | ||
269 | return -EINVAL; | 273 | return -EINVAL; |
270 | } | 274 | } |
271 | 275 | ||
@@ -594,14 +598,14 @@ int usb6fire_control_init(struct sfire_chip *chip) | |||
594 | ret = usb6fire_control_add_virtual(rt, chip->card, | 598 | ret = usb6fire_control_add_virtual(rt, chip->card, |
595 | "Master Playback Volume", vol_elements); | 599 | "Master Playback Volume", vol_elements); |
596 | if (ret) { | 600 | if (ret) { |
597 | snd_printk(KERN_ERR PREFIX "cannot add control.\n"); | 601 | dev_err(&chip->dev->dev, "cannot add control.\n"); |
598 | kfree(rt); | 602 | kfree(rt); |
599 | return ret; | 603 | return ret; |
600 | } | 604 | } |
601 | ret = usb6fire_control_add_virtual(rt, chip->card, | 605 | ret = usb6fire_control_add_virtual(rt, chip->card, |
602 | "Master Playback Switch", mute_elements); | 606 | "Master Playback Switch", mute_elements); |
603 | if (ret) { | 607 | if (ret) { |
604 | snd_printk(KERN_ERR PREFIX "cannot add control.\n"); | 608 | dev_err(&chip->dev->dev, "cannot add control.\n"); |
605 | kfree(rt); | 609 | kfree(rt); |
606 | return ret; | 610 | return ret; |
607 | } | 611 | } |
@@ -611,7 +615,7 @@ int usb6fire_control_init(struct sfire_chip *chip) | |||
611 | ret = snd_ctl_add(chip->card, snd_ctl_new1(&elements[i], rt)); | 615 | ret = snd_ctl_add(chip->card, snd_ctl_new1(&elements[i], rt)); |
612 | if (ret < 0) { | 616 | if (ret < 0) { |
613 | kfree(rt); | 617 | kfree(rt); |
614 | snd_printk(KERN_ERR PREFIX "cannot add control.\n"); | 618 | dev_err(&chip->dev->dev, "cannot add control.\n"); |
615 | return ret; | 619 | return ret; |
616 | } | 620 | } |
617 | i++; | 621 | i++; |
diff --git a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c index 780bf3f62d28..3b02e54b8f6d 100644 --- a/sound/usb/6fire/firmware.c +++ b/sound/usb/6fire/firmware.c | |||
@@ -219,16 +219,16 @@ static int usb6fire_fw_ezusb_upload( | |||
219 | ret = request_firmware(&fw, fwname, &device->dev); | 219 | ret = request_firmware(&fw, fwname, &device->dev); |
220 | if (ret < 0) { | 220 | if (ret < 0) { |
221 | kfree(rec); | 221 | kfree(rec); |
222 | snd_printk(KERN_ERR PREFIX "error requesting ezusb " | 222 | dev_err(&intf->dev, |
223 | "firmware %s.\n", fwname); | 223 | "error requesting ezusb firmware %s.\n", fwname); |
224 | return ret; | 224 | return ret; |
225 | } | 225 | } |
226 | ret = usb6fire_fw_ihex_init(fw, rec); | 226 | ret = usb6fire_fw_ihex_init(fw, rec); |
227 | if (ret < 0) { | 227 | if (ret < 0) { |
228 | kfree(rec); | 228 | kfree(rec); |
229 | release_firmware(fw); | 229 | release_firmware(fw); |
230 | snd_printk(KERN_ERR PREFIX "error validating ezusb " | 230 | dev_err(&intf->dev, |
231 | "firmware %s.\n", fwname); | 231 | "error validating ezusb firmware %s.\n", fwname); |
232 | return ret; | 232 | return ret; |
233 | } | 233 | } |
234 | /* upload firmware image */ | 234 | /* upload firmware image */ |
@@ -237,8 +237,9 @@ static int usb6fire_fw_ezusb_upload( | |||
237 | if (ret < 0) { | 237 | if (ret < 0) { |
238 | kfree(rec); | 238 | kfree(rec); |
239 | release_firmware(fw); | 239 | release_firmware(fw); |
240 | snd_printk(KERN_ERR PREFIX "unable to upload ezusb " | 240 | dev_err(&intf->dev, |
241 | "firmware %s: begin message.\n", fwname); | 241 | "unable to upload ezusb firmware %s: begin message.\n", |
242 | fwname); | ||
242 | return ret; | 243 | return ret; |
243 | } | 244 | } |
244 | 245 | ||
@@ -248,8 +249,9 @@ static int usb6fire_fw_ezusb_upload( | |||
248 | if (ret < 0) { | 249 | if (ret < 0) { |
249 | kfree(rec); | 250 | kfree(rec); |
250 | release_firmware(fw); | 251 | release_firmware(fw); |
251 | snd_printk(KERN_ERR PREFIX "unable to upload ezusb " | 252 | dev_err(&intf->dev, |
252 | "firmware %s: data urb.\n", fwname); | 253 | "unable to upload ezusb firmware %s: data urb.\n", |
254 | fwname); | ||
253 | return ret; | 255 | return ret; |
254 | } | 256 | } |
255 | } | 257 | } |
@@ -260,8 +262,9 @@ static int usb6fire_fw_ezusb_upload( | |||
260 | ret = usb6fire_fw_ezusb_write(device, 0xa0, postaddr, | 262 | ret = usb6fire_fw_ezusb_write(device, 0xa0, postaddr, |
261 | postdata, postlen); | 263 | postdata, postlen); |
262 | if (ret < 0) { | 264 | if (ret < 0) { |
263 | snd_printk(KERN_ERR PREFIX "unable to upload ezusb " | 265 | dev_err(&intf->dev, |
264 | "firmware %s: post urb.\n", fwname); | 266 | "unable to upload ezusb firmware %s: post urb.\n", |
267 | fwname); | ||
265 | return ret; | 268 | return ret; |
266 | } | 269 | } |
267 | } | 270 | } |
@@ -269,8 +272,9 @@ static int usb6fire_fw_ezusb_upload( | |||
269 | data = 0x00; /* resume ezusb cpu */ | 272 | data = 0x00; /* resume ezusb cpu */ |
270 | ret = usb6fire_fw_ezusb_write(device, 0xa0, 0xe600, &data, 1); | 273 | ret = usb6fire_fw_ezusb_write(device, 0xa0, 0xe600, &data, 1); |
271 | if (ret < 0) { | 274 | if (ret < 0) { |
272 | snd_printk(KERN_ERR PREFIX "unable to upload ezusb " | 275 | dev_err(&intf->dev, |
273 | "firmware %s: end message.\n", fwname); | 276 | "unable to upload ezusb firmware %s: end message.\n", |
277 | fwname); | ||
274 | return ret; | 278 | return ret; |
275 | } | 279 | } |
276 | return 0; | 280 | return 0; |
@@ -292,7 +296,7 @@ static int usb6fire_fw_fpga_upload( | |||
292 | 296 | ||
293 | ret = request_firmware(&fw, fwname, &device->dev); | 297 | ret = request_firmware(&fw, fwname, &device->dev); |
294 | if (ret < 0) { | 298 | if (ret < 0) { |
295 | snd_printk(KERN_ERR PREFIX "unable to get fpga firmware %s.\n", | 299 | dev_err(&intf->dev, "unable to get fpga firmware %s.\n", |
296 | fwname); | 300 | fwname); |
297 | kfree(buffer); | 301 | kfree(buffer); |
298 | return -EIO; | 302 | return -EIO; |
@@ -305,8 +309,8 @@ static int usb6fire_fw_fpga_upload( | |||
305 | if (ret < 0) { | 309 | if (ret < 0) { |
306 | kfree(buffer); | 310 | kfree(buffer); |
307 | release_firmware(fw); | 311 | release_firmware(fw); |
308 | snd_printk(KERN_ERR PREFIX "unable to upload fpga firmware: " | 312 | dev_err(&intf->dev, |
309 | "begin urb.\n"); | 313 | "unable to upload fpga firmware: begin urb.\n"); |
310 | return ret; | 314 | return ret; |
311 | } | 315 | } |
312 | 316 | ||
@@ -318,8 +322,8 @@ static int usb6fire_fw_fpga_upload( | |||
318 | if (ret < 0) { | 322 | if (ret < 0) { |
319 | release_firmware(fw); | 323 | release_firmware(fw); |
320 | kfree(buffer); | 324 | kfree(buffer); |
321 | snd_printk(KERN_ERR PREFIX "unable to upload fpga " | 325 | dev_err(&intf->dev, |
322 | "firmware: fw urb.\n"); | 326 | "unable to upload fpga firmware: fw urb.\n"); |
323 | return ret; | 327 | return ret; |
324 | } | 328 | } |
325 | } | 329 | } |
@@ -328,8 +332,8 @@ static int usb6fire_fw_fpga_upload( | |||
328 | 332 | ||
329 | ret = usb6fire_fw_ezusb_write(device, 9, 0, NULL, 0); | 333 | ret = usb6fire_fw_ezusb_write(device, 9, 0, NULL, 0); |
330 | if (ret < 0) { | 334 | if (ret < 0) { |
331 | snd_printk(KERN_ERR PREFIX "unable to upload fpga firmware: " | 335 | dev_err(&intf->dev, |
332 | "end urb.\n"); | 336 | "unable to upload fpga firmware: end urb.\n"); |
333 | return ret; | 337 | return ret; |
334 | } | 338 | } |
335 | return 0; | 339 | return 0; |
@@ -338,7 +342,7 @@ static int usb6fire_fw_fpga_upload( | |||
338 | /* check, if the firmware version the devices has currently loaded | 342 | /* check, if the firmware version the devices has currently loaded |
339 | * is known by this driver. 'version' needs to have 4 bytes version | 343 | * is known by this driver. 'version' needs to have 4 bytes version |
340 | * info data. */ | 344 | * info data. */ |
341 | static int usb6fire_fw_check(u8 *version) | 345 | static int usb6fire_fw_check(struct usb_interface *intf, const u8 *version) |
342 | { | 346 | { |
343 | int i; | 347 | int i; |
344 | 348 | ||
@@ -346,7 +350,7 @@ static int usb6fire_fw_check(u8 *version) | |||
346 | if (!memcmp(version, known_fw_versions + i, 2)) | 350 | if (!memcmp(version, known_fw_versions + i, 2)) |
347 | return 0; | 351 | return 0; |
348 | 352 | ||
349 | snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %4ph. " | 353 | dev_err(&intf->dev, "invalid fimware version in device: %4ph. " |
350 | "please reconnect to power. if this failure " | 354 | "please reconnect to power. if this failure " |
351 | "still happens, check your firmware installation.", | 355 | "still happens, check your firmware installation.", |
352 | version); | 356 | version); |
@@ -364,16 +368,16 @@ int usb6fire_fw_init(struct usb_interface *intf) | |||
364 | 368 | ||
365 | ret = usb6fire_fw_ezusb_read(device, 1, 0, buffer, 8); | 369 | ret = usb6fire_fw_ezusb_read(device, 1, 0, buffer, 8); |
366 | if (ret < 0) { | 370 | if (ret < 0) { |
367 | snd_printk(KERN_ERR PREFIX "unable to receive device " | 371 | dev_err(&intf->dev, |
368 | "firmware state.\n"); | 372 | "unable to receive device firmware state.\n"); |
369 | return ret; | 373 | return ret; |
370 | } | 374 | } |
371 | if (buffer[0] != 0xeb || buffer[1] != 0xaa || buffer[2] != 0x55) { | 375 | if (buffer[0] != 0xeb || buffer[1] != 0xaa || buffer[2] != 0x55) { |
372 | snd_printk(KERN_ERR PREFIX "unknown device firmware state " | 376 | dev_err(&intf->dev, |
373 | "received from device: "); | 377 | "unknown device firmware state received from device:"); |
374 | for (i = 0; i < 8; i++) | 378 | for (i = 0; i < 8; i++) |
375 | snd_printk("%02x ", buffer[i]); | 379 | printk(KERN_CONT "%02x ", buffer[i]); |
376 | snd_printk("\n"); | 380 | printk(KERN_CONT "\n"); |
377 | return -EIO; | 381 | return -EIO; |
378 | } | 382 | } |
379 | /* do we need fpga loader ezusb firmware? */ | 383 | /* do we need fpga loader ezusb firmware? */ |
@@ -386,7 +390,7 @@ int usb6fire_fw_init(struct usb_interface *intf) | |||
386 | } | 390 | } |
387 | /* do we need fpga firmware and application ezusb firmware? */ | 391 | /* do we need fpga firmware and application ezusb firmware? */ |
388 | else if (buffer[3] == 0x02) { | 392 | else if (buffer[3] == 0x02) { |
389 | ret = usb6fire_fw_check(buffer + 4); | 393 | ret = usb6fire_fw_check(intf, buffer + 4); |
390 | if (ret < 0) | 394 | if (ret < 0) |
391 | return ret; | 395 | return ret; |
392 | ret = usb6fire_fw_fpga_upload(intf, "6fire/dmx6firecf.bin"); | 396 | ret = usb6fire_fw_fpga_upload(intf, "6fire/dmx6firecf.bin"); |
@@ -402,14 +406,14 @@ int usb6fire_fw_init(struct usb_interface *intf) | |||
402 | } | 406 | } |
403 | /* all fw loaded? */ | 407 | /* all fw loaded? */ |
404 | else if (buffer[3] == 0x03) | 408 | else if (buffer[3] == 0x03) |
405 | return usb6fire_fw_check(buffer + 4); | 409 | return usb6fire_fw_check(intf, buffer + 4); |
406 | /* unknown data? */ | 410 | /* unknown data? */ |
407 | else { | 411 | else { |
408 | snd_printk(KERN_ERR PREFIX "unknown device firmware state " | 412 | dev_err(&intf->dev, |
409 | "received from device: "); | 413 | "unknown device firmware state received from device: "); |
410 | for (i = 0; i < 8; i++) | 414 | for (i = 0; i < 8; i++) |
411 | snd_printk("%02x ", buffer[i]); | 415 | printk(KERN_CONT "%02x ", buffer[i]); |
412 | snd_printk("\n"); | 416 | printk(KERN_CONT "\n"); |
413 | return -EIO; | 417 | return -EIO; |
414 | } | 418 | } |
415 | return 0; | 419 | return 0; |
diff --git a/sound/usb/6fire/midi.c b/sound/usb/6fire/midi.c index f3dd7266c391..3d410969553e 100644 --- a/sound/usb/6fire/midi.c +++ b/sound/usb/6fire/midi.c | |||
@@ -41,8 +41,9 @@ static void usb6fire_midi_out_handler(struct urb *urb) | |||
41 | 41 | ||
42 | ret = usb_submit_urb(urb, GFP_ATOMIC); | 42 | ret = usb_submit_urb(urb, GFP_ATOMIC); |
43 | if (ret < 0) | 43 | if (ret < 0) |
44 | snd_printk(KERN_ERR PREFIX "midi out urb " | 44 | dev_err(&urb->dev->dev, |
45 | "submit failed: %d\n", ret); | 45 | "midi out urb submit failed: %d\n", |
46 | ret); | ||
46 | } else /* no more data to transmit */ | 47 | } else /* no more data to transmit */ |
47 | rt->out = NULL; | 48 | rt->out = NULL; |
48 | } | 49 | } |
@@ -94,8 +95,9 @@ static void usb6fire_midi_out_trigger( | |||
94 | 95 | ||
95 | ret = usb_submit_urb(urb, GFP_ATOMIC); | 96 | ret = usb_submit_urb(urb, GFP_ATOMIC); |
96 | if (ret < 0) | 97 | if (ret < 0) |
97 | snd_printk(KERN_ERR PREFIX "midi out urb " | 98 | dev_err(&urb->dev->dev, |
98 | "submit failed: %d\n", ret); | 99 | "midi out urb submit failed: %d\n", |
100 | ret); | ||
99 | else | 101 | else |
100 | rt->out = alsa_sub; | 102 | rt->out = alsa_sub; |
101 | } | 103 | } |
@@ -181,7 +183,7 @@ int usb6fire_midi_init(struct sfire_chip *chip) | |||
181 | if (ret < 0) { | 183 | if (ret < 0) { |
182 | kfree(rt->out_buffer); | 184 | kfree(rt->out_buffer); |
183 | kfree(rt); | 185 | kfree(rt); |
184 | snd_printk(KERN_ERR PREFIX "unable to create midi.\n"); | 186 | dev_err(&chip->dev->dev, "unable to create midi.\n"); |
185 | return ret; | 187 | return ret; |
186 | } | 188 | } |
187 | rt->instance->private_data = rt; | 189 | rt->instance->private_data = rt; |
diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c index b5eb97fdc842..ba40489b2de4 100644 --- a/sound/usb/6fire/pcm.c +++ b/sound/usb/6fire/pcm.c | |||
@@ -79,32 +79,35 @@ static int usb6fire_pcm_set_rate(struct pcm_runtime *rt) | |||
79 | ctrl_rt->usb_streaming = false; | 79 | ctrl_rt->usb_streaming = false; |
80 | ret = ctrl_rt->update_streaming(ctrl_rt); | 80 | ret = ctrl_rt->update_streaming(ctrl_rt); |
81 | if (ret < 0) { | 81 | if (ret < 0) { |
82 | snd_printk(KERN_ERR PREFIX "error stopping streaming while " | 82 | dev_err(&rt->chip->dev->dev, |
83 | "setting samplerate %d.\n", rates[rt->rate]); | 83 | "error stopping streaming while setting samplerate %d.\n", |
84 | rates[rt->rate]); | ||
84 | return ret; | 85 | return ret; |
85 | } | 86 | } |
86 | 87 | ||
87 | ret = ctrl_rt->set_rate(ctrl_rt, rt->rate); | 88 | ret = ctrl_rt->set_rate(ctrl_rt, rt->rate); |
88 | if (ret < 0) { | 89 | if (ret < 0) { |
89 | snd_printk(KERN_ERR PREFIX "error setting samplerate %d.\n", | 90 | dev_err(&rt->chip->dev->dev, |
90 | rates[rt->rate]); | 91 | "error setting samplerate %d.\n", |
92 | rates[rt->rate]); | ||
91 | return ret; | 93 | return ret; |
92 | } | 94 | } |
93 | 95 | ||
94 | ret = ctrl_rt->set_channels(ctrl_rt, OUT_N_CHANNELS, IN_N_CHANNELS, | 96 | ret = ctrl_rt->set_channels(ctrl_rt, OUT_N_CHANNELS, IN_N_CHANNELS, |
95 | false, false); | 97 | false, false); |
96 | if (ret < 0) { | 98 | if (ret < 0) { |
97 | snd_printk(KERN_ERR PREFIX "error initializing channels " | 99 | dev_err(&rt->chip->dev->dev, |
98 | "while setting samplerate %d.\n", | 100 | "error initializing channels while setting samplerate %d.\n", |
99 | rates[rt->rate]); | 101 | rates[rt->rate]); |
100 | return ret; | 102 | return ret; |
101 | } | 103 | } |
102 | 104 | ||
103 | ctrl_rt->usb_streaming = true; | 105 | ctrl_rt->usb_streaming = true; |
104 | ret = ctrl_rt->update_streaming(ctrl_rt); | 106 | ret = ctrl_rt->update_streaming(ctrl_rt); |
105 | if (ret < 0) { | 107 | if (ret < 0) { |
106 | snd_printk(KERN_ERR PREFIX "error starting streaming while " | 108 | dev_err(&rt->chip->dev->dev, |
107 | "setting samplerate %d.\n", rates[rt->rate]); | 109 | "error starting streaming while setting samplerate %d.\n", |
110 | rates[rt->rate]); | ||
108 | return ret; | 111 | return ret; |
109 | } | 112 | } |
110 | 113 | ||
@@ -124,7 +127,7 @@ static struct pcm_substream *usb6fire_pcm_get_substream( | |||
124 | return &rt->playback; | 127 | return &rt->playback; |
125 | else if (alsa_sub->stream == SNDRV_PCM_STREAM_CAPTURE) | 128 | else if (alsa_sub->stream == SNDRV_PCM_STREAM_CAPTURE) |
126 | return &rt->capture; | 129 | return &rt->capture; |
127 | snd_printk(KERN_ERR PREFIX "error getting pcm substream slot.\n"); | 130 | dev_err(&rt->chip->dev->dev, "error getting pcm substream slot.\n"); |
128 | return NULL; | 131 | return NULL; |
129 | } | 132 | } |
130 | 133 | ||
@@ -257,7 +260,7 @@ static void usb6fire_pcm_playback(struct pcm_substream *sub, | |||
257 | else if (alsa_rt->format == SNDRV_PCM_FORMAT_S24_LE) | 260 | else if (alsa_rt->format == SNDRV_PCM_FORMAT_S24_LE) |
258 | dest = (u32 *) (urb->buffer); | 261 | dest = (u32 *) (urb->buffer); |
259 | else { | 262 | else { |
260 | snd_printk(KERN_ERR PREFIX "Unknown sample format."); | 263 | dev_err(&rt->chip->dev->dev, "Unknown sample format."); |
261 | return; | 264 | return; |
262 | } | 265 | } |
263 | 266 | ||
@@ -307,8 +310,8 @@ static void usb6fire_pcm_in_urb_handler(struct urb *usb_urb) | |||
307 | } | 310 | } |
308 | 311 | ||
309 | if (rt->stream_state == STREAM_DISABLED) { | 312 | if (rt->stream_state == STREAM_DISABLED) { |
310 | snd_printk(KERN_ERR PREFIX "internal error: " | 313 | dev_err(&rt->chip->dev->dev, |
311 | "stream disabled in in-urb handler.\n"); | 314 | "internal error: stream disabled in in-urb handler.\n"); |
312 | return; | 315 | return; |
313 | } | 316 | } |
314 | 317 | ||
@@ -410,7 +413,7 @@ static int usb6fire_pcm_open(struct snd_pcm_substream *alsa_sub) | |||
410 | 413 | ||
411 | if (!sub) { | 414 | if (!sub) { |
412 | mutex_unlock(&rt->stream_mutex); | 415 | mutex_unlock(&rt->stream_mutex); |
413 | snd_printk(KERN_ERR PREFIX "invalid stream type.\n"); | 416 | dev_err(&rt->chip->dev->dev, "invalid stream type.\n"); |
414 | return -EINVAL; | 417 | return -EINVAL; |
415 | } | 418 | } |
416 | 419 | ||
@@ -481,8 +484,9 @@ static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub) | |||
481 | break; | 484 | break; |
482 | if (rt->rate == ARRAY_SIZE(rates)) { | 485 | if (rt->rate == ARRAY_SIZE(rates)) { |
483 | mutex_unlock(&rt->stream_mutex); | 486 | mutex_unlock(&rt->stream_mutex); |
484 | snd_printk("invalid rate %d in prepare.\n", | 487 | dev_err(&rt->chip->dev->dev, |
485 | alsa_rt->rate); | 488 | "invalid rate %d in prepare.\n", |
489 | alsa_rt->rate); | ||
486 | return -EINVAL; | 490 | return -EINVAL; |
487 | } | 491 | } |
488 | 492 | ||
@@ -494,8 +498,8 @@ static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub) | |||
494 | ret = usb6fire_pcm_stream_start(rt); | 498 | ret = usb6fire_pcm_stream_start(rt); |
495 | if (ret) { | 499 | if (ret) { |
496 | mutex_unlock(&rt->stream_mutex); | 500 | mutex_unlock(&rt->stream_mutex); |
497 | snd_printk(KERN_ERR PREFIX | 501 | dev_err(&rt->chip->dev->dev, |
498 | "could not start pcm stream.\n"); | 502 | "could not start pcm stream.\n"); |
499 | return ret; | 503 | return ret; |
500 | } | 504 | } |
501 | } | 505 | } |
@@ -650,7 +654,7 @@ int usb6fire_pcm_init(struct sfire_chip *chip) | |||
650 | if (ret < 0) { | 654 | if (ret < 0) { |
651 | usb6fire_pcm_buffers_destroy(rt); | 655 | usb6fire_pcm_buffers_destroy(rt); |
652 | kfree(rt); | 656 | kfree(rt); |
653 | snd_printk(KERN_ERR PREFIX "cannot create pcm instance.\n"); | 657 | dev_err(&chip->dev->dev, "cannot create pcm instance.\n"); |
654 | return ret; | 658 | return ret; |
655 | } | 659 | } |
656 | 660 | ||
@@ -662,8 +666,8 @@ int usb6fire_pcm_init(struct sfire_chip *chip) | |||
662 | if (ret) { | 666 | if (ret) { |
663 | usb6fire_pcm_buffers_destroy(rt); | 667 | usb6fire_pcm_buffers_destroy(rt); |
664 | kfree(rt); | 668 | kfree(rt); |
665 | snd_printk(KERN_ERR PREFIX | 669 | dev_err(&chip->dev->dev, |
666 | "error preallocating pcm buffers.\n"); | 670 | "error preallocating pcm buffers.\n"); |
667 | return ret; | 671 | return ret; |
668 | } | 672 | } |
669 | rt->instance = pcm; | 673 | rt->instance = pcm; |