]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/rockchip: vop2: use devm_regmap_field_alloc for cluster-regs
authorAndy Yan <andy.yan@rock-chips.com>
Tue, 18 Feb 2025 11:27:28 +0000 (19:27 +0800)
committerHeiko Stuebner <heiko@sntech.de>
Sun, 2 Mar 2025 18:32:00 +0000 (19:32 +0100)
commitff0b6c031ed3ed31024618340c795523a86e6688
tree2d16ad3ad28538a95faf46c123c249d9ff7d5ce4
parent2800028d5bdee8e9a3cda2fec782dadc32225d8d
drm/rockchip: vop2: use devm_regmap_field_alloc for cluster-regs

Right now vop2_cluster_init() copies the base vop2_cluster_regs
and adapts the reg value with the current window's offset before
adding the fields to the regmap.

This conflicts with the notion of reg_fields being const, see
https://lore.kernel.org/all/20240706-regmap-const-structs-v1-1-d08c776da787@weissschuh.net/
for reference, which now causes checkpatch to actually warn about that.

So instead of creating one big copy and changing it afterwards,
add the reg_fields individually using devm_regmap_field_alloc().

Functional it is the same, just that the reg_field we're handling
can stay const.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20250218112744.34433-2-andyshrk@163.com
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c