nvmem: core: Handle shift bits in-place if cell->nbits is non-zero

It's pointless to test (cell->bit_offset || cell->bit_offset).
nvmem_shift_read_buffer_in_place() should be called when
(cell->bit_offset || cell->nbits).

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Axel Lin 2015-09-30 13:35:15 +01:00 committed by Greg Kroah-Hartman
parent 7c806883e1
commit cbf854ab36
1 changed files with 1 additions and 1 deletions

View File

@ -825,7 +825,7 @@ static int __nvmem_cell_read(struct nvmem_device *nvmem,
return rc;
/* shift bits in-place */
if (cell->bit_offset || cell->bit_offset)
if (cell->bit_offset || cell->nbits)
nvmem_shift_read_buffer_in_place(cell, buf);
*len = cell->bytes;