]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 8778/1: clkdev: don't call __of_clk_get_by_name() unnecessarily from clk_get()
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 28 Jun 2018 14:42:20 +0000 (15:42 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Mon, 13 Aug 2018 15:27:52 +0000 (16:27 +0100)
commit2b4a4c509a70ef80bf35501dd2c34b52f604a25e
tree2c4392ee175bbac3e4b4a12102d4b3052fcd6518
parent3d0b1131ea37b95d2cb42067962a47b2bd4cfa7d
ARM: 8778/1: clkdev: don't call __of_clk_get_by_name() unnecessarily from clk_get()

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>
Reviewed-by: David Lechner <david@lechnology.com>
Reviewed-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
drivers/clk/clkdev.c