Skip to content

Commit

Permalink
ASoC: tegra_wm8753: minor cleanup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Warren authored and Mark Brown committed Mar 4, 2013
1 parent 69de6be commit bddd7d0
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions sound/soc/tegra/tegra_wm8753.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ static struct snd_soc_card snd_soc_tegra_wm8753 = {

static int tegra_wm8753_driver_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct snd_soc_card *card = &snd_soc_tegra_wm8753;
struct tegra_wm8753 *machine;
int ret;
Expand All @@ -132,8 +133,7 @@ static int tegra_wm8753_driver_probe(struct platform_device *pdev)
GFP_KERNEL);
if (!machine) {
dev_err(&pdev->dev, "Can't allocate tegra_wm8753 struct\n");
ret = -ENOMEM;
goto err;
return -ENOMEM;
}

card->dev = &pdev->dev;
Expand All @@ -148,26 +148,25 @@ static int tegra_wm8753_driver_probe(struct platform_device *pdev)
if (ret)
goto err;

tegra_wm8753_dai.codec_of_node = of_parse_phandle(
pdev->dev.of_node, "nvidia,audio-codec", 0);
tegra_wm8753_dai.codec_of_node = of_parse_phandle(np,
"nvidia,audio-codec", 0);
if (!tegra_wm8753_dai.codec_of_node) {
dev_err(&pdev->dev,
"Property 'nvidia,audio-codec' missing or invalid\n");
ret = -EINVAL;
goto err;
}

tegra_wm8753_dai.cpu_of_node = of_parse_phandle(
pdev->dev.of_node, "nvidia,i2s-controller", 0);
tegra_wm8753_dai.cpu_of_node = of_parse_phandle(np,
"nvidia,i2s-controller", 0);
if (!tegra_wm8753_dai.cpu_of_node) {
dev_err(&pdev->dev,
"Property 'nvidia,i2s-controller' missing or invalid\n");
ret = -EINVAL;
goto err;
}

tegra_wm8753_dai.platform_of_node =
tegra_wm8753_dai.cpu_of_node;
tegra_wm8753_dai.platform_of_node = tegra_wm8753_dai.cpu_of_node;

ret = tegra_asoc_utils_init(&machine->util_data, &pdev->dev);
if (ret)
Expand Down

0 comments on commit bddd7d0

Please sign in to comment.