]> www.infradead.org Git - users/jedix/linux-maple.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Apr 2023 10:35:07 +0000 (12:35 +0200)
commitb8f3162579e17b448d3f1f18924d50d0ae16f062
tree9122ab9fe70f3f9193d1bcfc065363226ab70674
parent8d901a336302324742bd800f8402d3c0e781c8ff
clk: sprd: set max_register according to mapping range

[ Upstream commit 47d43086531f10539470a63e8ad92803e686a3dd ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/sprd/common.c