aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/tegra/tegra_alc5632.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2013-02-15 19:07:33 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-03 22:22:23 -0500
commitf726536fc08db7a209e35b011883bbaee8e93db7 (patch)
tree9288cb85e7f514c3153f1a46de9f6e81f566d3ee /sound/soc/tegra/tegra_alc5632.c
parent078e027386b2fdeb154393eb87a5b325d0937ed9 (diff)
ASoC: tegra_alc5632: assume CONFIG_OF, and other cleanup
Tegra only supports, and always enables, device tree. Remove all runtime checks for DT support from the driver. Also, various minor cleanups so that the probe() body more closely resembles other drivers, for easier comparison. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/tegra/tegra_alc5632.c')
-rw-r--r--sound/soc/tegra/tegra_alc5632.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c
index c80adb9da472..48d05d9e1002 100644
--- a/sound/soc/tegra/tegra_alc5632.c
+++ b/sound/soc/tegra/tegra_alc5632.c
@@ -161,20 +161,13 @@ static int tegra_alc5632_probe(struct platform_device *pdev)
161 sizeof(struct tegra_alc5632), GFP_KERNEL); 161 sizeof(struct tegra_alc5632), GFP_KERNEL);
162 if (!alc5632) { 162 if (!alc5632) {
163 dev_err(&pdev->dev, "Can't allocate tegra_alc5632\n"); 163 dev_err(&pdev->dev, "Can't allocate tegra_alc5632\n");
164 ret = -ENOMEM; 164 return -ENOMEM;
165 goto err;
166 } 165 }
167 166
168 card->dev = &pdev->dev; 167 card->dev = &pdev->dev;
169 platform_set_drvdata(pdev, card); 168 platform_set_drvdata(pdev, card);
170 snd_soc_card_set_drvdata(card, alc5632); 169 snd_soc_card_set_drvdata(card, alc5632);
171 170
172 if (!(pdev->dev.of_node)) {
173 dev_err(&pdev->dev, "Must be instantiated using device tree\n");
174 ret = -EINVAL;
175 goto err;
176 }
177
178 alc5632->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0); 171 alc5632->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
179 if (alc5632->gpio_hp_det == -EPROBE_DEFER) 172 if (alc5632->gpio_hp_det == -EPROBE_DEFER)
180 return -EPROBE_DEFER; 173 return -EPROBE_DEFER;
@@ -197,11 +190,11 @@ static int tegra_alc5632_probe(struct platform_device *pdev)
197 goto err; 190 goto err;
198 } 191 }
199 192
200 tegra_alc5632_dai.cpu_of_node = of_parse_phandle( 193 tegra_alc5632_dai.cpu_of_node = of_parse_phandle(np,
201 pdev->dev.of_node, "nvidia,i2s-controller", 0); 194 "nvidia,i2s-controller", 0);
202 if (!tegra_alc5632_dai.cpu_of_node) { 195 if (!tegra_alc5632_dai.cpu_of_node) {
203 dev_err(&pdev->dev, 196 dev_err(&pdev->dev,
204 "Property 'nvidia,i2s-controller' missing or invalid\n"); 197 "Property 'nvidia,i2s-controller' missing or invalid\n");
205 ret = -EINVAL; 198 ret = -EINVAL;
206 goto err; 199 goto err;
207 } 200 }