-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: eeprom: at2x: streamline codebase #80660
drivers: eeprom: at2x: streamline codebase #80660
Conversation
To maintain consistency in `init_fn` parameter passing, remove the address-of operator ('&') when assigning the `init_fn` function pointer in the `DEVICE_DT_INST_DEFINE` macro. Signed-off-by: Pisit Sawangvonganan <[email protected]>
Remove orphaned `k_mutex_unlock` in `eeprom_at25_read` as the lock/unlock pair is handled in `eeprom_at2x_read` instead. Signed-off-by: Pisit Sawangvonganan <[email protected]>
35ca62b
to
4c68fd3
Compare
drivers/eeprom/eeprom_at2x.c
Outdated
const struct spi_buf tx_buf = { | ||
.buf = &cmd, | ||
static const uint8_t cmd = EEPROM_AT25_WREN; | ||
static const struct spi_buf tx_buf = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure the static const
changes are okay. Some SPI-controller drivers may be using DMA yet unable to DMA transfer from flash. I'd prefer to leave these as-is.
@ndrs-pst Any plans for picking up this PR and addressing the requested change? |
That means, even if it uses synchronous APIs and does not involve DMA transfers, it would not be justified. |
4c68fd3
to
ed9048c
Compare
This PR includes 2 changes to the
eeprom_at2x.c
file as follows:init_fn
inDEVICE_DT_INST_DEFINE
macrok_mutex_unlock
ineeprom_at25_read