Skip to contentSkip to conversation

soundwire: Use snd_soc_substream_to_rtd() to obtain rtd

PATCH Applied Amadeusz Sławiński 2 participants 3 messages Sep 29, 2023 – Mar 3, 2024 SoundWire

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soundwire: Use snd_soc_substream_to_rtd() to obtain rtd

From: Cezary Rojewski <[email protected]>

Utilize the helper function instead of casting from ->private_data directly.

---
 drivers/soundwire/stream.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/soundwire/stream.c +3 -3
index 69719b335bcb..652aae4e221d 100644
@@ -1717,7 +1717,7 @@ EXPORT_SYMBOL(sdw_deprepare_stream);
 static int set_stream(struct snd_pcm_substream *substream,
 		      struct sdw_stream_runtime *sdw_stream)
 {
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
 	struct snd_soc_dai *dai;
 	int ret = 0;
 	int i;
@@ -1770,7 +1770,7 @@ EXPORT_SYMBOL(sdw_alloc_stream);
 int sdw_startup_stream(void *sdw_substream)
 {
 	struct snd_pcm_substream *substream = sdw_substream;
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
 	struct sdw_stream_runtime *sdw_stream;
 	char *name;
 	int ret;
@@ -1814,7 +1814,7 @@ EXPORT_SYMBOL(sdw_startup_stream);
 void sdw_shutdown_stream(void *sdw_substream)
 {
 	struct snd_pcm_substream *substream = sdw_substream;
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
 	struct sdw_stream_runtime *sdw_stream;
 	struct snd_soc_dai *dai;
 
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 16 lines · Amadeusz Sławiński

From: Cezary Rojewski <[email protected]>

Utilize the helper function instead of casting from ->private_data directly.

---
 drivers/soundwire/stream.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/soundwire/stream.c +0 -0
index 69719b335bcb..652aae4e221d 100644

drivers/soundwire/stream.c EXPORT_SYMBOL(sdw_deprepare_stream); · line 1720

Quoted 5 lines
drivers/soundwire/stream.c +1 -1
@@ -1717,7 +1717,7 @@ EXPORT_SYMBOL(sdw_deprepare_stream);
 static int set_stream(struct snd_pcm_substream *substream,
 		      struct sdw_stream_runtime *sdw_stream)
 {
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);

This does not exist for me, so I guess you can resend it after next cycle when this appears in rc1

Signature · 1 line
~Vinod
maintainer Applied
#2 lore raw
In reply to Amadeusz Sławiński
Quoted 4 lines · Amadeusz Sławiński

Utilize the helper function instead of casting from ->private_data directly.

Applied, thanks!

[1/1] soundwire: Use snd_soc_substream_to_rtd() to obtain rtd

      commit: e17aae16acf53938deb4b7702aa4f6cee2c4a073

Best regards,

Signature · 1 line
~Vinod