From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Brownell <david-b@pacbell.net>,
Dmitry Baryshkov <dbaryshkov@gmail.com>,
linux-kernel@vger.kernel.org,
Haavard Skinnemoen <haavard.skinnemoen@atmel.com>,
Paul Mundt <lethal@linux-sh.org>,
pHilipp Zabel <philipp.zabel@gmail.com>,
Pavel Machek <pavel@ucw.cz>,
tony@atomide.com, paul@pwsan.com,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
ian <spyro@f2s.com>
Subject: Re: [PATCH 1/3] genclk: add generic framework for managing clocks.
Date: Mon, 14 Jul 2008 23:30:52 +0100 [thread overview]
Message-ID: <20080714223052.GA2469@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20080713142317.97111c81.akpm@linux-foundation.org>
On Sun, Jul 13, 2008 at 02:23:17PM -0700, Andrew Morton wrote:
> On Sun, 13 Jul 2008 14:12:32 -0700 David Brownell <david-b@pacbell.net> wrote:
>
> > On Saturday 12 July 2008, Andrew Morton wrote:
> > > > +EXPORT_SYMBOL(clk_get_parent);
> > >
> > > As this is a new kernel-wide utility library, it is appropriate that
> > > all of its public interfaces (at least) be documented. __An appropriate
> > > way of doing that is via kerneldoc annotation. __Please don't forget to
> > > document return values and call environment prerequisites (eg: requires
> > > foo_lock, may be called from interrupt context, etc, etc).
> >
> > That is, the stuff that's not already documented in <linux/clk.h>;
> > that's where clk_get_parent() is documented, for example.
>
> argh. That's why I missed it - please don't document stuff in header
> files. The usual approach is to document interfaces at the
> implementation site.
That doesn't work. In this case, linux/clk.h _is_ the only source of
the API. The API is just a defined set of functions.
How an architecture or machine class implements it is at the discressiom
of whoever's writing that code. The point being, that we have a fixed
core API which drivers can use which is portable across different SoCs.
However, there certainly are implementation specific issues which
architecture code needs to know about - hence why the implementation
has (until genclk) been left completely up to that code to decide and
implement the interface.
So, the only place for that documentation is the header file. Documenting
an implementation will just confuse the issue and lead people into thinking
that it somehow represents the way things should be done.
Even genclk doesn't represent "The Way Things Should Be Done" - it's just
yet another implementation of the interface.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
next prev parent reply other threads:[~2008-07-14 22:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-08 13:42 [PATCH 0/3] Genclk: generic framework for clocks managing [v3.1] Dmitry Baryshkov
2008-07-08 13:43 ` [PATCH 1/3] genclk: add generic framework for managing clocks Dmitry Baryshkov
2008-07-13 6:48 ` Andrew Morton
2008-07-13 20:53 ` Dmitry
2008-07-13 21:03 ` Andrew Morton
2008-07-13 21:12 ` David Brownell
2008-07-13 21:23 ` Andrew Morton
2008-07-13 21:54 ` David Brownell
2008-07-14 22:30 ` Russell King [this message]
2008-07-14 21:00 ` Dmitry Baryshkov
2008-07-08 13:43 ` [PATCH 2/3] Refactor arm/pxa to use generic clocks support Dmitry Baryshkov
2008-07-08 13:44 ` [PATCH 3/3] Clocklib: refactor SA-1100 to use clocklib Dmitry Baryshkov
2008-07-08 14:07 ` [PATCH 0/3] Genclk: generic framework for clocks managing [v3.1] Ben Dooks
2008-07-08 14:28 ` Dmitry Baryshkov
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=20080714223052.GA2469@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=akpm@linux-foundation.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=david-b@pacbell.net \
--cc=dbaryshkov@gmail.com \
--cc=haavard.skinnemoen@atmel.com \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=pavel@ucw.cz \
--cc=philipp.zabel@gmail.com \
--cc=spyro@f2s.com \
--cc=tony@atomide.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