From 52b1047acc0cb7824fc674aa3a82b17c6121b279 Mon Sep 17 00:00:00 2001 From: Sameer Pujar Date: Tue, 26 Sep 2017 21:54:14 +0530 Subject: [PATCH] ASoC: tegra-alt: avoid address hardcoding xbar codec is registered as per the physical address and the same is used while defining the dai links. This results in unnecessary duplication of the code and this is not scalable for upcoming platforms too. This patch removes such hardcodings for xbar and adsp audio driver by using dev_set_name() api. Bug 200346429 Change-Id: I16147b94cc1686ceb8b084ead91d2d35b1f0fbbd Signed-off-by: Sameer Pujar Reviewed-on: https://git-master.nvidia.com/r/1568711 Reviewed-by: mobile promotions Tested-by: mobile promotions --- sound/soc/tegra-alt/tegra210_adsp_alt.c | 5 +++++ sound/soc/tegra-alt/tegra210_xbar_alt.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/sound/soc/tegra-alt/tegra210_adsp_alt.c b/sound/soc/tegra-alt/tegra210_adsp_alt.c index eafc9481..3aa853f3 100644 --- a/sound/soc/tegra-alt/tegra210_adsp_alt.c +++ b/sound/soc/tegra-alt/tegra210_adsp_alt.c @@ -4871,6 +4871,11 @@ static int tegra210_adsp_audio_platform_probe(struct platform_device *pdev) pr_info("tegra210_adsp_audio_platform_probe: platform probe started\n"); + if (dev_set_name(&pdev->dev, "%s", DRV_NAME_ADSP) < 0) { + dev_err(&pdev->dev, "error in setting adsp device name\n"); + return -ENODEV; + } + match = of_match_device(tegra210_adsp_audio_of_match, &pdev->dev); if (!match) { dev_err(&pdev->dev, "Error: No device match found\n"); diff --git a/sound/soc/tegra-alt/tegra210_xbar_alt.c b/sound/soc/tegra-alt/tegra210_xbar_alt.c index e449d497..e9d2031d 100644 --- a/sound/soc/tegra-alt/tegra210_xbar_alt.c +++ b/sound/soc/tegra-alt/tegra210_xbar_alt.c @@ -1515,6 +1515,13 @@ static int tegra_dev_xbar_probe(struct platform_device *pdev) struct tegra_xbar_soc_data *soc_data; int ret; + /* required to register the xbar codec with generic name */ + if (dev_set_name(&pdev->dev, "%s", DRV_NAME) < 0) { + dev_err(&pdev->dev, "error in setting xbar device name\n"); + ret = -ENODEV; + goto err; + } + match = of_match_device(tegra_xbar_of_match, &pdev->dev); if (!match) { dev_err(&pdev->dev, "Error: No device match found\n");