int snd_soc_pcm_component_pointer(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        int i;
 
 int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
                                unsigned int cmd, void *arg)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        int i;
 
 
 int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        int i, ret;
 
                                    int channel, unsigned long pos,
                                    void __user *buf, unsigned long bytes)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        int i;
 
 struct page *snd_soc_pcm_component_page(struct snd_pcm_substream *substream,
                                        unsigned long offset)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        struct page *page;
        int i;
 int snd_soc_pcm_component_mmap(struct snd_pcm_substream *substream,
                               struct vm_area_struct *vma)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        int i;
 
 
 int snd_soc_pcm_component_prepare(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        int i, ret;
 
                                    struct snd_pcm_hw_params *params,
                                    struct snd_soc_component **last)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        int i, ret;
 
 void snd_soc_pcm_component_hw_free(struct snd_pcm_substream *substream,
                                   struct snd_soc_component *last)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        int i, ret;
 
 int snd_soc_pcm_component_trigger(struct snd_pcm_substream *substream,
                                  int cmd)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        int i, ret;
 
 
 static int soc_pcm_apply_symmetry(struct snd_pcm_substream *substream,
                                        struct snd_soc_dai *soc_dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        int ret;
 
        if (soc_dai->rate && (soc_dai->driver->symmetric_rates ||
 static int soc_pcm_params_symmetry(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *dai;
        struct snd_soc_dai *cpu_dai;
        unsigned int rate, channels, sample_bits, symmetry, i;
 
 static bool soc_pcm_has_symmetry(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai_link *link = rtd->dai_link;
        struct snd_soc_dai *dai;
        unsigned int symmetry, i;
 
 static void soc_pcm_set_msb(struct snd_pcm_substream *substream, int bits)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        int ret;
 
        if (!bits)
 
 static void soc_pcm_apply_msb(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *cpu_dai;
        struct snd_soc_dai *codec_dai;
        struct snd_soc_pcm_stream *pcm_codec, *pcm_cpu;
 static void soc_pcm_init_runtime_hw(struct snd_pcm_substream *substream)
 {
        struct snd_pcm_hardware *hw = &substream->runtime->hw;
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        u64 formats = hw->formats;
 
        /*
 
 static int soc_pcm_components_open(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *last = NULL;
        struct snd_soc_component *component;
        int i, ret = 0;
 
 static int soc_pcm_components_close(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        int i, r, ret = 0;
 
  */
 static int soc_pcm_close(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        struct snd_soc_dai *dai;
        int i;
  */
 static int soc_pcm_open(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct snd_soc_component *component;
        struct snd_soc_dai *dai;
  */
 static int soc_pcm_prepare(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *dai;
        int i, ret = 0;
 
 static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component;
        struct snd_soc_dai *cpu_dai;
        struct snd_soc_dai *codec_dai;
  */
 static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *dai;
        int i;
 
  */
 static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *cpu_dai;
        struct snd_soc_dai *codec_dai;
        struct snd_pcm_runtime *runtime = substream->runtime;
 static void dpcm_runtime_merge_format(struct snd_pcm_substream *substream,
                                      u64 *formats)
 {
-       struct snd_soc_pcm_runtime *fe = substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(substream);
        struct snd_soc_dpcm *dpcm;
        struct snd_soc_dai *dai;
        int stream = substream->stream;
                                    unsigned int *channels_min,
                                    unsigned int *channels_max)
 {
-       struct snd_soc_pcm_runtime *fe = substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(substream);
        struct snd_soc_dpcm *dpcm;
        int stream = substream->stream;
 
                                    unsigned int *rate_min,
                                    unsigned int *rate_max)
 {
-       struct snd_soc_pcm_runtime *fe = substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(substream);
        struct snd_soc_dpcm *dpcm;
        int stream = substream->stream;
 
 static void dpcm_set_fe_runtime(struct snd_pcm_substream *substream)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *cpu_dai;
        int i;
 
                               int stream)
 {
        struct snd_soc_dpcm *dpcm;
-       struct snd_soc_pcm_runtime *fe = fe_substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(fe_substream);
        struct snd_soc_dai *fe_cpu_dai;
        int err;
        int i;
                if (!be_substream)
                        continue;
 
-               rtd = be_substream->private_data;
+               rtd = asoc_substream_to_rtd(be_substream);
                if (rtd->dai_link->be_hw_params_fixup)
                        continue;
 
 
 static int dpcm_fe_dai_startup(struct snd_pcm_substream *fe_substream)
 {
-       struct snd_soc_pcm_runtime *fe = fe_substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(fe_substream);
        struct snd_pcm_runtime *runtime = fe_substream->runtime;
        int stream = fe_substream->stream, ret = 0;
 
 
 static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *fe = substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(substream);
        int stream = substream->stream;
 
        dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE);
 
 static int dpcm_fe_dai_hw_free(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *fe = substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(substream);
        int err, stream = substream->stream;
 
        mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
 static int dpcm_fe_dai_hw_params(struct snd_pcm_substream *substream,
                                 struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *fe = substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(substream);
        int ret, stream = substream->stream;
 
        mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
 static int dpcm_dai_trigger_fe_be(struct snd_pcm_substream *substream,
                                  int cmd, bool fe_first)
 {
-       struct snd_soc_pcm_runtime *fe = substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(substream);
        int ret;
 
        /* call trigger on the frontend before the backend. */
 
 static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd)
 {
-       struct snd_soc_pcm_runtime *fe = substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(substream);
        int stream = substream->stream;
        int ret = 0;
        enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream];
 
 static int dpcm_fe_dai_trigger(struct snd_pcm_substream *substream, int cmd)
 {
-       struct snd_soc_pcm_runtime *fe = substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(substream);
        int stream = substream->stream;
 
        /* if FE's runtime_update is already set, we're in race;
 
 static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *fe = substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(substream);
        int stream = substream->stream, ret = 0;
 
        mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
 
 static void dpcm_fe_dai_cleanup(struct snd_pcm_substream *fe_substream)
 {
-       struct snd_soc_pcm_runtime *fe = fe_substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(fe_substream);
        struct snd_soc_dpcm *dpcm;
        int stream = fe_substream->stream;
 
 
 static int dpcm_fe_dai_close(struct snd_pcm_substream *fe_substream)
 {
-       struct snd_soc_pcm_runtime *fe = fe_substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(fe_substream);
        int ret;
 
        mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
 
 static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream)
 {
-       struct snd_soc_pcm_runtime *fe = fe_substream->private_data;
+       struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(fe_substream);
        struct snd_soc_dapm_widget_list *list;
        int ret;
        int stream = fe_substream->stream;