diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2013-09-02 16:56:18 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-16 19:40:10 -0400 |
commit | 38f2b8cbfb1ef517af8af5a63bdff073b7b078fd (patch) | |
tree | b804f6a776af20703af37d0886512119030cfedd /sound/soc/mxs | |
parent | 272b98c6455f00884f0350f775c5342358ebb73f (diff) |
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>
Diffstat (limited to 'sound/soc/mxs')
-rw-r--r-- | sound/soc/mxs/mxs-sgtl5000.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/sound/soc/mxs/mxs-sgtl5000.c b/sound/soc/mxs/mxs-sgtl5000.c index 4bb273786ff3..61822cc53bd3 100644 --- a/sound/soc/mxs/mxs-sgtl5000.c +++ b/sound/soc/mxs/mxs-sgtl5000.c | |||
@@ -122,14 +122,12 @@ static struct snd_soc_card mxs_sgtl5000 = { | |||
122 | .num_links = ARRAY_SIZE(mxs_sgtl5000_dai), | 122 | .num_links = ARRAY_SIZE(mxs_sgtl5000_dai), |
123 | }; | 123 | }; |
124 | 124 | ||
125 | static int mxs_sgtl5000_probe_dt(struct platform_device *pdev) | 125 | static int mxs_sgtl5000_probe(struct platform_device *pdev) |
126 | { | 126 | { |
127 | struct snd_soc_card *card = &mxs_sgtl5000; | ||
128 | int ret, i; | ||
127 | struct device_node *np = pdev->dev.of_node; | 129 | struct device_node *np = pdev->dev.of_node; |
128 | struct device_node *saif_np[2], *codec_np; | 130 | struct device_node *saif_np[2], *codec_np; |
129 | int i; | ||
130 | |||
131 | if (!np) | ||
132 | return 1; /* no device tree */ | ||
133 | 131 | ||
134 | saif_np[0] = of_parse_phandle(np, "saif-controllers", 0); | 132 | saif_np[0] = of_parse_phandle(np, "saif-controllers", 0); |
135 | saif_np[1] = of_parse_phandle(np, "saif-controllers", 1); | 133 | saif_np[1] = of_parse_phandle(np, "saif-controllers", 1); |
@@ -152,18 +150,6 @@ static int mxs_sgtl5000_probe_dt(struct platform_device *pdev) | |||
152 | of_node_put(saif_np[0]); | 150 | of_node_put(saif_np[0]); |
153 | of_node_put(saif_np[1]); | 151 | of_node_put(saif_np[1]); |
154 | 152 | ||
155 | return 0; | ||
156 | } | ||
157 | |||
158 | static int mxs_sgtl5000_probe(struct platform_device *pdev) | ||
159 | { | ||
160 | struct snd_soc_card *card = &mxs_sgtl5000; | ||
161 | int ret; | ||
162 | |||
163 | ret = mxs_sgtl5000_probe_dt(pdev); | ||
164 | if (ret < 0) | ||
165 | return ret; | ||
166 | |||
167 | /* | 153 | /* |
168 | * Set an init clock(11.28Mhz) for sgtl5000 initialization(i2c r/w). | 154 | * Set an init clock(11.28Mhz) for sgtl5000 initialization(i2c r/w). |
169 | * The Sgtl5000 sysclk is derived from saif0 mclk and it's range | 155 | * The Sgtl5000 sysclk is derived from saif0 mclk and it's range |