ASoC: mxs: mxs-sgtl5000: Simplify probe function

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>
This commit is contained in:
Fabio Estevam 2013-09-02 17:56:18 -03:00 committed by Mark Brown
parent 272b98c645
commit 38f2b8cbfb

View 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