mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
clk: microchip: mpfs: fix regmap_update_bits() mask/val order
mpfs_cfg_clk_set_rate() passes the mask and value arguments to
regmap_update_bits() in the wrong order. The resulting write becomes
reg = orig_reg | val, causing bits to not be cleared if the clock
divider changes.
Pass the arguments in the correct order so the divider field is updated
as intended.
Fixes: c6f2dddfa7 ("clk: microchip: mpfs: use regmap for clocks")
Signed-off-by: Pedro Kopper <pedro.kopper@microchip.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Cc: stable@vger.kernel.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
39c0e6c844
commit
fbfa013eea
|
|
@ -285,7 +285,7 @@ static int mpfs_cfg_clk_set_rate(struct clk_hw *hw, unsigned long rate, unsigned
|
|||
|
||||
mask = clk_div_mask(cfg->width) << cfg->shift;
|
||||
val = divider_setting << cfg->shift;
|
||||
regmap_update_bits(cfg->map, cfg->map_offset, val, mask);
|
||||
regmap_update_bits(cfg->map, cfg->map_offset, mask, val);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user