Now platform can be replaced to component, let's do it.
To avoid complex operation, this patch adds device pointer
to atmel_classd.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
        struct regmap *regmap;
        struct clk *pclk;
        struct clk *gclk;
+       struct device *dev;
        int irq;
        const struct atmel_classd_pdata *pdata;
 };
        struct atmel_classd *dd = snd_soc_card_get_drvdata(rtd->card);
 
        if (params_physical_width(params) != 16) {
-               dev_err(rtd->platform->dev,
+               dev_err(dd->dev,
                        "only supports 16-bit audio data\n");
                return -EINVAL;
        }
        }
 
        dd->phy_base = res->start;
+       dd->dev = dev;
 
        dd->regmap = devm_regmap_init_mmio(dev, io_base,
                                        &atmel_classd_regmap_config);
 
        .mmap           = atmel_pcm_mmap,
 };
 
-static struct snd_soc_platform_driver atmel_soc_platform = {
+static struct snd_soc_component_driver atmel_soc_platform = {
        .ops            = &atmel_pcm_ops,
        .pcm_new        = atmel_pcm_new,
        .pcm_free       = atmel_pcm_free,
 
 int atmel_pcm_pdc_platform_register(struct device *dev)
 {
-       return snd_soc_register_platform(dev, &atmel_soc_platform);
+       return devm_snd_soc_register_component(dev, &atmel_soc_platform,
+                                              NULL, 0);
 }
 EXPORT_SYMBOL(atmel_pcm_pdc_platform_register);
 
 void atmel_pcm_pdc_platform_unregister(struct device *dev)
 {
-       snd_soc_unregister_platform(dev);
 }
 EXPORT_SYMBOL(atmel_pcm_pdc_platform_unregister);
 
 
        struct regmap *regmap;
        struct clk *pclk;
        struct clk *gclk;
+       struct device *dev;
        int irq;
        struct snd_pcm_substream *substream;
        const struct atmel_pdmic_pdata *pdata;
        ret = snd_hwparams_to_dma_slave_config(substream, params,
                                               slave_config);
        if (ret) {
-               dev_err(rtd->platform->dev,
+               dev_err(dd->dev,
                        "hw params to dma slave configure failed\n");
                return ret;
        }
                return -ENOMEM;
 
        dd->pdata = pdata;
+       dd->dev = dev;
 
        dd->irq = platform_get_irq(pdev, 0);
        if (dd->irq < 0) {