Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pw_spi_linux: Avoid unneccessary ioctl()s in Configure()
Initiator::Configure() is called on every Device::WriteRead() call, in case different devices on the bus use different configuration. Avoid unnecessary ioctl() calls by recording the current configuration and skipping Configure() if the new config is not actually different. If the pw::spi::Initiator base class were using the non-virtual interface (NVI) pattern, this could be implemented there and apply to all initiator implementations. Test: Verified downstream project still works and redundant ioctls no longer happen Bug: 366541694 Change-Id: Ic173cd1f895ea398c7e33df8fe8b4a5b05d2e8cf Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235877 Reviewed-by: Andrew Harper <[email protected]> Commit-Queue: Jonathon Reinhart <[email protected]> Docs-Not-Needed: Jonathon Reinhart <[email protected]> Reviewed-by: Jesus Sanchez-Palencia <[email protected]> Lint: Lint 🤖 <[email protected]>
- Loading branch information