mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-30 10:46:42 +07:00
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>
This commit is contained in:
parent
078e027386
commit
f726536fc0
@ -161,20 +161,13 @@ static int tegra_alc5632_probe(struct platform_device *pdev)
|
|||||||
sizeof(struct tegra_alc5632), GFP_KERNEL);
|
sizeof(struct tegra_alc5632), GFP_KERNEL);
|
||||||
if (!alc5632) {
|
if (!alc5632) {
|
||||||
dev_err(&pdev->dev, "Can't allocate tegra_alc5632\n");
|
dev_err(&pdev->dev, "Can't allocate tegra_alc5632\n");
|
||||||
ret = -ENOMEM;
|
return -ENOMEM;
|
||||||
goto err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
card->dev = &pdev->dev;
|
card->dev = &pdev->dev;
|
||||||
platform_set_drvdata(pdev, card);
|
platform_set_drvdata(pdev, card);
|
||||||
snd_soc_card_set_drvdata(card, alc5632);
|
snd_soc_card_set_drvdata(card, alc5632);
|
||||||
|
|
||||||
if (!(pdev->dev.of_node)) {
|
|
||||||
dev_err(&pdev->dev, "Must be instantiated using device tree\n");
|
|
||||||
ret = -EINVAL;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
alc5632->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
|
alc5632->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
|
||||||
if (alc5632->gpio_hp_det == -EPROBE_DEFER)
|
if (alc5632->gpio_hp_det == -EPROBE_DEFER)
|
||||||
return -EPROBE_DEFER;
|
return -EPROBE_DEFER;
|
||||||
@ -197,11 +190,11 @@ static int tegra_alc5632_probe(struct platform_device *pdev)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
tegra_alc5632_dai.cpu_of_node = of_parse_phandle(
|
tegra_alc5632_dai.cpu_of_node = of_parse_phandle(np,
|
||||||
pdev->dev.of_node, "nvidia,i2s-controller", 0);
|
"nvidia,i2s-controller", 0);
|
||||||
if (!tegra_alc5632_dai.cpu_of_node) {
|
if (!tegra_alc5632_dai.cpu_of_node) {
|
||||||
dev_err(&pdev->dev,
|
dev_err(&pdev->dev,
|
||||||
"Property 'nvidia,i2s-controller' missing or invalid\n");
|
"Property 'nvidia,i2s-controller' missing or invalid\n");
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user