diff options
author | Subhransu S. Prusty <subhransu.s.prusty@intel.com> | 2014-09-02 08:35:56 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-09-06 10:21:25 -0400 |
commit | 02024756e6ab3a3fcdc3b203552b16b345ebd97d (patch) | |
tree | 6a2cb219a4ee42847ab012d1abbb760942594786 /sound/soc/intel/sst-mfld-platform-pcm.c | |
parent | 923976a30b36ce0970e88f53ed2f2b5b61aeeb73 (diff) |
ASoC: mfld: pcm: Replace pr_ with dev_
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/intel/sst-mfld-platform-pcm.c')
-rw-r--r-- | sound/soc/intel/sst-mfld-platform-pcm.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/sound/soc/intel/sst-mfld-platform-pcm.c b/sound/soc/intel/sst-mfld-platform-pcm.c index 8e1e9bc27642..85deecd82b92 100644 --- a/sound/soc/intel/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/sst-mfld-platform-pcm.c | |||
@@ -43,12 +43,12 @@ int sst_register_dsp(struct sst_device *dev) | |||
43 | return -ENODEV; | 43 | return -ENODEV; |
44 | mutex_lock(&sst_lock); | 44 | mutex_lock(&sst_lock); |
45 | if (sst) { | 45 | if (sst) { |
46 | pr_err("we already have a device %s\n", sst->name); | 46 | dev_err(dev->dev, "we already have a device %s\n", sst->name); |
47 | module_put(dev->dev->driver->owner); | 47 | module_put(dev->dev->driver->owner); |
48 | mutex_unlock(&sst_lock); | 48 | mutex_unlock(&sst_lock); |
49 | return -EEXIST; | 49 | return -EEXIST; |
50 | } | 50 | } |
51 | pr_debug("registering device %s\n", dev->name); | 51 | dev_dbg(dev->dev, "registering device %s\n", dev->name); |
52 | sst = dev; | 52 | sst = dev; |
53 | mutex_unlock(&sst_lock); | 53 | mutex_unlock(&sst_lock); |
54 | return 0; | 54 | return 0; |
@@ -70,7 +70,7 @@ int sst_unregister_dsp(struct sst_device *dev) | |||
70 | } | 70 | } |
71 | 71 | ||
72 | module_put(sst->dev->driver->owner); | 72 | module_put(sst->dev->driver->owner); |
73 | pr_debug("unreg %s\n", sst->name); | 73 | dev_dbg(dev->dev, "unreg %s\n", sst->name); |
74 | sst = NULL; | 74 | sst = NULL; |
75 | mutex_unlock(&sst_lock); | 75 | mutex_unlock(&sst_lock); |
76 | return 0; | 76 | return 0; |
@@ -306,9 +306,10 @@ static int sst_platform_init_stream(struct snd_pcm_substream *substream) | |||
306 | { | 306 | { |
307 | struct sst_runtime_stream *stream = | 307 | struct sst_runtime_stream *stream = |
308 | substream->runtime->private_data; | 308 | substream->runtime->private_data; |
309 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
309 | int ret_val; | 310 | int ret_val; |
310 | 311 | ||
311 | pr_debug("setting buffer ptr param\n"); | 312 | dev_dbg(rtd->dev, "setting buffer ptr param\n"); |
312 | sst_set_stream_status(stream, SST_PLATFORM_INIT); | 313 | sst_set_stream_status(stream, SST_PLATFORM_INIT); |
313 | stream->stream_info.period_elapsed = sst_period_elapsed; | 314 | stream->stream_info.period_elapsed = sst_period_elapsed; |
314 | stream->stream_info.arg = substream; | 315 | stream->stream_info.arg = substream; |
@@ -316,7 +317,7 @@ static int sst_platform_init_stream(struct snd_pcm_substream *substream) | |||
316 | stream->stream_info.sfreq = substream->runtime->rate; | 317 | stream->stream_info.sfreq = substream->runtime->rate; |
317 | ret_val = stream->ops->stream_init(sst->dev, &stream->stream_info); | 318 | ret_val = stream->ops->stream_init(sst->dev, &stream->stream_info); |
318 | if (ret_val) | 319 | if (ret_val) |
319 | pr_err("control_set ret error %d\n", ret_val); | 320 | dev_err(rtd->dev, "control_set ret error %d\n", ret_val); |
320 | return ret_val; | 321 | return ret_val; |
321 | 322 | ||
322 | } | 323 | } |
@@ -337,7 +338,7 @@ static int sst_media_open(struct snd_pcm_substream *substream, | |||
337 | mutex_lock(&sst_lock); | 338 | mutex_lock(&sst_lock); |
338 | if (!sst || | 339 | if (!sst || |
339 | !try_module_get(sst->dev->driver->owner)) { | 340 | !try_module_get(sst->dev->driver->owner)) { |
340 | pr_err("no device available to run\n"); | 341 | dev_err(dai->dev, "no device available to run\n"); |
341 | ret_val = -ENODEV; | 342 | ret_val = -ENODEV; |
342 | goto out_ops; | 343 | goto out_ops; |
343 | } | 344 | } |
@@ -385,10 +386,11 @@ static inline unsigned int get_current_pipe_id(struct snd_soc_platform *platform | |||
385 | substream->runtime->private_data; | 386 | substream->runtime->private_data; |
386 | u32 str_id = stream->stream_info.str_id; | 387 | u32 str_id = stream->stream_info.str_id; |
387 | unsigned int pipe_id; | 388 | unsigned int pipe_id; |
389 | |||
388 | pipe_id = map[str_id].device_id; | 390 | pipe_id = map[str_id].device_id; |
389 | 391 | ||
390 | pr_debug("%s: got pipe_id = %#x for str_id = %d\n", | 392 | dev_dbg(platform->dev, "got pipe_id = %#x for str_id = %d\n", |
391 | __func__, pipe_id, str_id); | 393 | pipe_id, str_id); |
392 | return pipe_id; | 394 | return pipe_id; |
393 | } | 395 | } |
394 | 396 | ||
@@ -459,29 +461,30 @@ static int sst_platform_pcm_trigger(struct snd_pcm_substream *substream, | |||
459 | int ret_val = 0, str_id; | 461 | int ret_val = 0, str_id; |
460 | struct sst_runtime_stream *stream; | 462 | struct sst_runtime_stream *stream; |
461 | int status; | 463 | int status; |
464 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
462 | 465 | ||
463 | pr_debug("sst_platform_pcm_trigger called\n"); | 466 | dev_dbg(rtd->dev, "sst_platform_pcm_trigger called\n"); |
464 | stream = substream->runtime->private_data; | 467 | stream = substream->runtime->private_data; |
465 | str_id = stream->stream_info.str_id; | 468 | str_id = stream->stream_info.str_id; |
466 | switch (cmd) { | 469 | switch (cmd) { |
467 | case SNDRV_PCM_TRIGGER_START: | 470 | case SNDRV_PCM_TRIGGER_START: |
468 | pr_debug("sst: Trigger Start\n"); | 471 | dev_dbg(rtd->dev, "sst: Trigger Start\n"); |
469 | status = SST_PLATFORM_RUNNING; | 472 | status = SST_PLATFORM_RUNNING; |
470 | stream->stream_info.arg = substream; | 473 | stream->stream_info.arg = substream; |
471 | ret_val = stream->ops->stream_start(sst->dev, str_id); | 474 | ret_val = stream->ops->stream_start(sst->dev, str_id); |
472 | break; | 475 | break; |
473 | case SNDRV_PCM_TRIGGER_STOP: | 476 | case SNDRV_PCM_TRIGGER_STOP: |
474 | pr_debug("sst: in stop\n"); | 477 | dev_dbg(rtd->dev, "sst: in stop\n"); |
475 | status = SST_PLATFORM_DROPPED; | 478 | status = SST_PLATFORM_DROPPED; |
476 | ret_val = stream->ops->stream_drop(sst->dev, str_id); | 479 | ret_val = stream->ops->stream_drop(sst->dev, str_id); |
477 | break; | 480 | break; |
478 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 481 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
479 | pr_debug("sst: in pause\n"); | 482 | dev_dbg(rtd->dev, "sst: in pause\n"); |
480 | status = SST_PLATFORM_PAUSED; | 483 | status = SST_PLATFORM_PAUSED; |
481 | ret_val = stream->ops->stream_pause(sst->dev, str_id); | 484 | ret_val = stream->ops->stream_pause(sst->dev, str_id); |
482 | break; | 485 | break; |
483 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 486 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
484 | pr_debug("sst: in pause release\n"); | 487 | dev_dbg(rtd->dev, "sst: in pause release\n"); |
485 | status = SST_PLATFORM_RUNNING; | 488 | status = SST_PLATFORM_RUNNING; |
486 | ret_val = stream->ops->stream_pause_release(sst->dev, str_id); | 489 | ret_val = stream->ops->stream_pause_release(sst->dev, str_id); |
487 | break; | 490 | break; |
@@ -502,6 +505,7 @@ static snd_pcm_uframes_t sst_platform_pcm_pointer | |||
502 | struct sst_runtime_stream *stream; | 505 | struct sst_runtime_stream *stream; |
503 | int ret_val, status; | 506 | int ret_val, status; |
504 | struct pcm_stream_info *str_info; | 507 | struct pcm_stream_info *str_info; |
508 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
505 | 509 | ||
506 | stream = substream->runtime->private_data; | 510 | stream = substream->runtime->private_data; |
507 | status = sst_get_stream_status(stream); | 511 | status = sst_get_stream_status(stream); |
@@ -510,7 +514,7 @@ static snd_pcm_uframes_t sst_platform_pcm_pointer | |||
510 | str_info = &stream->stream_info; | 514 | str_info = &stream->stream_info; |
511 | ret_val = stream->ops->stream_read_tstamp(sst->dev, str_info); | 515 | ret_val = stream->ops->stream_read_tstamp(sst->dev, str_info); |
512 | if (ret_val) { | 516 | if (ret_val) { |
513 | pr_err("sst: error code = %d\n", ret_val); | 517 | dev_err(rtd->dev, "sst: error code = %d\n", ret_val); |
514 | return ret_val; | 518 | return ret_val; |
515 | } | 519 | } |
516 | substream->runtime->delay = str_info->pcm_delay; | 520 | substream->runtime->delay = str_info->pcm_delay; |
@@ -526,7 +530,7 @@ static struct snd_pcm_ops sst_platform_ops = { | |||
526 | 530 | ||
527 | static void sst_pcm_free(struct snd_pcm *pcm) | 531 | static void sst_pcm_free(struct snd_pcm *pcm) |
528 | { | 532 | { |
529 | pr_debug("sst_pcm_free called\n"); | 533 | dev_dbg(pcm->dev, "sst_pcm_free called\n"); |
530 | snd_pcm_lib_preallocate_free_for_all(pcm); | 534 | snd_pcm_lib_preallocate_free_for_all(pcm); |
531 | } | 535 | } |
532 | 536 | ||
@@ -543,7 +547,7 @@ static int sst_pcm_new(struct snd_soc_pcm_runtime *rtd) | |||
543 | snd_dma_continuous_data(GFP_DMA), | 547 | snd_dma_continuous_data(GFP_DMA), |
544 | SST_MIN_BUFFER, SST_MAX_BUFFER); | 548 | SST_MIN_BUFFER, SST_MAX_BUFFER); |
545 | if (retval) { | 549 | if (retval) { |
546 | pr_err("dma buffer allocationf fail\n"); | 550 | dev_err(rtd->dev, "dma buffer allocationf fail\n"); |
547 | return retval; | 551 | return retval; |
548 | } | 552 | } |
549 | } | 553 | } |
@@ -576,13 +580,11 @@ static int sst_platform_probe(struct platform_device *pdev) | |||
576 | 580 | ||
577 | drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); | 581 | drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); |
578 | if (drv == NULL) { | 582 | if (drv == NULL) { |
579 | pr_err("kzalloc failed\n"); | ||
580 | return -ENOMEM; | 583 | return -ENOMEM; |
581 | } | 584 | } |
582 | 585 | ||
583 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | 586 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
584 | if (pdata == NULL) { | 587 | if (pdata == NULL) { |
585 | pr_err("kzalloc failed for pdata\n"); | ||
586 | return -ENOMEM; | 588 | return -ENOMEM; |
587 | } | 589 | } |
588 | 590 | ||
@@ -594,14 +596,14 @@ static int sst_platform_probe(struct platform_device *pdev) | |||
594 | 596 | ||
595 | ret = snd_soc_register_platform(&pdev->dev, &sst_soc_platform_drv); | 597 | ret = snd_soc_register_platform(&pdev->dev, &sst_soc_platform_drv); |
596 | if (ret) { | 598 | if (ret) { |
597 | pr_err("registering soc platform failed\n"); | 599 | dev_err(&pdev->dev, "registering soc platform failed\n"); |
598 | return ret; | 600 | return ret; |
599 | } | 601 | } |
600 | 602 | ||
601 | ret = snd_soc_register_component(&pdev->dev, &sst_component, | 603 | ret = snd_soc_register_component(&pdev->dev, &sst_component, |
602 | sst_platform_dai, ARRAY_SIZE(sst_platform_dai)); | 604 | sst_platform_dai, ARRAY_SIZE(sst_platform_dai)); |
603 | if (ret) { | 605 | if (ret) { |
604 | pr_err("registering cpu dais failed\n"); | 606 | dev_err(&pdev->dev, "registering cpu dais failed\n"); |
605 | snd_soc_unregister_platform(&pdev->dev); | 607 | snd_soc_unregister_platform(&pdev->dev); |
606 | } | 608 | } |
607 | return ret; | 609 | return ret; |
@@ -612,7 +614,7 @@ static int sst_platform_remove(struct platform_device *pdev) | |||
612 | 614 | ||
613 | snd_soc_unregister_component(&pdev->dev); | 615 | snd_soc_unregister_component(&pdev->dev); |
614 | snd_soc_unregister_platform(&pdev->dev); | 616 | snd_soc_unregister_platform(&pdev->dev); |
615 | pr_debug("sst_platform_remove success\n"); | 617 | dev_dbg(&pdev->dev, "sst_platform_remove success\n"); |
616 | return 0; | 618 | return 0; |
617 | } | 619 | } |
618 | 620 | ||