ASoC: atmel: simplify getting .drvdata
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 19 Apr 2018 14:06:31 +0000 (16:06 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 19 Apr 2018 14:40:30 +0000 (15:40 +0100)
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/atmel/atmel_ssc_dai.c

index 1c7af0ca98ec147c16cc560e554e20365c482382..d3b69682d9c2244ac9699361fa1e887e346e33e9 100644 (file)
@@ -1002,8 +1002,7 @@ static const struct snd_soc_component_driver atmel_ssc_component = {
 
 static int asoc_ssc_init(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct ssc_device *ssc = platform_get_drvdata(pdev);
+       struct ssc_device *ssc = dev_get_drvdata(dev);
        int ret;
 
        ret = snd_soc_register_component(dev, &atmel_ssc_component,
@@ -1033,8 +1032,7 @@ err:
 
 static void asoc_ssc_exit(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct ssc_device *ssc = platform_get_drvdata(pdev);
+       struct ssc_device *ssc = dev_get_drvdata(dev);
 
        if (ssc->pdata->use_dma)
                atmel_pcm_dma_platform_unregister(dev);