diff mbox series

[002/113] slimbus: stream: use snd_pcm_is_playback/capture()

Message ID 871q333j0f.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series ALSA: add snd_pcm_is_playback/capture() macro | expand

Commit Message

Kuninori Morimoto Aug. 5, 2024, 12:34 a.m. UTC
We can use snd_pcm_is_playback/capture(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/slimbus/stream.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/slimbus/stream.c b/drivers/slimbus/stream.c
index 863ab3075d7eb..e65a6bda2f5ba 100644
--- a/drivers/slimbus/stream.c
+++ b/drivers/slimbus/stream.c
@@ -6,6 +6,7 @@ 
 #include <linux/slab.h>
 #include <linux/list.h>
 #include <linux/slimbus.h>
+#include <sound/pcm.h>
 #include <uapi/sound/asound.h>
 #include "slimbus.h"
 
@@ -235,7 +236,7 @@  int slim_stream_prepare(struct slim_stream_runtime *rt,
 		 * data rate not exactly multiple of super frame,
 		 * use PUSH/PULL protocol
 		 */
-		if (cfg->direction == SNDRV_PCM_STREAM_PLAYBACK)
+		if (snd_pcm_is_playback(cfg->direction))
 			rt->prot = SLIM_PROTO_PUSH;
 		else
 			rt->prot = SLIM_PROTO_PULL;
@@ -256,7 +257,7 @@  int slim_stream_prepare(struct slim_stream_runtime *rt,
 		port->ch.aux_fmt = SLIM_CH_AUX_FMT_NOT_APPLICABLE;
 		port->ch.state = SLIM_CH_STATE_ALLOCATED;
 
-		if (cfg->direction == SNDRV_PCM_STREAM_PLAYBACK)
+		if (snd_pcm_is_playback(cfg->direction))
 			port->direction = SLIM_PORT_SINK;
 		else
 			port->direction = SLIM_PORT_SOURCE;