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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We can use snd_pcm_is_playback/capture(). Let's use it.

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

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;
-- 
2.43.0





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux