linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Mathias Kresin <dev@kresin.me>
Cc: Jonas Gorski <jonas.gorski@gmail.com>,
	Helmut Schaa <helmut.schaa@googlemail.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] rt2x00: call clk_get_rate only if we have a clock
Date: Mon, 10 Jul 2017 08:52:12 +0200	[thread overview]
Message-ID: <20170710065211.GA2808@redhat.com> (raw)
In-Reply-To: <f3744f76-9909-90a9-012d-ddafbda9ad4a@kresin.me>

On Sat, Jul 08, 2017 at 03:37:11PM +0200, Mathias Kresin wrote:
> 08.07.2017 13:15, Jonas Gorski:
> >to consumers, to have a consistent API across implementations (with
> >drivers/clk/clk.c as the reference).
> >
> >And there don't seem that many, at least searching for clk_get_rate
> >gave me only two handful of implementations of which many already
> >check for NULL.
> 
> I do not necessarily see an error in the archs legacy clock
> implementation. It rather looks like it works with the common clock
> framework due the lucky coincident that someone has added (an extra)
> null check.
> 
> I only had a brief look at the common clock framework, but it seams
> to me one should not pass the error returned by clk_get() and/or
> call clk_get_rate() at all if there was an error. That is what I've
> already seen and mentioned in the commit message.

> The only difference here is that we do not have the error check and
> the clk_get_rate() call in the same function. rt2800_clk_is_20mhz()
> isn't aware that clk_get() failed. rt2x00dev->clk is set back to
> NULL in rt2x00soc_probe() in case of an clk_get error.

If we need to check clk before clk_get_rate() call, we can remove NULL
assignment from rt2x00soc_probe() and use IS_ERR_OR_NULL() on
rt2800_clk_is_20mhz() .

Thanks
Stanislaw

  reply	other threads:[~2017-07-10  6:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-08  7:27 [PATCH] rt2x00: call clk_get_rate only if we have a clock Mathias Kresin
2017-07-08 11:15 ` Jonas Gorski
2017-07-08 13:37   ` Mathias Kresin
2017-07-10  6:52     ` Stanislaw Gruszka [this message]
2017-07-25 12:44 ` Kalle Valo

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=20170710065211.GA2808@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=dev@kresin.me \
    --cc=helmut.schaa@googlemail.com \
    --cc=jonas.gorski@gmail.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).