drivers/sensor: stmemsc: make use of spi_dt_spec and i2c_dt_spec

Make use of the new DT facilities that introduced two new
bus structures, spi_dt_spec and i2c_dt_spec, as well as the
macros, SPI_DT_SPEC_INST_GET and I2C_DT_SPEC_INST_GET, to
retrieve info from DT.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit is contained in:
Armando Visconti 2021-09-07 10:27:49 +02:00 committed by Maureen Helm
commit dabaaa1e5d
13 changed files with 42 additions and 62 deletions

View file

@ -60,10 +60,10 @@ struct lis2dw12_device_config {
stmdev_ctx_t ctx;
union {
#if DT_ANY_INST_ON_BUS_STATUS_OKAY(i2c)
const struct stmemsc_cfg_i2c i2c;
const struct i2c_dt_spec i2c;
#endif
#if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi)
const struct stmemsc_cfg_spi spi;
const struct spi_dt_spec spi;
#endif
} stmemsc_cfg;
lis2dw12_mode_t pm;