diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-06-29 21:42:23 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-07-05 19:53:59 +0100 |
commit | a10a8b6661c478dac3a8c55ad41f5cb00779c6b9 (patch) | |
tree | 7b302fe7f9eb17fa5b1ded2e52d65608a32b3b86 /sound/soc/tegra/tegra20_das.c | |
parent | eefaea93235523d248cc8cadcd6be9f47b03b9d5 (diff) |
ASoC: tegra: tegra20_das: Make helper functions return void
These only ever return a value != 0 if the parameter das is NULL. In the
only caller however it's already asserted this isn't the case.
So convert the functions to return void and simplify the caller
accordingly.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220629194224.175607-4-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/tegra/tegra20_das.c')
-rw-r--r-- | sound/soc/tegra/tegra20_das.c | 47 |
1 files changed, 10 insertions, 37 deletions
diff --git a/sound/soc/tegra/tegra20_das.c b/sound/soc/tegra/tegra20_das.c index 8637a0cc1f5e..39a6135dd0d0 100644 --- a/sound/soc/tegra/tegra20_das.c +++ b/sound/soc/tegra/tegra20_das.c @@ -102,31 +102,23 @@ static inline void tegra20_das_write(struct tegra20_das *das, u32 reg, u32 val) regmap_write(das->regmap, reg, val); } -static int tegra20_das_connect_dap_to_dac(struct tegra20_das *das, int dap, int dac) +static void tegra20_das_connect_dap_to_dac(struct tegra20_das *das, int dap, int dac) { u32 addr; u32 reg; - if (!das) - return -ENODEV; - addr = TEGRA20_DAS_DAP_CTRL_SEL + (dap * TEGRA20_DAS_DAP_CTRL_SEL_STRIDE); reg = dac << TEGRA20_DAS_DAP_CTRL_SEL_DAP_CTRL_SEL_P; tegra20_das_write(das, addr, reg); - - return 0; } -static int tegra20_das_connect_dac_to_dap(struct tegra20_das *das, int dac, int dap) +static void tegra20_das_connect_dac_to_dap(struct tegra20_das *das, int dac, int dap) { u32 addr; u32 reg; - if (!das) - return -ENODEV; - addr = TEGRA20_DAS_DAC_INPUT_DATA_CLK_SEL + (dac * TEGRA20_DAS_DAC_INPUT_DATA_CLK_SEL_STRIDE); reg = dap << TEGRA20_DAS_DAC_INPUT_DATA_CLK_SEL_DAC_CLK_SEL_P | @@ -134,8 +126,6 @@ static int tegra20_das_connect_dac_to_dap(struct tegra20_das *das, int dac, int dap << TEGRA20_DAS_DAC_INPUT_DATA_CLK_SEL_DAC_SDATA2_SEL_P; tegra20_das_write(das, addr, reg); - - return 0; } #define LAST_REG(name) \ @@ -167,7 +157,6 @@ static int tegra20_das_probe(struct platform_device *pdev) { void __iomem *regs; struct tegra20_das *das; - int ret = 0; das = devm_kzalloc(&pdev->dev, sizeof(struct tegra20_das), GFP_KERNEL); if (!das) @@ -186,30 +175,14 @@ static int tegra20_das_probe(struct platform_device *pdev) return PTR_ERR(das->regmap); } - ret = tegra20_das_connect_dap_to_dac(das, TEGRA20_DAS_DAP_ID_1, - TEGRA20_DAS_DAP_SEL_DAC1); - if (ret) { - dev_err(&pdev->dev, "Can't set up DAS DAP connection\n"); - return ret; - } - ret = tegra20_das_connect_dac_to_dap(das, TEGRA20_DAS_DAC_ID_1, - TEGRA20_DAS_DAC_SEL_DAP1); - if (ret) { - dev_err(&pdev->dev, "Can't set up DAS DAC connection\n"); - return ret; - } - ret = tegra20_das_connect_dap_to_dac(das, TEGRA20_DAS_DAP_ID_3, - TEGRA20_DAS_DAP_SEL_DAC3); - if (ret) { - dev_err(&pdev->dev, "Can't set up DAS DAP connection\n"); - return ret; - } - ret = tegra20_das_connect_dac_to_dap(das, TEGRA20_DAS_DAC_ID_3, - TEGRA20_DAS_DAC_SEL_DAP3); - if (ret) { - dev_err(&pdev->dev, "Can't set up DAS DAC connection\n"); - return ret; - } + tegra20_das_connect_dap_to_dac(das, TEGRA20_DAS_DAP_ID_1, + TEGRA20_DAS_DAP_SEL_DAC1); + tegra20_das_connect_dac_to_dap(das, TEGRA20_DAS_DAC_ID_1, + TEGRA20_DAS_DAC_SEL_DAP1); + tegra20_das_connect_dap_to_dac(das, TEGRA20_DAS_DAP_ID_3, + TEGRA20_DAS_DAP_SEL_DAC3); + tegra20_das_connect_dac_to_dap(das, TEGRA20_DAS_DAC_ID_3, + TEGRA20_DAS_DAC_SEL_DAP3); return 0; } |