diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-13 19:15:48 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-13 19:15:48 -0700 |
commit | c2d9f5bc2db49bcc2e055340941b1873b74dfb5d (patch) | |
tree | acc80ecf4d1eea56bf741786f4ee8feece996f7d /drivers/clk | |
parent | 9b27efe08180444e66c0922f89f3f883f4f9e35e (diff) | |
parent | 53ccb22b8d4a9293cf4249f3b526892810038fd3 (diff) |
Merge branch 'clkdev' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM clkdev updates from Russell King:
"A couple of cleanups for clkdev"
* 'clkdev' of git://git.armlinux.org.uk/~rmk/linux-arm:
ARM: 8778/1: clkdev: don't call __of_clk_get_by_name() unnecessarily from clk_get()
ARM: 8776/1: clkdev: Remove duplicated negative index check from __of_clk_get()
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/clkdev.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index 7513411140b6..9ab3db8b3988 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c @@ -35,9 +35,6 @@ static struct clk *__of_clk_get(struct device_node *np, int index, struct clk *clk; int rc; - if (index < 0) - return ERR_PTR(-EINVAL); - rc = of_parse_phandle_with_args(np, "clocks", "#clock-cells", index, &clkspec); if (rc) @@ -199,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; |