Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: stm32: i2s: manage error when getting reset controller

Return an error when the i2s driver fails to get a reset controller.
Also add an error trace, except on probe defer status.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20200203100814.22944-4-olivier.moysan@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Olivier Moysan and committed by
Mark Brown
158ecc65 7889c008

+9 -5
+9 -5
sound/soc/stm/stm32_i2s.c
··· 866 866 } 867 867 868 868 /* Reset */ 869 - rst = devm_reset_control_get_exclusive(&pdev->dev, NULL); 870 - if (!IS_ERR(rst)) { 871 - reset_control_assert(rst); 872 - udelay(2); 873 - reset_control_deassert(rst); 869 + rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); 870 + if (IS_ERR(rst)) { 871 + if (PTR_ERR(rst) != -EPROBE_DEFER) 872 + dev_err(&pdev->dev, "Reset controller error %ld\n", 873 + PTR_ERR(rst)); 874 + return PTR_ERR(rst); 874 875 } 876 + reset_control_assert(rst); 877 + udelay(2); 878 + reset_control_deassert(rst); 875 879 876 880 return 0; 877 881 }