From: David Miller <davem@davemloft.net>
To: peppe.cavallaro@st.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH (net.git)] stmmac: ptp: fix the reference clock
Date: Wed, 27 Aug 2014 16:26:52 -0700 (PDT) [thread overview]
Message-ID: <20140827.162652.544817209778584023.davem@davemloft.net> (raw)
In-Reply-To: <1409033072-10508-1-git-send-email-peppe.cavallaro@st.com>
From: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Date: Tue, 26 Aug 2014 08:04:32 +0200
> @@ -638,6 +638,15 @@ static int stmmac_init_ptp(struct stmmac_priv *priv)
> if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp))
> return -EOPNOTSUPP;
>
> + /* Fall-back to main clock in case of no PTP ref is passed */
> + priv->clk_ptp_ref = devm_clk_get(priv->device, "clk_ptp_ref");
> + if (IS_ERR(priv->clk_ptp_ref)) {
> + priv->clk_ptp_rate = clk_get_rate(priv->stmmac_clk);
This code path will leave an IS_ERR() value in clk_ptp_ref.
...
> static void stmmac_release_ptp(struct stmmac_priv *priv)
> {
> + if (priv->clk_ptp_ref)
> + clk_disable_unprepare(priv->clk_ptp_ref);
> stmmac_ptp_unregister(priv);
> }
Which this code will erroneously pass into clk_disable_unprepare().
Please NULL the pointer out properl when devm_clk_get() errors.
Thanks.
next prev parent reply other threads:[~2014-08-27 23:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-26 6:04 [PATCH (net.git)] stmmac: ptp: fix the reference clock Giuseppe Cavallaro
2014-08-27 8:37 ` [PATCH (net.git) (v2)] " Giuseppe Cavallaro
2014-08-30 2:55 ` David Miller
2014-08-27 23:26 ` David Miller [this message]
2014-08-28 6:02 ` [PATCH (net.git)] " Giuseppe CAVALLARO
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=20140827.162652.544817209778584023.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox