ASoC: mxs: mxs-sgtl5000: Simplify probe function
authorFabio Estevam <fabio.estevam@freescale.com>
Mon, 2 Sep 2013 20:56:18 +0000 (17:56 -0300)
committerMark Brown <broonie@linaro.org>
Mon, 16 Sep 2013 23:40:10 +0000 (00:40 +0100)
mxs is a device tree only platform, which allows us to simplify a bit
mxs_sgtl5000_probe(), because there is no need to check whether device tree is
supported or not.

Remove mxs_sgtl5000_probe_dt() and place its content inside mxs_sgtl5000_probe()
for making the code simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/mxs/mxs-sgtl5000.c

index 4bb2737..61822cc 100644 (file)
@@ -122,14 +122,12 @@ static struct snd_soc_card mxs_sgtl5000 = {
        .num_links      = ARRAY_SIZE(mxs_sgtl5000_dai),
 };
 
-static int mxs_sgtl5000_probe_dt(struct platform_device *pdev)
+static int mxs_sgtl5000_probe(struct platform_device *pdev)
 {
+       struct snd_soc_card *card = &mxs_sgtl5000;
+       int ret, i;
        struct device_node *np = pdev->dev.of_node;
        struct device_node *saif_np[2], *codec_np;
-       int i;
-
-       if (!np)
-               return 1; /* no device tree */
 
        saif_np[0] = of_parse_phandle(np, "saif-controllers", 0);
        saif_np[1] = of_parse_phandle(np, "saif-controllers", 1);
@@ -152,18 +150,6 @@ static int mxs_sgtl5000_probe_dt(struct platform_device *pdev)
        of_node_put(saif_np[0]);
        of_node_put(saif_np[1]);
 
-       return 0;
-}
-
-static int mxs_sgtl5000_probe(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = &mxs_sgtl5000;
-       int ret;
-
-       ret = mxs_sgtl5000_probe_dt(pdev);
-       if (ret < 0)
-               return ret;
-
        /*
         * Set an init clock(11.28Mhz) for sgtl5000 initialization(i2c r/w).
         * The Sgtl5000 sysclk is derived from saif0 mclk and it's range