]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvmem: core: update raw_len if the bit reading is required
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fri, 11 Apr 2025 11:22:48 +0000 (12:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2025 09:12:18 +0000 (11:12 +0200)
commit1c5e78d9cbf02ee0978c56e058d6b889a3e775be
tree61f549e0296f33bd48bf39791e2f790f8db599e4
parent05408a33d0e20d8ffde882b95418092aa2afa8fd
nvmem: core: update raw_len if the bit reading is required

[ Upstream commit 6786484223d5705bf7f919c1e5055d478ebeec32 ]

If NVMEM cell uses bit offset or specifies bit truncation, update
raw_len manually (following the cell->bytes update), ensuring that the
NVMEM access is still word-aligned.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20250411112251.68002-11-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvmem/core.c