Skip to content

Commit e17aae1

Browse files
crojewsk-intelvinodkoul
authored andcommitted
soundwire: Use snd_soc_substream_to_rtd() to obtain rtd
Utilize the helper function instead of casting from ->private_data directly. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20240219105206.335738-1-cezary.rojewski@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 99fea94 commit e17aae1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/soundwire/stream.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ EXPORT_SYMBOL(sdw_deprepare_stream);
17181718
static int set_stream(struct snd_pcm_substream *substream,
17191719
struct sdw_stream_runtime *sdw_stream)
17201720
{
1721-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
1721+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
17221722
struct snd_soc_dai *dai;
17231723
int ret = 0;
17241724
int i;
@@ -1771,7 +1771,7 @@ EXPORT_SYMBOL(sdw_alloc_stream);
17711771
int sdw_startup_stream(void *sdw_substream)
17721772
{
17731773
struct snd_pcm_substream *substream = sdw_substream;
1774-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
1774+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
17751775
struct sdw_stream_runtime *sdw_stream;
17761776
char *name;
17771777
int ret;
@@ -1815,7 +1815,7 @@ EXPORT_SYMBOL(sdw_startup_stream);
18151815
void sdw_shutdown_stream(void *sdw_substream)
18161816
{
18171817
struct snd_pcm_substream *substream = sdw_substream;
1818-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
1818+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
18191819
struct sdw_stream_runtime *sdw_stream;
18201820
struct snd_soc_dai *dai;
18211821

0 commit comments

Comments
 (0)