@@ -52,7 +52,7 @@ static int bmp388_transceive(const struct device *dev,
5252 const struct spi_buf buf = { .buf = data , .len = length };
5353 const struct spi_buf_set s = { .buffers = & buf , .count = 1 };
5454
55- return spi_transceive ( cfg -> bus , & cfg -> spi_cfg , & s , & s );
55+ return spi_transceive_dt ( & cfg -> spi_bus , & s , & s );
5656}
5757
5858static int bmp388_read_spi (const struct device * dev ,
@@ -71,7 +71,7 @@ static int bmp388_read_spi(const struct device *dev,
7171 const struct spi_buf_set tx = { .buffers = buf , .count = 1 };
7272 const struct spi_buf_set rx = { .buffers = buf , .count = 2 };
7373
74- return spi_transceive ( cfg -> bus , & cfg -> spi_cfg , & tx , & rx );
74+ return spi_transceive_dt ( & cfg -> spi_bus , & tx , & rx );
7575}
7676
7777static int bmp388_byte_read_spi (const struct device * dev ,
@@ -602,10 +602,10 @@ static int bmp388_init(const struct device *dev)
602602 }
603603
604604#if DT_ANY_INST_ON_BUS_STATUS_OKAY (spi )
605- /* Verify that the CS device is ready if it is set in the DT. */
606- if (is_spi && ( cfg -> spi_cfg . cs != NULL ) ) {
607- if (!device_is_ready ( cfg -> spi_cfg . cs -> gpio_dev )) {
608- LOG_ERR ("SPI CS device is not ready" );
605+ /* Verify the SPI bus */
606+ if (is_spi ) {
607+ if (!spi_is_ready ( & cfg -> spi_bus )) {
608+ LOG_ERR ("SPI bus is not ready" );
609609 return - ENODEV ;
610610 }
611611 }
@@ -694,7 +694,7 @@ static int bmp388_init(const struct device *dev)
694694
695695#define BMP388_BUS_CFG_SPI (inst ) \
696696 .ops = &bmp388_spi_ops, \
697- .spi_cfg = SPI_CONFIG_DT_INST (inst, SPI_OP_MODE_MASTER | SPI_WORD_SET(8), 0)
697+ .spi_bus = SPI_DT_SPEC_INST_GET (inst, SPI_OP_MODE_MASTER | SPI_WORD_SET(8), 0)
698698
699699#define BMP388_BUS_CFG (inst ) \
700700 COND_CODE_1(DT_INST_ON_BUS(inst, i2c), \
0 commit comments