Skip to content
Commit 2f3a70ea authored by Dane Wagner's avatar Dane Wagner Committed by Anas Nashif
Browse files

drivers: i2c: Call correct I2C device definition macros



If CONFIG_I2C_STATS is enabled, the device state for all I2C controller
drivers must contain the I2C stats. This space is allocated by calling
Z_I2C_INIT_FN as part of the device definition; this is done automatically
when using I2C_DEVICE_DT_DEFINE instead of DEVICE_DT_DEFINE. If space
for statistics is not properly allocated but CONFIG_I2C_STATS is enabled,
an unexpected write to memory outside of the stats region may occur on
an I2C transfer. This commit uses I2C_DEVICE_DT_DEFINE or
I2C_DEVICE_DT_INST_DEFINE for all in-tree SPI controller drivers that do
not already.

Signed-off-by: default avatarDane Wagner <dane.wagner@gmail.com>
parent a785548d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment