Skip to content

Commit

Permalink
Merge branch 'clkdev' of git://git.armlinux.org.uk/~rmk/linux-arm
Browse files Browse the repository at this point in the history
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()
  • Loading branch information
torvalds committed Aug 14, 2018
2 parents 9b27efe + 53ccb22 commit c2d9f5b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/clk/clkdev.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit c2d9f5b

Please sign in to comment.