diff --git a/sound/soc/tegra-alt/tegra186_arad_alt.c b/sound/soc/tegra-alt/tegra186_arad_alt.c index 19a10e84..f3efdef1 100644 --- a/sound/soc/tegra-alt/tegra186_arad_alt.c +++ b/sound/soc/tegra-alt/tegra186_arad_alt.c @@ -1,7 +1,7 @@ /* * tegra186_arad_alt.c - Tegra186 ARAD driver * - * Copyright (c) 2015-2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -799,9 +799,10 @@ static int tegra186_arad_platform_probe(struct platform_device *pdev) ret = -ENOMEM; goto err; } - arad_dev = &pdev->dev; + arad_dev = &pdev->dev; arad->soc_data = soc_data; + dev_set_drvdata(&pdev->dev, arad); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) { @@ -862,8 +863,6 @@ static int tegra186_arad_platform_probe(struct platform_device *pdev) TEGRA186_AHC_ARAD1_CB, &pdev->dev); #endif #endif - dev_set_drvdata(&pdev->dev, arad); - return 0; err_suspend: diff --git a/sound/soc/tegra-alt/tegra186_asrc_alt.c b/sound/soc/tegra-alt/tegra186_asrc_alt.c index e1d1ba66..1369d626 100644 --- a/sound/soc/tegra-alt/tegra186_asrc_alt.c +++ b/sound/soc/tegra-alt/tegra186_asrc_alt.c @@ -1,7 +1,7 @@ /* * tegra186_asrc_alt.c - Tegra186 ASRC driver * - * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -1142,6 +1142,7 @@ static int tegra186_asrc_platform_probe(struct platform_device *pdev) asrc->soc_data = soc_data; asrc->is_shutdown = false; + dev_set_drvdata(&pdev->dev, asrc); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) { @@ -1220,8 +1221,6 @@ static int tegra186_asrc_platform_probe(struct platform_device *pdev) goto err_suspend; } - dev_set_drvdata(&pdev->dev, asrc); - return 0; err_suspend: diff --git a/sound/soc/tegra-alt/tegra210_admaif_alt.c b/sound/soc/tegra-alt/tegra210_admaif_alt.c index 4bf15768..aa66e039 100644 --- a/sound/soc/tegra-alt/tegra210_admaif_alt.c +++ b/sound/soc/tegra-alt/tegra210_admaif_alt.c @@ -1,7 +1,7 @@ /* * tegra210_admaif_alt.c - Tegra ADMAIF driver * - * Copyright (c) 2014-2018 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -1135,9 +1135,9 @@ static int tegra_admaif_probe(struct platform_device *pdev) admaif->refcnt = 0; admaif->dev = &pdev->dev; - admaif->soc_data = (struct tegra_admaif_soc_data *)match->data; admaif->is_shutdown = false; + dev_set_drvdata(&pdev->dev, admaif); admaif->capture_dma_data = devm_kzalloc(&pdev->dev, sizeof(struct tegra_alt_pcm_dma_params) * @@ -1300,9 +1300,6 @@ static int tegra_admaif_probe(struct platform_device *pdev) goto err_unregister_codec; } - /* Driver data should be set before any reg r/w operation */ - dev_set_drvdata(&pdev->dev, admaif); - regmap_update_bits(admaif->regmap, admaif->soc_data->reg_offsets.global_enable, 1, 1); diff --git a/sound/soc/tegra-alt/tegra210_adx_alt.c b/sound/soc/tegra-alt/tegra210_adx_alt.c index c131eef4..7904d161 100644 --- a/sound/soc/tegra-alt/tegra210_adx_alt.c +++ b/sound/soc/tegra-alt/tegra210_adx_alt.c @@ -1,7 +1,7 @@ /* * tegra210_adx_alt.c - Tegra210 ADX driver * - * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -653,6 +653,7 @@ static int tegra210_adx_platform_probe(struct platform_device *pdev) adx->soc_data = soc_data; adx->is_shutdown = false; + dev_set_drvdata(&pdev->dev, adx); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) { @@ -709,8 +710,6 @@ static int tegra210_adx_platform_probe(struct platform_device *pdev) goto err_suspend; } - dev_set_drvdata(&pdev->dev, adx); - return 0; err_suspend: diff --git a/sound/soc/tegra-alt/tegra210_amx_alt.c b/sound/soc/tegra-alt/tegra210_amx_alt.c index ab166f5a..e38acfea 100644 --- a/sound/soc/tegra-alt/tegra210_amx_alt.c +++ b/sound/soc/tegra-alt/tegra210_amx_alt.c @@ -1,7 +1,7 @@ /* * tegra210_amx_alt.c - Tegra210 AMX driver * - * Copyright (c) 2014-2018 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -932,6 +932,7 @@ static int tegra210_amx_platform_probe(struct platform_device *pdev) amx->is_shutdown = false; memset(amx->map, 0, sizeof(amx->map)); memset(amx->byte_mask, 0, sizeof(amx->byte_mask)); + dev_set_drvdata(&pdev->dev, amx); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) { @@ -995,8 +996,6 @@ static int tegra210_amx_platform_probe(struct platform_device *pdev) goto err_suspend; } - dev_set_drvdata(&pdev->dev, amx); - return 0; err_suspend: diff --git a/sound/soc/tegra-alt/tegra210_dmic_alt.c b/sound/soc/tegra-alt/tegra210_dmic_alt.c index bd8cb579..fd0baebe 100644 --- a/sound/soc/tegra-alt/tegra210_dmic_alt.c +++ b/sound/soc/tegra-alt/tegra210_dmic_alt.c @@ -1,7 +1,7 @@ /* * tegra210_dmic_alt.c - Tegra210 DMIC driver * - * Copyright (c) 2014-2018 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -703,6 +703,7 @@ static int tegra210_dmic_platform_probe(struct platform_device *pdev) dmic->soc_data = soc_data; dmic->is_shutdown = false; dmic->prod_name = NULL; + dev_set_drvdata(&pdev->dev, dmic); if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) { dmic->clk_dmic = devm_clk_get(&pdev->dev, NULL); @@ -826,8 +827,6 @@ static int tegra210_dmic_platform_probe(struct platform_device *pdev) } err_dap: - dev_set_drvdata(&pdev->dev, dmic); - pdev_bkp[pdev->dev.id] = pdev; return 0; diff --git a/sound/soc/tegra-alt/tegra210_i2s_alt.c b/sound/soc/tegra-alt/tegra210_i2s_alt.c index 8888f954..82c26b40 100644 --- a/sound/soc/tegra-alt/tegra210_i2s_alt.c +++ b/sound/soc/tegra-alt/tegra210_i2s_alt.c @@ -1,7 +1,7 @@ /* * tegra210_i2s.c - Tegra210 I2S driver * - * Copyright (c) 2014-2018 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -1098,6 +1098,7 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev) i2s->loopback = 0; i2s->is_shutdown = false; i2s->prod_name = NULL; + dev_set_drvdata(&pdev->dev, i2s); if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) { i2s->clk_i2s = devm_clk_get(&pdev->dev, NULL); @@ -1261,8 +1262,6 @@ err_dap: goto err_suspend; } - dev_set_drvdata(&pdev->dev, i2s); - return 0; err_suspend: diff --git a/sound/soc/tegra-alt/tegra210_iqc_alt.c b/sound/soc/tegra-alt/tegra210_iqc_alt.c index 4979f671..42865fc6 100644 --- a/sound/soc/tegra-alt/tegra210_iqc_alt.c +++ b/sound/soc/tegra-alt/tegra210_iqc_alt.c @@ -1,7 +1,7 @@ /* * tegra210_iqc.c - Tegra210 IQC driver * - * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -347,6 +347,7 @@ static int tegra210_iqc_platform_probe(struct platform_device *pdev) } iqc->soc_data = soc_data; + dev_set_drvdata(&pdev->dev, iqc); if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) { iqc->clk_iqc = devm_clk_get(&pdev->dev, NULL); @@ -428,8 +429,6 @@ static int tegra210_iqc_platform_probe(struct platform_device *pdev) goto err_suspend; } - dev_set_drvdata(&pdev->dev, iqc); - return 0; err_suspend: diff --git a/sound/soc/tegra-alt/tegra210_mixer_alt.c b/sound/soc/tegra-alt/tegra210_mixer_alt.c index 7541a8bb..2b008ad9 100644 --- a/sound/soc/tegra-alt/tegra210_mixer_alt.c +++ b/sound/soc/tegra-alt/tegra210_mixer_alt.c @@ -1,7 +1,7 @@ /* * tegra210_mixer_alt.c - Tegra210 MIXER driver * - * Copyright (c) 2014-2018 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -750,6 +750,7 @@ static int tegra210_mixer_platform_probe(struct platform_device *pdev) mixer->gain_coeff[11] = 0; mixer->gain_coeff[12] = 0x400; mixer->gain_coeff[13] = 0x8000000; + dev_set_drvdata(&pdev->dev, mixer); for (i = 0; i < TEGRA210_MIXER_AXBAR_RX_MAX; i++) mixer->gain_value[i] = 0x10000; @@ -809,8 +810,6 @@ static int tegra210_mixer_platform_probe(struct platform_device *pdev) goto err_suspend; } - dev_set_drvdata(&pdev->dev, mixer); - return 0; err_suspend: diff --git a/sound/soc/tegra-alt/tegra210_mvc_alt.c b/sound/soc/tegra-alt/tegra210_mvc_alt.c index efb40915..9a8d7591 100644 --- a/sound/soc/tegra-alt/tegra210_mvc_alt.c +++ b/sound/soc/tegra-alt/tegra210_mvc_alt.c @@ -1,7 +1,7 @@ /* * tegra210_mvc_alt.c - Tegra210 MVC driver * - * Copyright (c) 2014-2018 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -674,6 +674,7 @@ static int tegra210_mvc_platform_probe(struct platform_device *pdev) mvc->soc_data = soc_data; mvc->is_shutdown = false; + dev_set_drvdata(&pdev->dev, mvc); mvc->poly_n1 = 16; mvc->poly_n2 = 63; @@ -746,8 +747,6 @@ static int tegra210_mvc_platform_probe(struct platform_device *pdev) goto err_suspend; } - dev_set_drvdata(&pdev->dev, mvc); - return 0; err_suspend: diff --git a/sound/soc/tegra-alt/tegra210_sfc_alt.c b/sound/soc/tegra-alt/tegra210_sfc_alt.c index 51eb4130..de48de71 100644 --- a/sound/soc/tegra-alt/tegra210_sfc_alt.c +++ b/sound/soc/tegra-alt/tegra210_sfc_alt.c @@ -1,7 +1,7 @@ /* * tegra210_sfc_alt.c - Tegra210 SFC driver * - * Copyright (c) 2014-2018 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -899,6 +899,8 @@ static int tegra210_sfc_platform_probe(struct platform_device *pdev) /* initialize default output srate */ sfc->srate_out = TEGRA210_SFC_FS48; + dev_set_drvdata(&pdev->dev, sfc); + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) { dev_err(&pdev->dev, "No memory resource\n"); @@ -954,8 +956,6 @@ static int tegra210_sfc_platform_probe(struct platform_device *pdev) goto err_suspend; } - dev_set_drvdata(&pdev->dev, sfc); - return 0; err_suspend: diff --git a/sound/soc/tegra-alt/tegra210_spdif_alt.c b/sound/soc/tegra-alt/tegra210_spdif_alt.c index 21de7120..66216202 100644 --- a/sound/soc/tegra-alt/tegra210_spdif_alt.c +++ b/sound/soc/tegra-alt/tegra210_spdif_alt.c @@ -1,7 +1,7 @@ /* * tegra210_spdif_alt.c - Tegra210 SPDIF driver * - * Copyright (c) 2014-2018 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -479,6 +479,8 @@ static int tegra210_spdif_platform_probe(struct platform_device *pdev) spdif->soc_data = soc_data; spdif->is_shutdown = false; + dev_set_drvdata(&pdev->dev, spdif); + if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) { spdif->clk_pll_a_out0 = devm_clk_get(&pdev->dev, "pll_a_out0"); if (IS_ERR(spdif->clk_pll_a_out0)) { @@ -604,8 +606,6 @@ static int tegra210_spdif_platform_probe(struct platform_device *pdev) } err_dap: - dev_set_drvdata(&pdev->dev, spdif); - return 0; err_suspend: