From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Tony Prisk <linux@prisktech.co.nz>
Cc: Mike Turquette <mturquette@linaro.org>,
linux-kernel@vger.kernel.org,
Arm Kernel Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: Inconsistency in clk framework
Date: Wed, 19 Dec 2012 09:26:36 +0000 [thread overview]
Message-ID: <20121219092636.GW14363@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1355890233.25599.4.camel@gitbox>
On Wed, Dec 19, 2012 at 05:10:33PM +1300, Tony Prisk wrote:
> Hi Mike,
>
> In attempting to remove some IS_ERR_OR_NULL references, it was pointed
> out that clk_get() can return NULL if CONFIG_HAVE_CLK is not defined.
That is correct - but why is that a problem? As far as users are
concerned, NULL is a valid clock. If HAVE_CLK is undefined, do you
want all your drivers to suddenly stop working?
> This seems to contradict the kernel docs associated with the normal
> clk_get (when HAVE_CLK is defined) which states:
>
> * Returns a struct clk corresponding to the clock producer, or
> * valid IS_ERR() condition containing errno.
>
> Wouldn't a return code of ERR_PTR(-ENOENT) make more sense and be inline
> with the empty of_ versions as well (which return -ENOENT when CONFIG_OF
> is undefined).
No.
> Also, I noticed that clk_get_sys() doesn't appear to be defined in clk.h
> when HAVE_CLK is undefined - is this correct?
It was never promoted to an official API because its only platform code
which should be using it; no device driver (which should have a struct
device to pass into clk_get()) should ever use clk_get_sys().
next prev parent reply other threads:[~2012-12-19 9:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-19 4:10 Tony Prisk
2012-12-19 9:26 ` Russell King - ARM Linux [this message]
2012-12-19 17:34 ` Tony Prisk
2012-12-19 19:00 ` Tony Prisk
2012-12-19 19:08 ` Russell King - ARM Linux
2012-12-20 4:13 ` Tony Prisk
2012-12-20 9:40 ` Russell King - ARM Linux
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=20121219092636.GW14363@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@prisktech.co.nz \
--cc=mturquette@linaro.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
all inboxes | Powered by JetHome®