summaryrefslogtreecommitdiffstats
path: root/i2c_helper_linux.c
Commit message (Collapse)AuthorAgeFilesLines
* i2c_helper_linux.c: Use a fixed-size bufferAngel Pons2021-04-181-20/+9
| | | | | | | | | | | | | Given that the buffer size is known in advance, using malloc() is not necessary. To avoid open-coding buffer sizes, add some trailing null characters to `I2C_DEV_PREFIX`, as placeholders for bus number digits. Finally, replace the now-unnecessary `goto` statements with `return`. Change-Id: I6060749c6ded10949344caee3cc3943306e74a1c Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/52415 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* Fix building with musl libcEvgeny Zinoviev2021-02-071-1/+1
| | | | | | | | | | | | AFAIK, this shouldn't break anything, as glibc just includes fcntl.h from sys/fcntl.h. Change-Id: Ie74ae584619ae8cbc188855aedcf5596d7afcfc8 Signed-off-by: Evgeny Zinoviev <me@ch1p.io> Reviewed-on: https://review.coreboot.org/c/flashrom/+/48314 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* i2c_helper: Add support for the Linux I2C subsystemShiyu Sun2020-04-011-0/+113
See https://www.kernel.org/doc/Documentation/i2c/ for details. This creates common interface for I2C access functions, and adds implementation for linux I2C functions. BUG=b:148746232 BRANCH=none TEST=build success Signed-off-by: Shiyu Sun <sshiyu@chromium.org> Change-Id: Ie0487824dfb71970bede17f617dbbb30ddf78c12 Reviewed-on: https://review.coreboot.org/c/flashrom/+/39686 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>