]> 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>
Wed, 4 Jun 2025 12:41:52 +0000 (14:41 +0200)
commit35d77c8d887e1add6bdc56190f33bbbbbd24b12a
treea4856b9cc91330acec7a183dfdb9f4070fa74e77
parent497f19cacb3f8387a64ec4302111ed02da23da77
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