]> Git Repo - linux.git/commitdiff
ARM: 8778/1: clkdev: don't call __of_clk_get_by_name() unnecessarily from clk_get()
authorBartosz Golaszewski <[email protected]>
Thu, 28 Jun 2018 14:42:20 +0000 (15:42 +0100)
committerRussell King <[email protected]>
Mon, 13 Aug 2018 15:27:52 +0000 (16:27 +0100)
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 <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: David Lechner <[email protected]>
Reviewed-by: David Lechner <[email protected]>
Reviewed-by: Sekhar Nori <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Russell King <[email protected]>
drivers/clk/clkdev.c

index 02fcee2012e0525089e3f2be83e234e88166f019..9ab3db8b3988375d02b88c5e76f0843a9a6c475f 100644 (file)
@@ -196,7 +196,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;
This page took 0.055816 seconds and 4 git commands to generate.