From: Stephen Boyd <sboyd@kernel.org>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: kbuild test robot <lkp@intel.com>,
kbuild-all@01.org, Michael Turquette <mturquette@baylibre.com>,
Russell King <linux@armlinux.org.uk>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Antoine Tenart <antoine.tenart@bootlin.com>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
Gregory Clement <gregory.clement@bootlin.com>,
Nadav Haklai <nadavh@marvell.com>
Subject: Re: [PATCH 2/2] clk: core: link consumer with clock driver
Date: Mon, 03 Dec 2018 11:20:31 -0800 [thread overview]
Message-ID: <154386483105.88331.13970025193347328031@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <20181130112052.73d943ec@xps13>
Quoting Miquel Raynal (2018-11-30 02:20:52)
> Hi Stephen,
>
> Stephen Boyd <sboyd@kernel.org> wrote on Fri, 30 Nov 2018 01:26:20
> -0800:
>
> > Quoting Miquel Raynal (2018-11-23 01:11:32)
> > > Would you agree with me adding dummy functions in the #else section
> > > like:
> > >
> > > static inline void __clk_device_link(struct device *consumer, struct clk *clk)
> > > {
> > > return;
> > > }
> > >
> > > static inline void __clk_device_unlink(struct clk *clk)
> > > {
> > > return;
> > > }
> > >
> > > Do you want me to also declare these functions in the #if section
> > > (with the external keyword) to balance the above declarations?
> >
> > Why can't we do the linking in __clk_get() and __clk_put()?
> >
>
> Because we need the caller's 'struct device' to make the link and
> this is not available in __clk_get(). I tried to ad it as parameter but
> I don't think it is possible to retrieve a 'struct device' from the
> device name. The functions where this is problematic are:
> * clk.c:__of_clk_get_from_provider()
> * clkdev.c:clk_get_sys()
>
> By the way in my new version I called the helpers:
> * clk_{link,unlink}_hierarchy()
> * clk_{link,unlink}_consumer()
>
> I will send a new version with these helpers, but if you have anything
> in mind to help me achieve the above request, I will welcome the idea.
>
We can do the linking in __clk_get() and __clk_put() if we poke into the
struct clk -> struct clk_core and bury the struct device into each
clk_core structure.
next prev parent reply other threads:[~2018-12-03 19:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 21:22 [PATCH 0/2] Link consumer with clock driver Miquel Raynal
2018-11-22 21:22 ` [PATCH 1/2] clk: core: clarify the check for runtime PM Miquel Raynal
2018-11-22 21:22 ` [PATCH 2/2] clk: core: link consumer with clock driver Miquel Raynal
2018-11-23 8:30 ` kbuild test robot
2018-11-23 9:11 ` Miquel Raynal
2018-11-30 9:26 ` Stephen Boyd
2018-11-30 10:20 ` Miquel Raynal
2018-12-03 19:20 ` Stephen Boyd [this message]
2018-12-03 22:16 ` Miquel Raynal
2018-12-03 22:28 ` Stephen Boyd
2018-11-27 12:38 ` Maxime Ripard
2018-11-29 16:03 ` Miquel Raynal
2018-11-30 9:24 ` [PATCH 0/2] Link " Stephen Boyd
2018-11-30 12:00 ` Miquel Raynal
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=154386483105.88331.13970025193347328031@swboyd.mtv.corp.google.com \
--to=sboyd@kernel.org \
--cc=antoine.tenart@bootlin.com \
--cc=gregory.clement@bootlin.com \
--cc=kbuild-all@01.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lkp@intel.com \
--cc=maxime.chevallier@bootlin.com \
--cc=miquel.raynal@bootlin.com \
--cc=mturquette@baylibre.com \
--cc=nadavh@marvell.com \
--cc=thomas.petazzoni@bootlin.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;
as well as URLs for NNTP newsgroup(s).