diff options
author | Caveh Jalali <caveh@chromium.org> | 2021-09-21 22:56:05 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-26 01:20:49 +0000 |
commit | 8e132f7c5b61466bcca6d7ab7403f44611cbd032 (patch) | |
tree | b69633aca7fe2da2b7c83e2a362a6627b2c8b17d /include/charger.h | |
parent | ae0593a3d10e60ea3fe8aa8159458e2dfb290292 (diff) | |
download | chrome-ec-8e132f7c5b61466bcca6d7ab7403f44611cbd032.tar.gz |
common/i2c: Improve port number validation in i2c_set_freq
This adds additional checks to the port number validation in
i2c_set_freq. get_i2c_port could potentially return a NULL pointer, so
check for that. Also, when DYNAMIC_SPEED is not enabled on a port,
return ERROR_UNIMPLEMENTED instead of ERROR_INVAL.
BRANCH=none
BUG=b:201039003
TEST=with follow-on patches, switched I2C bus speed between 400 kHz
and 1 MHz.
Change-Id: Ie58d68ee2b64d94681ea1d5044530195210ff661
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3181503
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Diffstat (limited to 'include/charger.h')
0 files changed, 0 insertions, 0 deletions