clk: sprd: set max_register according to mapping range
authorChunyan Zhang <chunyan.zhang@unisoc.com>
Thu, 16 Mar 2023 02:36:24 +0000 (10:36 +0800)
committerStephen Boyd <sboyd@kernel.org>
Thu, 16 Mar 2023 23:33:11 +0000 (16:33 -0700)
commit47d43086531f10539470a63e8ad92803e686a3dd
treeac5e2f26677e0c2bcf0163192579fdacdbddb9b6
parent5cf9d015be160e2d90d29ae74ef1364390e8fce8
clk: sprd: set max_register according to mapping range

In sprd clock driver, regmap_config.max_register was set to a fixed value
which is likely larger than the address range configured in device tree,
when reading registers through debugfs it would cause access violation.

Fixes: d41f59fd92f2 ("clk: sprd: Add common infrastructure")
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Link: https://lore.kernel.org/r/20230316023624.758204-1-chunyan.zhang@unisoc.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/sprd/common.c