From: Stephen Boyd <sboyd@codeaurora.org>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Rob Herring <robh@kernel.org>,
linux-clk <linux-clk@vger.kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: of_clk_add_(hw_)providers multipule times for one node?
Date: Wed, 24 Aug 2016 11:08:06 -0700 [thread overview]
Message-ID: <20160824180806.GE19826@codeaurora.org> (raw)
In-Reply-To: <CAK7LNAThC-oBV5qNRNLnkV_tS7JLZDVoeEYrJo_8LsbRftELew@mail.gmail.com>
(Please trim replies)
On 08/24, Masahiro Yamada wrote:
>
> Looks like the whole of my series was rejected,
> but I was not sure why the following one was rejected.
> https://patchwork.kernel.org/patch/9236563/
>
Replying to that patch would have been better.
>
> Could you explain why -EPROBE_DEFER should be returned
> if both .get_hw and .get are missing.
That's just a bug. Perhaps this patch would be better, and look,
it saves 5 lines.
---8<----
drivers/clk/clk.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 71cc56712666..d3d26148cdfb 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3174,19 +3174,14 @@ __of_clk_get_hw_from_provider(struct of_clk_provider *provider,
struct of_phandle_args *clkspec)
{
struct clk *clk;
- struct clk_hw *hw = ERR_PTR(-EPROBE_DEFER);
- if (provider->get_hw) {
- hw = provider->get_hw(clkspec, provider->data);
- } else if (provider->get) {
- clk = provider->get(clkspec, provider->data);
- if (!IS_ERR(clk))
- hw = __clk_get_hw(clk);
- else
- hw = ERR_CAST(clk);
- }
+ if (provider->get_hw)
+ return provider->get_hw(clkspec, provider->data);
- return hw;
+ clk = provider->get(clkspec, provider->data);
+ if (IS_ERR(clk))
+ return ERR_CAST(clk);
+ return __clk_get_hw(clk);
}
struct clk *__of_clk_get_from_provider(struct of_phandle_args *clkspec,
>
>
> Is there a way to register an OF clk provider without .get(_hw),
> but fill it later or something?
>
No.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2016-08-24 18:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-08 17:23 of_clk_add_(hw_)providers multipule times for one node? Masahiro Yamada
2016-08-04 21:25 ` Stephen Boyd
2016-08-04 22:02 ` Rob Herring
2016-08-07 16:54 ` Masahiro Yamada
2016-08-08 9:00 ` Geert Uytterhoeven
2016-08-08 23:37 ` Stephen Boyd
2016-08-10 7:59 ` Masahiro Yamada
2016-08-10 23:08 ` Stephen Boyd
2016-08-12 7:04 ` Masahiro Yamada
2016-08-24 7:11 ` Masahiro Yamada
2016-08-24 18:08 ` Stephen Boyd [this message]
2016-08-25 2:36 ` Masahiro Yamada
2016-08-25 20:30 ` Stephen Boyd
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=20160824180806.GE19826@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=robh@kernel.org \
--cc=yamada.masahiro@socionext.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