@@ -52,7 +52,7 @@ static int bmp388_transceive(const struct device *dev,
52
52
const struct spi_buf buf = { .buf = data , .len = length };
53
53
const struct spi_buf_set s = { .buffers = & buf , .count = 1 };
54
54
55
- return spi_transceive ( cfg -> bus , & cfg -> spi_cfg , & s , & s );
55
+ return spi_transceive_dt ( & cfg -> spi_bus , & s , & s );
56
56
}
57
57
58
58
static int bmp388_read_spi (const struct device * dev ,
@@ -71,7 +71,7 @@ static int bmp388_read_spi(const struct device *dev,
71
71
const struct spi_buf_set tx = { .buffers = buf , .count = 1 };
72
72
const struct spi_buf_set rx = { .buffers = buf , .count = 2 };
73
73
74
- return spi_transceive ( cfg -> bus , & cfg -> spi_cfg , & tx , & rx );
74
+ return spi_transceive_dt ( & cfg -> spi_bus , & tx , & rx );
75
75
}
76
76
77
77
static int bmp388_byte_read_spi (const struct device * dev ,
@@ -602,10 +602,10 @@ static int bmp388_init(const struct device *dev)
602
602
}
603
603
604
604
#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" );
609
609
return - ENODEV ;
610
610
}
611
611
}
@@ -694,7 +694,7 @@ static int bmp388_init(const struct device *dev)
694
694
695
695
#define BMP388_BUS_CFG_SPI (inst ) \
696
696
.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)
698
698
699
699
#define BMP388_BUS_CFG (inst ) \
700
700
COND_CODE_1(DT_INST_ON_BUS(inst, i2c), \
0 commit comments