Commit f54e3474 authored by Bjorn Andersson's avatar Bjorn Andersson Committed by Mark Brown

ASoC: codecs: lpass: Log clk_get() failures

The LPASS macro drivers all acquire a number of clocks, but give no
indication when clk_get() fails, making it hard to identify and debug
system configuration issues.  Make these drivers provide useful debug
information when this happens.
Signed-off-by: default avatarBjorn Andersson <quic_bjorande@quicinc.com>
Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
Link: https://lore.kernel.org/r/20230721165027.2155528-1-quic_bjorande@quicinc.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent de1b43a5
...@@ -3537,25 +3537,25 @@ static int rx_macro_probe(struct platform_device *pdev) ...@@ -3537,25 +3537,25 @@ static int rx_macro_probe(struct platform_device *pdev)
rx->macro = devm_clk_get_optional(dev, "macro"); rx->macro = devm_clk_get_optional(dev, "macro");
if (IS_ERR(rx->macro)) if (IS_ERR(rx->macro))
return PTR_ERR(rx->macro); return dev_err_probe(dev, PTR_ERR(rx->macro), "unable to get macro clock\n");
rx->dcodec = devm_clk_get_optional(dev, "dcodec"); rx->dcodec = devm_clk_get_optional(dev, "dcodec");
if (IS_ERR(rx->dcodec)) if (IS_ERR(rx->dcodec))
return PTR_ERR(rx->dcodec); return dev_err_probe(dev, PTR_ERR(rx->dcodec), "unable to get dcodec clock\n");
rx->mclk = devm_clk_get(dev, "mclk"); rx->mclk = devm_clk_get(dev, "mclk");
if (IS_ERR(rx->mclk)) if (IS_ERR(rx->mclk))
return PTR_ERR(rx->mclk); return dev_err_probe(dev, PTR_ERR(rx->mclk), "unable to get mclk clock\n");
if (flags & LPASS_MACRO_FLAG_HAS_NPL_CLOCK) { if (flags & LPASS_MACRO_FLAG_HAS_NPL_CLOCK) {
rx->npl = devm_clk_get(dev, "npl"); rx->npl = devm_clk_get(dev, "npl");
if (IS_ERR(rx->npl)) if (IS_ERR(rx->npl))
return PTR_ERR(rx->npl); return dev_err_probe(dev, PTR_ERR(rx->npl), "unable to get npl clock\n");
} }
rx->fsgen = devm_clk_get(dev, "fsgen"); rx->fsgen = devm_clk_get(dev, "fsgen");
if (IS_ERR(rx->fsgen)) if (IS_ERR(rx->fsgen))
return PTR_ERR(rx->fsgen); return dev_err_probe(dev, PTR_ERR(rx->fsgen), "unable to get fsgen clock\n");
rx->pds = lpass_macro_pds_init(dev); rx->pds = lpass_macro_pds_init(dev);
if (IS_ERR(rx->pds)) if (IS_ERR(rx->pds))
......
...@@ -1967,25 +1967,25 @@ static int tx_macro_probe(struct platform_device *pdev) ...@@ -1967,25 +1967,25 @@ static int tx_macro_probe(struct platform_device *pdev)
tx->macro = devm_clk_get_optional(dev, "macro"); tx->macro = devm_clk_get_optional(dev, "macro");
if (IS_ERR(tx->macro)) if (IS_ERR(tx->macro))
return PTR_ERR(tx->macro); return dev_err_probe(dev, PTR_ERR(tx->macro), "unable to get macro clock\n");
tx->dcodec = devm_clk_get_optional(dev, "dcodec"); tx->dcodec = devm_clk_get_optional(dev, "dcodec");
if (IS_ERR(tx->dcodec)) if (IS_ERR(tx->dcodec))
return PTR_ERR(tx->dcodec); return dev_err_probe(dev, PTR_ERR(tx->dcodec), "unable to get dcodec clock\n");
tx->mclk = devm_clk_get(dev, "mclk"); tx->mclk = devm_clk_get(dev, "mclk");
if (IS_ERR(tx->mclk)) if (IS_ERR(tx->mclk))
return PTR_ERR(tx->mclk); return dev_err_probe(dev, PTR_ERR(tx->mclk), "unable to get mclk clock\n");
if (flags & LPASS_MACRO_FLAG_HAS_NPL_CLOCK) { if (flags & LPASS_MACRO_FLAG_HAS_NPL_CLOCK) {
tx->npl = devm_clk_get(dev, "npl"); tx->npl = devm_clk_get(dev, "npl");
if (IS_ERR(tx->npl)) if (IS_ERR(tx->npl))
return PTR_ERR(tx->npl); return dev_err_probe(dev, PTR_ERR(tx->npl), "unable to get npl clock\n");
} }
tx->fsgen = devm_clk_get(dev, "fsgen"); tx->fsgen = devm_clk_get(dev, "fsgen");
if (IS_ERR(tx->fsgen)) if (IS_ERR(tx->fsgen))
return PTR_ERR(tx->fsgen); return dev_err_probe(dev, PTR_ERR(tx->fsgen), "unable to get fsgen clock\n");
tx->pds = lpass_macro_pds_init(dev); tx->pds = lpass_macro_pds_init(dev);
if (IS_ERR(tx->pds)) if (IS_ERR(tx->pds))
......
...@@ -1457,15 +1457,15 @@ static int va_macro_probe(struct platform_device *pdev) ...@@ -1457,15 +1457,15 @@ static int va_macro_probe(struct platform_device *pdev)
va->macro = devm_clk_get_optional(dev, "macro"); va->macro = devm_clk_get_optional(dev, "macro");
if (IS_ERR(va->macro)) if (IS_ERR(va->macro))
return PTR_ERR(va->macro); return dev_err_probe(dev, PTR_ERR(va->macro), "unable to get macro clock\n");
va->dcodec = devm_clk_get_optional(dev, "dcodec"); va->dcodec = devm_clk_get_optional(dev, "dcodec");
if (IS_ERR(va->dcodec)) if (IS_ERR(va->dcodec))
return PTR_ERR(va->dcodec); return dev_err_probe(dev, PTR_ERR(va->dcodec), "unable to get dcodec clock\n");
va->mclk = devm_clk_get(dev, "mclk"); va->mclk = devm_clk_get(dev, "mclk");
if (IS_ERR(va->mclk)) if (IS_ERR(va->mclk))
return PTR_ERR(va->mclk); return dev_err_probe(dev, PTR_ERR(va->mclk), "unable to get mclk clock\n");
va->pds = lpass_macro_pds_init(dev); va->pds = lpass_macro_pds_init(dev);
if (IS_ERR(va->pds)) if (IS_ERR(va->pds))
......
...@@ -2396,25 +2396,25 @@ static int wsa_macro_probe(struct platform_device *pdev) ...@@ -2396,25 +2396,25 @@ static int wsa_macro_probe(struct platform_device *pdev)
wsa->macro = devm_clk_get_optional(dev, "macro"); wsa->macro = devm_clk_get_optional(dev, "macro");
if (IS_ERR(wsa->macro)) if (IS_ERR(wsa->macro))
return PTR_ERR(wsa->macro); return dev_err_probe(dev, PTR_ERR(wsa->macro), "unable to get macro clock\n");
wsa->dcodec = devm_clk_get_optional(dev, "dcodec"); wsa->dcodec = devm_clk_get_optional(dev, "dcodec");
if (IS_ERR(wsa->dcodec)) if (IS_ERR(wsa->dcodec))
return PTR_ERR(wsa->dcodec); return dev_err_probe(dev, PTR_ERR(wsa->dcodec), "unable to get dcodec clock\n");
wsa->mclk = devm_clk_get(dev, "mclk"); wsa->mclk = devm_clk_get(dev, "mclk");
if (IS_ERR(wsa->mclk)) if (IS_ERR(wsa->mclk))
return PTR_ERR(wsa->mclk); return dev_err_probe(dev, PTR_ERR(wsa->mclk), "unable to get mclk clock\n");
if (flags & LPASS_MACRO_FLAG_HAS_NPL_CLOCK) { if (flags & LPASS_MACRO_FLAG_HAS_NPL_CLOCK) {
wsa->npl = devm_clk_get(dev, "npl"); wsa->npl = devm_clk_get(dev, "npl");
if (IS_ERR(wsa->npl)) if (IS_ERR(wsa->npl))
return PTR_ERR(wsa->npl); return dev_err_probe(dev, PTR_ERR(wsa->npl), "unable to get npl clock\n");
} }
wsa->fsgen = devm_clk_get(dev, "fsgen"); wsa->fsgen = devm_clk_get(dev, "fsgen");
if (IS_ERR(wsa->fsgen)) if (IS_ERR(wsa->fsgen))
return PTR_ERR(wsa->fsgen); return dev_err_probe(dev, PTR_ERR(wsa->fsgen), "unable to get fsgen clock\n");
base = devm_platform_ioremap_resource(pdev, 0); base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) if (IS_ERR(base))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment