ASoC: pxa: mmp: replace platform to component

Now platform can be replaced to component, let's do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2018-01-29 02:48:18 +00:00 committed by Mark Brown
parent f98fc0f815
commit 797d16971a
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 8 additions and 3 deletions

View File

@ -25,6 +25,8 @@
#include <sound/soc.h>
#include <sound/dmaengine_pcm.h>
#define DRV_NAME "mmp-pcm"
struct mmp_dma_data {
int ssp_id;
struct resource *dma_res;
@ -100,7 +102,8 @@ static bool filter(struct dma_chan *chan, void *param)
static int mmp_pcm_open(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct platform_device *pdev = to_platform_device(rtd->platform->dev);
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct platform_device *pdev = to_platform_device(component->dev);
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
struct mmp_dma_data dma_data;
struct resource *r;
@ -211,7 +214,8 @@ static int mmp_pcm_new(struct snd_soc_pcm_runtime *rtd)
return ret;
}
static const struct snd_soc_platform_driver mmp_soc_platform = {
static const struct snd_soc_component_driver mmp_soc_component = {
.name = DRV_NAME,
.ops = &mmp_pcm_ops,
.pcm_new = mmp_pcm_new,
.pcm_free = mmp_pcm_free_dma_buffers,
@ -231,7 +235,8 @@ static int mmp_pcm_probe(struct platform_device *pdev)
mmp_pcm_hardware[SNDRV_PCM_STREAM_CAPTURE].period_bytes_max =
pdata->period_max_capture;
}
return devm_snd_soc_register_platform(&pdev->dev, &mmp_soc_platform);
return devm_snd_soc_register_component(&pdev->dev, &mmp_soc_component,
NULL, 0);
}
static struct platform_driver mmp_pcm_driver = {