Skip to content

feat(PeriphDrivers): Avoid div-by-zero in SPI SetFrequency calls#1552

Merged
ttmut merged 1 commit into
analogdevicesinc:mainfrom
petejohanson-adi:spi-set-frequency-avoid-div-by-zero
May 12, 2026
Merged

feat(PeriphDrivers): Avoid div-by-zero in SPI SetFrequency calls#1552
ttmut merged 1 commit into
analogdevicesinc:mainfrom
petejohanson-adi:spi-set-frequency-avoid-div-by-zero

Conversation

@petejohanson-adi

@petejohanson-adi petejohanson-adi commented May 5, 2026

Copy link
Copy Markdown
Collaborator

Description

Add a check on the frequency during SetFrequency to avoid a divide-by-zero.

This has been tested locally from the Zephyr driver consuming this API. In particular, working on adding target support, we may be initializing without a known frequency, so may be passing a value of zero.

Checklist Before Requesting Review

  • PR Title follows correct guidelines.
  • Description of changes and all other relevant information.
  • (Optional) Link any related GitHub issues using a keyword
  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

Add a check on the frequency during SetFrequency to avoid a
divide-by-zero.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
@petejohanson-adi petejohanson-adi requested a review from ttmut May 6, 2026 15:56
@ttmut ttmut merged commit 6d5ef04 into analogdevicesinc:main May 12, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants