From: Dan Carpenter <dan.carpenter@oracle.com>
To: codrin.ciubotariu@microchip.com
Cc: alsa-devel@alsa-project.org
Subject: [bug report] ASoC: mchp-spdifrx: add driver for SPDIF RX
Date: Thu, 3 Dec 2020 17:58:36 +0300 [thread overview]
Message-ID: <X8j9HPrdXRy5IDvd@mwanda> (raw)
Hello Codrin Ciubotariu,
The patch ef265c55c1ac: "ASoC: mchp-spdifrx: add driver for SPDIF RX"
from Oct 2, 2020, leads to the following static checker warning:
sound/soc/atmel/mchp-spdifrx.c:468 mchp_spdifrx_hw_params()
warn: 'dev->gclk' not released on lines: 468.
sound/soc/atmel/mchp-spdifrx.c
442 params_format(params));
443 return -EINVAL;
444 }
445
446 if (dev->gclk_enabled) {
447 clk_disable_unprepare(dev->gclk);
448 dev->gclk_enabled = 0;
449 }
450 ret = clk_set_min_rate(dev->gclk, params_rate(params) *
451 SPDIFRX_GCLK_RATIO_MIN + 1);
452 if (ret) {
453 dev_err(dev->dev,
454 "unable to set gclk min rate: rate %u * ratio %u + 1\n",
455 params_rate(params), SPDIFRX_GCLK_RATIO_MIN);
456 return ret;
457 }
458 ret = clk_prepare_enable(dev->gclk);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
459 if (ret) {
460 dev_err(dev->dev, "unable to enable gclk: %d\n", ret);
461 return ret;
462 }
463 dev->gclk_enabled = 1;
464
465 dev_dbg(dev->dev, "GCLK range min set to %d\n",
466 params_rate(params) * SPDIFRX_GCLK_RATIO_MIN + 1);
467
468 return regmap_write(dev->regmap, SPDIFRX_MR, mr);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Smatch is complaining that if the regmap_write() fails then we should
disable and unprepare the "dev->gclk".
469 }
regards,
dan carpenter
next reply other threads:[~2020-12-03 15:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 14:58 Dan Carpenter [this message]
2020-12-03 15:31 ` [bug report] ASoC: mchp-spdifrx: add driver for SPDIF RX Codrin.Ciubotariu
2020-12-03 18:38 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=X8j9HPrdXRy5IDvd@mwanda \
--to=dan.carpenter@oracle.com \
--cc=alsa-devel@alsa-project.org \
--cc=codrin.ciubotariu@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.