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