Skip to content

Commit

Permalink
clk: at91: fix clk_programmable_set_parent()
Browse files Browse the repository at this point in the history
Since commit 1bdf023 ("clk: at91: make use of syscon/regmap
internally"), clk_programmable_set_parent() is always selecting the
first parent (AKA slow_clk), no matter what's passed in the 'index'
parameter.

Fix that by initializing the pckr variable to the index value.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reported-by: Hans Verkuil <hans.verkuil@cisco.com>
Fixes: 1bdf023 ("clk: at91: make use of syscon/regmap internally")
Cc: <stable@vger.kernel.org>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/1468828152-18389-1-git-send-email-boris.brezillon@free-electrons.com
  • Loading branch information
Boris Brezillon authored and Michael Turquette committed Jul 19, 2016
1 parent 9d69286 commit f96423f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/at91/clk-programmable.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static int clk_programmable_set_parent(struct clk_hw *hw, u8 index)
struct clk_programmable *prog = to_clk_programmable(hw);
const struct clk_programmable_layout *layout = prog->layout;
unsigned int mask = layout->css_mask;
unsigned int pckr = 0;
unsigned int pckr = index;

if (layout->have_slck_mck)
mask |= AT91_PMC_CSSMCK_MCK;
Expand Down

0 comments on commit f96423f

Please sign in to comment.