aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-02 05:44:47 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-03 12:58:09 -0500
commit56d8a3b06816f740d83f8c8c5dfc7774ae86c1f1 (patch)
tree61e15a250db8dbdd7c33dfdf20d40ed2d8d66614
parentb7085c08647598aafbf8f6223ebcdd413745449c (diff)
[media] cx231xx: get rid of audio debug parameter
There's just one debug level on cx231xx-audio. So, converting it to dev_dbg() is easy. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-audio.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-audio.c b/drivers/media/usb/cx231xx/cx231xx-audio.c
index 1c3f68179fc9..a05ae02e5245 100644
--- a/drivers/media/usb/cx231xx/cx231xx-audio.c
+++ b/drivers/media/usb/cx231xx/cx231xx-audio.c
@@ -42,19 +42,13 @@ static int debug;
42module_param(debug, int, 0644); 42module_param(debug, int, 0644);
43MODULE_PARM_DESC(debug, "activates debug info"); 43MODULE_PARM_DESC(debug, "activates debug info");
44 44
45#define dprintk(fmt, arg...) do { \
46 if (debug) \
47 printk(KERN_INFO "cx231xx-audio %s: " fmt, \
48 __func__, ##arg); \
49 } while (0)
50
51static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; 45static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
52 46
53static int cx231xx_isoc_audio_deinit(struct cx231xx *dev) 47static int cx231xx_isoc_audio_deinit(struct cx231xx *dev)
54{ 48{
55 int i; 49 int i;
56 50
57 dprintk("Stopping isoc\n"); 51 dev_dbg(&dev->udev->dev, "Stopping isoc\n");
58 52
59 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) { 53 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
60 if (dev->adev.urb[i]) { 54 if (dev->adev.urb[i]) {
@@ -78,7 +72,7 @@ static int cx231xx_bulk_audio_deinit(struct cx231xx *dev)
78{ 72{
79 int i; 73 int i;
80 74
81 dprintk("Stopping bulk\n"); 75 dev_dbg(&dev->udev->dev, "Stopping bulk\n");
82 76
83 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) { 77 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
84 if (dev->adev.urb[i]) { 78 if (dev->adev.urb[i]) {
@@ -122,7 +116,8 @@ static void cx231xx_audio_isocirq(struct urb *urb)
122 case -ESHUTDOWN: 116 case -ESHUTDOWN:
123 return; 117 return;
124 default: /* error */ 118 default: /* error */
125 dprintk("urb completition error %d.\n", urb->status); 119 dev_dbg(&dev->udev->dev, "urb completition error %d.\n",
120 urb->status);
126 break; 121 break;
127 } 122 }
128 123
@@ -211,7 +206,8 @@ static void cx231xx_audio_bulkirq(struct urb *urb)
211 case -ESHUTDOWN: 206 case -ESHUTDOWN:
212 return; 207 return;
213 default: /* error */ 208 default: /* error */
214 dprintk("urb completition error %d.\n", urb->status); 209 dev_dbg(&dev->udev->dev, "urb completition error %d.\n",
210 urb->status);
215 break; 211 break;
216 } 212 }
217 213
@@ -395,8 +391,9 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs,
395 size_t size) 391 size_t size)
396{ 392{
397 struct snd_pcm_runtime *runtime = subs->runtime; 393 struct snd_pcm_runtime *runtime = subs->runtime;
394 struct cx231xx *dev = snd_pcm_substream_chip(subs);
398 395
399 dprintk("Allocating vbuffer\n"); 396 dev_dbg(&dev->udev->dev, "Allocating vbuffer\n");
400 if (runtime->dma_area) { 397 if (runtime->dma_area) {
401 if (runtime->dma_bytes > size) 398 if (runtime->dma_bytes > size)
402 return 0; 399 return 0;
@@ -439,7 +436,8 @@ static int snd_cx231xx_capture_open(struct snd_pcm_substream *substream)
439 struct snd_pcm_runtime *runtime = substream->runtime; 436 struct snd_pcm_runtime *runtime = substream->runtime;
440 int ret = 0; 437 int ret = 0;
441 438
442 dprintk("opening device and trying to acquire exclusive lock\n"); 439 dev_dbg(&dev->udev->dev,
440 "opening device and trying to acquire exclusive lock\n");
443 441
444 if (!dev) { 442 if (!dev) {
445 dev_err(&dev->udev->dev, 443 dev_err(&dev->udev->dev,
@@ -489,7 +487,7 @@ static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
489 int ret; 487 int ret;
490 struct cx231xx *dev = snd_pcm_substream_chip(substream); 488 struct cx231xx *dev = snd_pcm_substream_chip(substream);
491 489
492 dprintk("closing device\n"); 490 dev_dbg(&dev->udev->dev, "closing device\n");
493 491
494 /* inform hardware to stop streaming */ 492 /* inform hardware to stop streaming */
495 mutex_lock(&dev->lock); 493 mutex_lock(&dev->lock);
@@ -510,10 +508,10 @@ static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
510 mutex_unlock(&dev->lock); 508 mutex_unlock(&dev->lock);
511 509
512 if (dev->adev.users == 0 && dev->adev.shutdown == 1) { 510 if (dev->adev.users == 0 && dev->adev.shutdown == 1) {
513 dprintk("audio users: %d\n", dev->adev.users); 511 dev_dbg(&dev->udev->dev, "audio users: %d\n", dev->adev.users);
514 dprintk("disabling audio stream!\n"); 512 dev_dbg(&dev->udev->dev, "disabling audio stream!\n");
515 dev->adev.shutdown = 0; 513 dev->adev.shutdown = 0;
516 dprintk("released lock\n"); 514 dev_dbg(&dev->udev->dev, "released lock\n");
517 if (atomic_read(&dev->stream_started) > 0) { 515 if (atomic_read(&dev->stream_started) > 0) {
518 atomic_set(&dev->stream_started, 0); 516 atomic_set(&dev->stream_started, 0);
519 schedule_work(&dev->wq_trigger); 517 schedule_work(&dev->wq_trigger);
@@ -525,9 +523,10 @@ static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
525static int snd_cx231xx_hw_capture_params(struct snd_pcm_substream *substream, 523static int snd_cx231xx_hw_capture_params(struct snd_pcm_substream *substream,
526 struct snd_pcm_hw_params *hw_params) 524 struct snd_pcm_hw_params *hw_params)
527{ 525{
526 struct cx231xx *dev = snd_pcm_substream_chip(substream);
528 int ret; 527 int ret;
529 528
530 dprintk("Setting capture parameters\n"); 529 dev_dbg(&dev->udev->dev, "Setting capture parameters\n");
531 530
532 ret = snd_pcm_alloc_vmalloc_buffer(substream, 531 ret = snd_pcm_alloc_vmalloc_buffer(substream,
533 params_buffer_bytes(hw_params)); 532 params_buffer_bytes(hw_params));
@@ -549,7 +548,7 @@ static int snd_cx231xx_hw_capture_free(struct snd_pcm_substream *substream)
549{ 548{
550 struct cx231xx *dev = snd_pcm_substream_chip(substream); 549 struct cx231xx *dev = snd_pcm_substream_chip(substream);
551 550
552 dprintk("Stop capture, if needed\n"); 551 dev_dbg(&dev->udev->dev, "Stop capture, if needed\n");
553 552
554 if (atomic_read(&dev->stream_started) > 0) { 553 if (atomic_read(&dev->stream_started) > 0) {
555 atomic_set(&dev->stream_started, 0); 554 atomic_set(&dev->stream_started, 0);
@@ -574,7 +573,7 @@ static void audio_trigger(struct work_struct *work)
574 struct cx231xx *dev = container_of(work, struct cx231xx, wq_trigger); 573 struct cx231xx *dev = container_of(work, struct cx231xx, wq_trigger);
575 574
576 if (atomic_read(&dev->stream_started)) { 575 if (atomic_read(&dev->stream_started)) {
577 dprintk("starting capture"); 576 dev_dbg(&dev->udev->dev, "starting capture");
578 if (is_fw_load(dev) == 0) 577 if (is_fw_load(dev) == 0)
579 cx25840_call(dev, core, load_fw); 578 cx25840_call(dev, core, load_fw);
580 if (dev->USE_ISO) 579 if (dev->USE_ISO)
@@ -582,7 +581,7 @@ static void audio_trigger(struct work_struct *work)
582 else 581 else
583 cx231xx_init_audio_bulk(dev); 582 cx231xx_init_audio_bulk(dev);
584 } else { 583 } else {
585 dprintk("stopping capture"); 584 dev_dbg(&dev->udev->dev, "stopping capture");
586 cx231xx_isoc_audio_deinit(dev); 585 cx231xx_isoc_audio_deinit(dev);
587 } 586 }
588} 587}