From: David Lechner <david@lechnology.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>,
Russell King <linux@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Sekhar Nori <nsekhar@ti.com>, Kevin Hilman <khilman@baylibre.com>
Subject: Re: [PATCH] clk: don't call __of_clk_get_by_name() unnecessarily from clk_get()
Date: Mon, 12 Feb 2018 14:51:57 -0600 [thread overview]
Message-ID: <36b4b8a0-0254-c6fa-c84f-ceab20c326ad@lechnology.com> (raw)
In-Reply-To: <20180212142439.15885-1-brgl@bgdev.pl>
On 02/12/2018 08:24 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> The way this function is implemented caused some confusion when
> converting the TI DaVinci platform to using the common clock framework.
>
> Current kernel supports booting DaVinci boards both in device tree as
> well as legacy, board-file mode. In the latter, we always end up
> calling clk_get_sys() as of_node is NULL and __of_clk_get_by_name()
> returns -ENOENT.
>
> It was not obvious at first glance how clk_get(dev, NULL) will work in
> board-file mode since we always call __of_clk_get_by_name(). Let's make
> it clearer by checking if of_node is NULL and skipping right to
> clk_get_sys().
>
> Cc: Sekhar Nori <nsekhar@ti.com>
> Cc: Kevin Hilman <khilman@baylibre.com>
> Cc: David Lechner <david@lechnology.com>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
> drivers/clk/clkdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
> index 7513411140b6..f394e8964909 100644
> --- a/drivers/clk/clkdev.c
> +++ b/drivers/clk/clkdev.c
> @@ -199,7 +199,7 @@ struct clk *clk_get(struct device *dev, const char *con_id)
> const char *dev_id = dev ? dev_name(dev) : NULL;
> struct clk *clk;
>
> - if (dev) {
> + if (dev && dev->of_node) {
> clk = __of_clk_get_by_name(dev->of_node, dev_id, con_id);
> if (!IS_ERR(clk) || PTR_ERR(clk) == -EPROBE_DEFER)
> return clk;
>
Shouldn't you be sending this to the linux-clk mailing list and cc'ing
the clock maintainers?
FWIW, it seems pretty clear to me that if we are using a board file
then we should expect clk_get_sys() to be called because there is
no device tree.
next prev parent reply other threads:[~2018-02-12 20:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-12 14:24 Bartosz Golaszewski
2018-02-12 20:51 ` David Lechner [this message]
2018-02-12 21:00 ` Russell King - ARM Linux
2018-02-12 21:19 ` David Lechner
2018-03-19 15:42 ` Bartosz Golaszewski
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=36b4b8a0-0254-c6fa-c84f-ceab20c326ad@lechnology.com \
--to=david@lechnology.com \
--cc=bgolaszewski@baylibre.com \
--cc=brgl@bgdev.pl \
--cc=khilman@baylibre.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=nsekhar@ti.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
all inboxes | Powered by JetHome®