All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@prisktech.co.nz (Tony Prisk)
To: linux-arm-kernel@lists.infradead.org
Subject: Inconsistency in clk framework
Date: Wed, 19 Dec 2012 17:10:33 +1300	[thread overview]
Message-ID: <1355890233.25599.4.camel@gitbox> (raw)

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.

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).

Also, I noticed that clk_get_sys() doesn't appear to be defined in clk.h
when HAVE_CLK is undefined - is this correct?

Regards
Tony Prisk

WARNING: multiple messages have this Message-ID (diff)
From: Tony Prisk <linux@prisktech.co.nz>
To: Mike Turquette <mturquette@linaro.org>
Cc: Arm Kernel Mailing List <linux-arm-kernel@lists.infradead.org>,
	linux-kernel@vger.kernel.org
Subject: Inconsistency in clk framework
Date: Wed, 19 Dec 2012 17:10:33 +1300	[thread overview]
Message-ID: <1355890233.25599.4.camel@gitbox> (raw)

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.

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).

Also, I noticed that clk_get_sys() doesn't appear to be defined in clk.h
when HAVE_CLK is undefined - is this correct?

Regards
Tony Prisk


             reply	other threads:[~2012-12-19  4:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19  4:10 Tony Prisk [this message]
2012-12-19  4:10 ` Inconsistency in clk framework Tony Prisk
2012-12-19  9:26 ` Russell King - ARM Linux
2012-12-19  9:26   ` Russell King - ARM Linux
2012-12-19 17:34   ` Tony Prisk
2012-12-19 17:34     ` Tony Prisk
2012-12-19 19:00     ` Tony Prisk
2012-12-19 19:00       ` Tony Prisk
2012-12-19 19:08       ` Russell King - ARM Linux
2012-12-19 19:08         ` Russell King - ARM Linux
2012-12-20  4:13         ` Tony Prisk
2012-12-20  4:13           ` Tony Prisk
2012-12-20  9:40           ` Russell King - ARM Linux
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=1355890233.25599.4.camel@gitbox \
    --to=linux@prisktech.co.nz \
    --cc=linux-arm-kernel@lists.infradead.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 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.