aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/mixart/mixart.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-02-25 11:51:46 -0500
committerTakashi Iwai <tiwai@suse.de>2014-02-26 10:45:29 -0500
commit6414e35deb59117ee0883c5acca7670a2a24ca98 (patch)
treef6d343ae64857a6348aac4d841a4af409d776ae2 /sound/pci/mixart/mixart.c
parentbe4e6d3c0fa03d3978234feb6a2eefd95b93fa87 (diff)
ALSA: mixart: 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/pci/mixart/mixart.c')
-rw-r--r--sound/pci/mixart/mixart.c118
1 files changed, 78 insertions, 40 deletions
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index 9ab057bb9859..a93e7af51eed 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -87,7 +87,8 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
87 if(!start) return 0; /* already stopped */ 87 if(!start) return 0; /* already stopped */
88 break; 88 break;
89 default: 89 default:
90 snd_printk(KERN_ERR "error mixart_set_pipe_state called with wrong pipe->status!\n"); 90 dev_err(&mgr->pci->dev,
91 "error mixart_set_pipe_state called with wrong pipe->status!\n");
91 return -EINVAL; /* function called with wrong pipe status */ 92 return -EINVAL; /* function called with wrong pipe status */
92 } 93 }
93 94
@@ -102,7 +103,8 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
102 103
103 err = snd_mixart_send_msg_wait_notif(mgr, &request, system_msg_uid); 104 err = snd_mixart_send_msg_wait_notif(mgr, &request, system_msg_uid);
104 if(err) { 105 if(err) {
105 snd_printk(KERN_ERR "error : MSG_SYSTEM_WAIT_SYNCHRO_CMD was not notified !\n"); 106 dev_err(&mgr->pci->dev,
107 "error : MSG_SYSTEM_WAIT_SYNCHRO_CMD was not notified !\n");
106 return err; 108 return err;
107 } 109 }
108 110
@@ -123,7 +125,9 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
123 125
124 err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp); 126 err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp);
125 if (err < 0 || group_state_resp.txx_status != 0) { 127 if (err < 0 || group_state_resp.txx_status != 0) {
126 snd_printk(KERN_ERR "error MSG_STREAM_ST***_STREAM_GRP_PACKET err=%x stat=%x !\n", err, group_state_resp.txx_status); 128 dev_err(&mgr->pci->dev,
129 "error MSG_STREAM_ST***_STREAM_GRP_PACKET err=%x stat=%x !\n",
130 err, group_state_resp.txx_status);
127 return -EINVAL; 131 return -EINVAL;
128 } 132 }
129 133
@@ -134,7 +138,9 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
134 138
135 err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp); 139 err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp);
136 if (err < 0 || group_state_resp.txx_status != 0) { 140 if (err < 0 || group_state_resp.txx_status != 0) {
137 snd_printk(KERN_ERR "error MSG_STREAM_START_STREAM_GRP_PACKET err=%x stat=%x !\n", err, group_state_resp.txx_status); 141 dev_err(&mgr->pci->dev,
142 "error MSG_STREAM_START_STREAM_GRP_PACKET err=%x stat=%x !\n",
143 err, group_state_resp.txx_status);
138 return -EINVAL; 144 return -EINVAL;
139 } 145 }
140 146
@@ -147,7 +153,9 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
147 153
148 err = snd_mixart_send_msg(mgr, &request, sizeof(stat), &stat); 154 err = snd_mixart_send_msg(mgr, &request, sizeof(stat), &stat);
149 if (err < 0 || stat != 0) { 155 if (err < 0 || stat != 0) {
150 snd_printk(KERN_ERR "error MSG_SYSTEM_SEND_SYNCHRO_CMD err=%x stat=%x !\n", err, stat); 156 dev_err(&mgr->pci->dev,
157 "error MSG_SYSTEM_SEND_SYNCHRO_CMD err=%x stat=%x !\n",
158 err, stat);
151 return -EINVAL; 159 return -EINVAL;
152 } 160 }
153 161
@@ -178,7 +186,9 @@ static int mixart_set_clock(struct mixart_mgr *mgr,
178 if(rate == 0) 186 if(rate == 0)
179 return 0; /* nothing to do */ 187 return 0; /* nothing to do */
180 else { 188 else {
181 snd_printk(KERN_ERR "error mixart_set_clock(%d) called with wrong pipe->status !\n", rate); 189 dev_err(&mgr->pci->dev,
190 "error mixart_set_clock(%d) called with wrong pipe->status !\n",
191 rate);
182 return -EINVAL; 192 return -EINVAL;
183 } 193 }
184 } 194 }
@@ -190,7 +200,7 @@ static int mixart_set_clock(struct mixart_mgr *mgr,
190 clock_properties.nb_callers = 1; /* only one entry in uid_caller ! */ 200 clock_properties.nb_callers = 1; /* only one entry in uid_caller ! */
191 clock_properties.uid_caller[0] = pipe->group_uid; 201 clock_properties.uid_caller[0] = pipe->group_uid;
192 202
193 snd_printdd("mixart_set_clock to %d kHz\n", rate); 203 dev_dbg(&mgr->pci->dev, "mixart_set_clock to %d kHz\n", rate);
194 204
195 request.message_id = MSG_CLOCK_SET_PROPERTIES; 205 request.message_id = MSG_CLOCK_SET_PROPERTIES;
196 request.uid = mgr->uid_console_manager; 206 request.uid = mgr->uid_console_manager;
@@ -199,7 +209,9 @@ static int mixart_set_clock(struct mixart_mgr *mgr,
199 209
200 err = snd_mixart_send_msg(mgr, &request, sizeof(clock_prop_resp), &clock_prop_resp); 210 err = snd_mixart_send_msg(mgr, &request, sizeof(clock_prop_resp), &clock_prop_resp);
201 if (err < 0 || clock_prop_resp.status != 0 || clock_prop_resp.clock_mode != CM_STANDALONE) { 211 if (err < 0 || clock_prop_resp.status != 0 || clock_prop_resp.clock_mode != CM_STANDALONE) {
202 snd_printk(KERN_ERR "error MSG_CLOCK_SET_PROPERTIES err=%x stat=%x mod=%x !\n", err, clock_prop_resp.status, clock_prop_resp.clock_mode); 212 dev_err(&mgr->pci->dev,
213 "error MSG_CLOCK_SET_PROPERTIES err=%x stat=%x mod=%x !\n",
214 err, clock_prop_resp.status, clock_prop_resp.clock_mode);
203 return -EINVAL; 215 return -EINVAL;
204 } 216 }
205 217
@@ -252,7 +264,9 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
252 struct mixart_streaming_group sgroup_resp; 264 struct mixart_streaming_group sgroup_resp;
253 } *buf; 265 } *buf;
254 266
255 snd_printdd("add_ref_pipe audio chip(%d) pcm(%d)\n", chip->chip_idx, pcm_number); 267 dev_dbg(chip->card->dev,
268 "add_ref_pipe audio chip(%d) pcm(%d)\n",
269 chip->chip_idx, pcm_number);
256 270
257 buf = kmalloc(sizeof(*buf), GFP_KERNEL); 271 buf = kmalloc(sizeof(*buf), GFP_KERNEL);
258 if (!buf) 272 if (!buf)
@@ -302,7 +316,9 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
302 316
303 err = snd_mixart_send_msg(chip->mgr, &request, sizeof(buf->sgroup_resp), &buf->sgroup_resp); 317 err = snd_mixart_send_msg(chip->mgr, &request, sizeof(buf->sgroup_resp), &buf->sgroup_resp);
304 if((err < 0) || (buf->sgroup_resp.status != 0)) { 318 if((err < 0) || (buf->sgroup_resp.status != 0)) {
305 snd_printk(KERN_ERR "error MSG_STREAM_ADD_**PUT_GROUP err=%x stat=%x !\n", err, buf->sgroup_resp.status); 319 dev_err(chip->card->dev,
320 "error MSG_STREAM_ADD_**PUT_GROUP err=%x stat=%x !\n",
321 err, buf->sgroup_resp.status);
306 kfree(buf); 322 kfree(buf);
307 return NULL; 323 return NULL;
308 } 324 }
@@ -343,13 +359,14 @@ int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr,
343 /* release the clock */ 359 /* release the clock */
344 err = mixart_set_clock( mgr, pipe, 0); 360 err = mixart_set_clock( mgr, pipe, 0);
345 if( err < 0 ) { 361 if( err < 0 ) {
346 snd_printk(KERN_ERR "mixart_set_clock(0) return error!\n"); 362 dev_err(&mgr->pci->dev,
363 "mixart_set_clock(0) return error!\n");
347 } 364 }
348 365
349 /* stop the pipe */ 366 /* stop the pipe */
350 err = mixart_set_pipe_state(mgr, pipe, 0); 367 err = mixart_set_pipe_state(mgr, pipe, 0);
351 if( err < 0 ) { 368 if( err < 0 ) {
352 snd_printk(KERN_ERR "error stopping pipe!\n"); 369 dev_err(&mgr->pci->dev, "error stopping pipe!\n");
353 } 370 }
354 371
355 request.message_id = MSG_STREAM_DELETE_GROUP; 372 request.message_id = MSG_STREAM_DELETE_GROUP;
@@ -360,7 +377,9 @@ int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr,
360 /* delete the pipe */ 377 /* delete the pipe */
361 err = snd_mixart_send_msg(mgr, &request, sizeof(delete_resp), &delete_resp); 378 err = snd_mixart_send_msg(mgr, &request, sizeof(delete_resp), &delete_resp);
362 if ((err < 0) || (delete_resp.status != 0)) { 379 if ((err < 0) || (delete_resp.status != 0)) {
363 snd_printk(KERN_ERR "error MSG_STREAM_DELETE_GROUP err(%x), status(%x)\n", err, delete_resp.status); 380 dev_err(&mgr->pci->dev,
381 "error MSG_STREAM_DELETE_GROUP err(%x), status(%x)\n",
382 err, delete_resp.status);
364 } 383 }
365 384
366 pipe->group_uid = (struct mixart_uid){0,0}; 385 pipe->group_uid = (struct mixart_uid){0,0};
@@ -414,7 +433,7 @@ static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd)
414 switch (cmd) { 433 switch (cmd) {
415 case SNDRV_PCM_TRIGGER_START: 434 case SNDRV_PCM_TRIGGER_START:
416 435
417 snd_printdd("SNDRV_PCM_TRIGGER_START\n"); 436 dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_TRIGGER_START\n");
418 437
419 /* START_STREAM */ 438 /* START_STREAM */
420 if( mixart_set_stream_state(stream, 1) ) 439 if( mixart_set_stream_state(stream, 1) )
@@ -431,19 +450,19 @@ static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd)
431 450
432 stream->status = MIXART_STREAM_STATUS_OPEN; 451 stream->status = MIXART_STREAM_STATUS_OPEN;
433 452
434 snd_printdd("SNDRV_PCM_TRIGGER_STOP\n"); 453 dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_TRIGGER_STOP\n");
435 454
436 break; 455 break;
437 456
438 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 457 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
439 /* TODO */ 458 /* TODO */
440 stream->status = MIXART_STREAM_STATUS_PAUSE; 459 stream->status = MIXART_STREAM_STATUS_PAUSE;
441 snd_printdd("SNDRV_PCM_PAUSE_PUSH\n"); 460 dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_PAUSE_PUSH\n");
442 break; 461 break;
443 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 462 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
444 /* TODO */ 463 /* TODO */
445 stream->status = MIXART_STREAM_STATUS_RUNNING; 464 stream->status = MIXART_STREAM_STATUS_RUNNING;
446 snd_printdd("SNDRV_PCM_PAUSE_RELEASE\n"); 465 dev_dbg(subs->pcm->card->dev, "SNDRV_PCM_PAUSE_RELEASE\n");
447 break; 466 break;
448 default: 467 default:
449 return -EINVAL; 468 return -EINVAL;
@@ -456,7 +475,8 @@ static int mixart_sync_nonblock_events(struct mixart_mgr *mgr)
456 unsigned long timeout = jiffies + HZ; 475 unsigned long timeout = jiffies + HZ;
457 while (atomic_read(&mgr->msg_processed) > 0) { 476 while (atomic_read(&mgr->msg_processed) > 0) {
458 if (time_after(jiffies, timeout)) { 477 if (time_after(jiffies, timeout)) {
459 snd_printk(KERN_ERR "mixart: cannot process nonblock events!\n"); 478 dev_err(&mgr->pci->dev,
479 "mixart: cannot process nonblock events!\n");
460 return -EBUSY; 480 return -EBUSY;
461 } 481 }
462 schedule_timeout_uninterruptible(1); 482 schedule_timeout_uninterruptible(1);
@@ -474,7 +494,7 @@ static int snd_mixart_prepare(struct snd_pcm_substream *subs)
474 494
475 /* TODO de façon non bloquante, réappliquer les hw_params (rate, bits, codec) */ 495 /* TODO de façon non bloquante, réappliquer les hw_params (rate, bits, codec) */
476 496
477 snd_printdd("snd_mixart_prepare\n"); 497 dev_dbg(chip->card->dev, "snd_mixart_prepare\n");
478 498
479 mixart_sync_nonblock_events(chip->mgr); 499 mixart_sync_nonblock_events(chip->mgr);
480 500
@@ -542,11 +562,13 @@ static int mixart_set_format(struct mixart_stream *stream, snd_pcm_format_t form
542 stream_param.sample_size = 32; 562 stream_param.sample_size = 32;
543 break; 563 break;
544 default: 564 default:
545 snd_printk(KERN_ERR "error mixart_set_format() : unknown format\n"); 565 dev_err(chip->card->dev,
566 "error mixart_set_format() : unknown format\n");
546 return -EINVAL; 567 return -EINVAL;
547 } 568 }
548 569
549 snd_printdd("set SNDRV_PCM_FORMAT sample_type(%d) sample_size(%d) freq(%d) channels(%d)\n", 570 dev_dbg(chip->card->dev,
571 "set SNDRV_PCM_FORMAT sample_type(%d) sample_size(%d) freq(%d) channels(%d)\n",
550 stream_param.sample_type, stream_param.sample_size, stream_param.sampling_freq, stream->channels); 572 stream_param.sample_type, stream_param.sample_size, stream_param.sampling_freq, stream->channels);
551 573
552 /* TODO: what else to configure ? */ 574 /* TODO: what else to configure ? */
@@ -566,7 +588,9 @@ static int mixart_set_format(struct mixart_stream *stream, snd_pcm_format_t form
566 588
567 err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp); 589 err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp);
568 if((err < 0) || resp.error_code) { 590 if((err < 0) || resp.error_code) {
569 snd_printk(KERN_ERR "MSG_STREAM_SET_INPUT_STAGE_PARAM err=%x; resp=%x\n", err, resp.error_code); 591 dev_err(chip->card->dev,
592 "MSG_STREAM_SET_INPUT_STAGE_PARAM err=%x; resp=%x\n",
593 err, resp.error_code);
570 return -EINVAL; 594 return -EINVAL;
571 } 595 }
572 return 0; 596 return 0;
@@ -627,8 +651,9 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
627 bufferinfo[i].available_length = subs->runtime->dma_bytes; 651 bufferinfo[i].available_length = subs->runtime->dma_bytes;
628 /* bufferinfo[i].buffer_id is already defined */ 652 /* bufferinfo[i].buffer_id is already defined */
629 653
630 snd_printdd("snd_mixart_hw_params(pcm %d) : dma_addr(%x) dma_bytes(%x) subs-number(%d)\n", i, 654 dev_dbg(chip->card->dev,
631 bufferinfo[i].buffer_address, 655 "snd_mixart_hw_params(pcm %d) : dma_addr(%x) dma_bytes(%x) subs-number(%d)\n",
656 i, bufferinfo[i].buffer_address,
632 bufferinfo[i].available_length, 657 bufferinfo[i].available_length,
633 subs->number); 658 subs->number);
634 } 659 }
@@ -714,14 +739,18 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
714 pcm_number = MIXART_PCM_DIGITAL; 739 pcm_number = MIXART_PCM_DIGITAL;
715 runtime->hw = snd_mixart_digital_caps; 740 runtime->hw = snd_mixart_digital_caps;
716 } 741 }
717 snd_printdd("snd_mixart_playback_open C%d/P%d/Sub%d\n", chip->chip_idx, pcm_number, subs->number); 742 dev_dbg(chip->card->dev,
743 "snd_mixart_playback_open C%d/P%d/Sub%d\n",
744 chip->chip_idx, pcm_number, subs->number);
718 745
719 /* get stream info */ 746 /* get stream info */
720 stream = &(chip->playback_stream[pcm_number][subs->number]); 747 stream = &(chip->playback_stream[pcm_number][subs->number]);
721 748
722 if (stream->status != MIXART_STREAM_STATUS_FREE){ 749 if (stream->status != MIXART_STREAM_STATUS_FREE){
723 /* streams in use */ 750 /* streams in use */
724 snd_printk(KERN_ERR "snd_mixart_playback_open C%d/P%d/Sub%d in use\n", chip->chip_idx, pcm_number, subs->number); 751 dev_err(chip->card->dev,
752 "snd_mixart_playback_open C%d/P%d/Sub%d in use\n",
753 chip->chip_idx, pcm_number, subs->number);
725 err = -EBUSY; 754 err = -EBUSY;
726 goto _exit_open; 755 goto _exit_open;
727 } 756 }
@@ -737,7 +766,7 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
737 /* start the pipe if necessary */ 766 /* start the pipe if necessary */
738 err = mixart_set_pipe_state(chip->mgr, pipe, 1); 767 err = mixart_set_pipe_state(chip->mgr, pipe, 1);
739 if( err < 0 ) { 768 if( err < 0 ) {
740 snd_printk(KERN_ERR "error starting pipe!\n"); 769 dev_err(chip->card->dev, "error starting pipe!\n");
741 snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0); 770 snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0);
742 err = -EINVAL; 771 err = -EINVAL;
743 goto _exit_open; 772 goto _exit_open;
@@ -792,14 +821,17 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
792 821
793 runtime->hw.channels_min = 2; /* for instance, no mono */ 822 runtime->hw.channels_min = 2; /* for instance, no mono */
794 823
795 snd_printdd("snd_mixart_capture_open C%d/P%d/Sub%d\n", chip->chip_idx, pcm_number, subs->number); 824 dev_dbg(chip->card->dev, "snd_mixart_capture_open C%d/P%d/Sub%d\n",
825 chip->chip_idx, pcm_number, subs->number);
796 826
797 /* get stream info */ 827 /* get stream info */
798 stream = &(chip->capture_stream[pcm_number]); 828 stream = &(chip->capture_stream[pcm_number]);
799 829
800 if (stream->status != MIXART_STREAM_STATUS_FREE){ 830 if (stream->status != MIXART_STREAM_STATUS_FREE){
801 /* streams in use */ 831 /* streams in use */
802 snd_printk(KERN_ERR "snd_mixart_capture_open C%d/P%d/Sub%d in use\n", chip->chip_idx, pcm_number, subs->number); 832 dev_err(chip->card->dev,
833 "snd_mixart_capture_open C%d/P%d/Sub%d in use\n",
834 chip->chip_idx, pcm_number, subs->number);
803 err = -EBUSY; 835 err = -EBUSY;
804 goto _exit_open; 836 goto _exit_open;
805 } 837 }
@@ -815,7 +847,7 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
815 /* start the pipe if necessary */ 847 /* start the pipe if necessary */
816 err = mixart_set_pipe_state(chip->mgr, pipe, 1); 848 err = mixart_set_pipe_state(chip->mgr, pipe, 1);
817 if( err < 0 ) { 849 if( err < 0 ) {
818 snd_printk(KERN_ERR "error starting pipe!\n"); 850 dev_err(chip->card->dev, "error starting pipe!\n");
819 snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0); 851 snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0);
820 err = -EINVAL; 852 err = -EINVAL;
821 goto _exit_open; 853 goto _exit_open;
@@ -855,7 +887,8 @@ static int snd_mixart_close(struct snd_pcm_substream *subs)
855 887
856 mutex_lock(&mgr->setup_mutex); 888 mutex_lock(&mgr->setup_mutex);
857 889
858 snd_printdd("snd_mixart_close C%d/P%d/Sub%d\n", chip->chip_idx, stream->pcm_number, subs->number); 890 dev_dbg(chip->card->dev, "snd_mixart_close C%d/P%d/Sub%d\n",
891 chip->chip_idx, stream->pcm_number, subs->number);
859 892
860 /* sample rate released */ 893 /* sample rate released */
861 if(--mgr->ref_count_rate == 0) { 894 if(--mgr->ref_count_rate == 0) {
@@ -865,7 +898,9 @@ static int snd_mixart_close(struct snd_pcm_substream *subs)
865 /* delete pipe */ 898 /* delete pipe */
866 if (snd_mixart_kill_ref_pipe(mgr, stream->pipe, 0 ) < 0) { 899 if (snd_mixart_kill_ref_pipe(mgr, stream->pipe, 0 ) < 0) {
867 900
868 snd_printk(KERN_ERR "error snd_mixart_kill_ref_pipe C%dP%d\n", chip->chip_idx, stream->pcm_number); 901 dev_err(chip->card->dev,
902 "error snd_mixart_kill_ref_pipe C%dP%d\n",
903 chip->chip_idx, stream->pcm_number);
869 } 904 }
870 905
871 stream->pipe = NULL; 906 stream->pipe = NULL;
@@ -940,7 +975,8 @@ static int snd_mixart_pcm_analog(struct snd_mixart *chip)
940 if ((err = snd_pcm_new(chip->card, name, MIXART_PCM_ANALOG, 975 if ((err = snd_pcm_new(chip->card, name, MIXART_PCM_ANALOG,
941 MIXART_PLAYBACK_STREAMS, 976 MIXART_PLAYBACK_STREAMS,
942 MIXART_CAPTURE_STREAMS, &pcm)) < 0) { 977 MIXART_CAPTURE_STREAMS, &pcm)) < 0) {
943 snd_printk(KERN_ERR "cannot create the analog pcm %d\n", chip->chip_idx); 978 dev_err(chip->card->dev,
979 "cannot create the analog pcm %d\n", chip->chip_idx);
944 return err; 980 return err;
945 } 981 }
946 982
@@ -971,7 +1007,8 @@ static int snd_mixart_pcm_digital(struct snd_mixart *chip)
971 if ((err = snd_pcm_new(chip->card, name, MIXART_PCM_DIGITAL, 1007 if ((err = snd_pcm_new(chip->card, name, MIXART_PCM_DIGITAL,
972 MIXART_PLAYBACK_STREAMS, 1008 MIXART_PLAYBACK_STREAMS,
973 MIXART_CAPTURE_STREAMS, &pcm)) < 0) { 1009 MIXART_CAPTURE_STREAMS, &pcm)) < 0) {
974 snd_printk(KERN_ERR "cannot create the digital pcm %d\n", chip->chip_idx); 1010 dev_err(chip->card->dev,
1011 "cannot create the digital pcm %d\n", chip->chip_idx);
975 return err; 1012 return err;
976 } 1013 }
977 1014
@@ -1014,7 +1051,7 @@ static int snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int
1014 1051
1015 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1052 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
1016 if (! chip) { 1053 if (! chip) {
1017 snd_printk(KERN_ERR "cannot allocate chip\n"); 1054 dev_err(card->dev, "cannot allocate chip\n");
1018 return -ENOMEM; 1055 return -ENOMEM;
1019 } 1056 }
1020 1057
@@ -1071,7 +1108,7 @@ static int snd_mixart_free(struct mixart_mgr *mgr)
1071 /* reset board if some firmware was loaded */ 1108 /* reset board if some firmware was loaded */
1072 if(mgr->dsp_loaded) { 1109 if(mgr->dsp_loaded) {
1073 snd_mixart_reset_board(mgr); 1110 snd_mixart_reset_board(mgr);
1074 snd_printdd("reset miXart !\n"); 1111 dev_dbg(&mgr->pci->dev, "reset miXart !\n");
1075 } 1112 }
1076 1113
1077 /* release the i/o ports */ 1114 /* release the i/o ports */
@@ -1232,7 +1269,8 @@ static int snd_mixart_probe(struct pci_dev *pci,
1232 1269
1233 /* check if we can restrict PCI DMA transfers to 32 bits */ 1270 /* check if we can restrict PCI DMA transfers to 32 bits */
1234 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) { 1271 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
1235 snd_printk(KERN_ERR "architecture does not support 32bit PCI busmaster DMA\n"); 1272 dev_err(&pci->dev,
1273 "architecture does not support 32bit PCI busmaster DMA\n");
1236 pci_disable_device(pci); 1274 pci_disable_device(pci);
1237 return -ENXIO; 1275 return -ENXIO;
1238 } 1276 }
@@ -1258,7 +1296,7 @@ static int snd_mixart_probe(struct pci_dev *pci,
1258 mgr->mem[i].phys = pci_resource_start(pci, i); 1296 mgr->mem[i].phys = pci_resource_start(pci, i);
1259 mgr->mem[i].virt = pci_ioremap_bar(pci, i); 1297 mgr->mem[i].virt = pci_ioremap_bar(pci, i);
1260 if (!mgr->mem[i].virt) { 1298 if (!mgr->mem[i].virt) {
1261 printk(KERN_ERR "unable to remap resource 0x%lx\n", 1299 dev_err(&pci->dev, "unable to remap resource 0x%lx\n",
1262 mgr->mem[i].phys); 1300 mgr->mem[i].phys);
1263 snd_mixart_free(mgr); 1301 snd_mixart_free(mgr);
1264 return -EBUSY; 1302 return -EBUSY;
@@ -1267,7 +1305,7 @@ static int snd_mixart_probe(struct pci_dev *pci,
1267 1305
1268 if (request_irq(pci->irq, snd_mixart_interrupt, IRQF_SHARED, 1306 if (request_irq(pci->irq, snd_mixart_interrupt, IRQF_SHARED,
1269 KBUILD_MODNAME, mgr)) { 1307 KBUILD_MODNAME, mgr)) {
1270 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 1308 dev_err(&pci->dev, "unable to grab IRQ %d\n", pci->irq);
1271 snd_mixart_free(mgr); 1309 snd_mixart_free(mgr);
1272 return -EBUSY; 1310 return -EBUSY;
1273 } 1311 }
@@ -1310,7 +1348,7 @@ static int snd_mixart_probe(struct pci_dev *pci,
1310 0, &card); 1348 0, &card);
1311 1349
1312 if (err < 0) { 1350 if (err < 0) {
1313 snd_printk(KERN_ERR "cannot allocate the card %d\n", i); 1351 dev_err(&pci->dev, "cannot allocate the card %d\n", i);
1314 snd_mixart_free(mgr); 1352 snd_mixart_free(mgr);
1315 return err; 1353 return err;
1316 } 1354 }