Skip to content

Commit 4ec229f

Browse files
committed
drivers: i2s: nrfx: fix incorrect direction check
I2S direction was not checked correctly in the i2s_nrfx_configure function. This patch also fixes coverity issue 238365. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 35b1a6f commit 4ec229f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/i2s/i2s_nrfx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,11 @@ static int i2s_nrfx_configure(const struct device *dev, enum i2s_dir dir,
399399

400400
if (i2s_cfg->frame_clk_freq == 0) { /* -> reset state */
401401
purge_queue(dev, dir);
402-
if (dir == I2S_DIR_TX || I2S_DIR_BOTH) {
402+
if (dir == I2S_DIR_TX || dir == I2S_DIR_BOTH) {
403403
drv_data->tx_configured = false;
404404
memset(&drv_data->tx, 0, sizeof(drv_data->tx));
405405
}
406-
if (dir == I2S_DIR_RX || I2S_DIR_BOTH) {
406+
if (dir == I2S_DIR_RX || dir == I2S_DIR_BOTH) {
407407
drv_data->rx_configured = false;
408408
memset(&drv_data->rx, 0, sizeof(drv_data->rx));
409409
}

0 commit comments

Comments
 (0)