ASoC: twl6040, fsl: use to_platform_device
authorGeliang Tang <geliangtang@163.com>
Wed, 23 Dec 2015 13:03:39 +0000 (21:03 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 24 Dec 2015 19:42:42 +0000 (19:42 +0000)
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/twl6040.c
sound/soc/fsl/mpc8610_hpcd.c
sound/soc/fsl/p1022_ds.c
sound/soc/fsl/p1022_rdk.c

index 4cad8929d26221f952863ed52772abebcc03fca3..bc3de2e844e68b80d8bf96dcc5c66f96d1a82669 100644 (file)
@@ -1097,8 +1097,7 @@ static int twl6040_probe(struct snd_soc_codec *codec)
 {
        struct twl6040_data *priv;
        struct twl6040 *twl6040 = dev_get_drvdata(codec->dev->parent);
-       struct platform_device *pdev = container_of(codec->dev,
-                                                  struct platform_device, dev);
+       struct platform_device *pdev = to_platform_device(codec->dev);
        int ret = 0;
 
        priv = devm_kzalloc(codec->dev, sizeof(*priv), GFP_KERNEL);
index 6f236f170cf5fe6c4369612ead1d4d4e6dd4f591..ddf49f30b23fc9a2faa3934c81c3712c5b2cc627 100644 (file)
@@ -189,8 +189,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
 {
        struct device *dev = pdev->dev.parent;
        /* ssi_pdev is the platform device for the SSI node that probed us */
-       struct platform_device *ssi_pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *ssi_pdev = to_platform_device(dev);
        struct device_node *np = ssi_pdev->dev.of_node;
        struct device_node *codec_np = NULL;
        struct mpc8610_hpcd_data *machine_data;
index 747aab0602bd21dc5402dadd8cb59c35f544fc06..a1f780ecadf54d4e679d39aac2803e24c8be39ec 100644 (file)
@@ -199,8 +199,7 @@ static int p1022_ds_probe(struct platform_device *pdev)
 {
        struct device *dev = pdev->dev.parent;
        /* ssi_pdev is the platform device for the SSI node that probed us */
-       struct platform_device *ssi_pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *ssi_pdev = to_platform_device(dev);
        struct device_node *np = ssi_pdev->dev.of_node;
        struct device_node *codec_np = NULL;
        struct machine_data *mdata;
index 1dd49e5f967591737a5fd5a63e328949daaed496..d4d88a8cb9c066296e1254445704880f3e91b34e 100644 (file)
@@ -203,8 +203,7 @@ static int p1022_rdk_probe(struct platform_device *pdev)
 {
        struct device *dev = pdev->dev.parent;
        /* ssi_pdev is the platform device for the SSI node that probed us */
-       struct platform_device *ssi_pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *ssi_pdev = to_platform_device(dev);
        struct device_node *np = ssi_pdev->dev.of_node;
        struct device_node *codec_np = NULL;
        struct machine_data *mdata;
This page took 0.033483 seconds and 5 git commands to generate.