Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d6c15ed2 authored by Doug Anderson's avatar Doug Anderson Committed by Lee Jones
Browse files

mfd: cros_ec: Use the proper size when looking at the cros_ec_i2c result



We know how many bytes the EC should be sending us (which is also the
number of bytes transferred) and also how many bytes the EC actually
wanted to send to us.  When computing the checksum and copying back
data let's make sure we take the lesser of the two of those.  We'll
also complain if the EC tried to send us too many bytes.  The EC
sending us too few bytes is legit for when we send the EC an invalid
command.

This is based on similar code in cros_ec_spi.

Signed-off-by: default avatarDoug Anderson <dianders@chromium.org>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 7ccf40b1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment