@@ -259,9 +259,9 @@ static enum catpt_channel_config catpt_get_channel_config(u32 num_channels)
259259static int catpt_dai_startup (struct snd_pcm_substream * substream ,
260260 struct snd_soc_dai * dai )
261261{
262- struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
263262 struct catpt_stream_template * template ;
264263 struct catpt_stream_runtime * stream ;
264+ struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
265265 struct resource * res ;
266266 int ret ;
267267
@@ -306,8 +306,8 @@ static int catpt_dai_startup(struct snd_pcm_substream *substream,
306306static void catpt_dai_shutdown (struct snd_pcm_substream * substream ,
307307 struct snd_soc_dai * dai )
308308{
309- struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
310309 struct catpt_stream_runtime * stream ;
310+ struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
311311
312312 stream = snd_soc_dai_get_dma_data (dai , substream );
313313
@@ -329,9 +329,9 @@ static int catpt_set_dspvol(struct catpt_dev *cdev, u8 stream_id, long *ctlvol);
329329static int catpt_dai_apply_usettings (struct snd_soc_dai * dai ,
330330 struct catpt_stream_runtime * stream )
331331{
332- struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
333332 struct snd_soc_component * component = dai -> component ;
334333 struct snd_kcontrol * pos ;
334+ struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
335335 const char * name ;
336336 int ret ;
337337 u32 id = stream -> info .stream_hw_id ;
@@ -374,12 +374,12 @@ static int catpt_dai_hw_params(struct snd_pcm_substream *substream,
374374 struct snd_pcm_hw_params * params ,
375375 struct snd_soc_dai * dai )
376376{
377- struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
377+ struct snd_pcm_runtime * rtm = substream -> runtime ;
378+ struct snd_dma_buffer * dmab ;
378379 struct catpt_stream_runtime * stream ;
379380 struct catpt_audio_format afmt ;
380381 struct catpt_ring_info rinfo ;
381- struct snd_pcm_runtime * rtm = substream -> runtime ;
382- struct snd_dma_buffer * dmab ;
382+ struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
383383 int ret ;
384384
385385 stream = snd_soc_dai_get_dma_data (dai , substream );
@@ -427,8 +427,8 @@ static int catpt_dai_hw_params(struct snd_pcm_substream *substream,
427427static int catpt_dai_hw_free (struct snd_pcm_substream * substream ,
428428 struct snd_soc_dai * dai )
429429{
430- struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
431430 struct catpt_stream_runtime * stream ;
431+ struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
432432
433433 stream = snd_soc_dai_get_dma_data (dai , substream );
434434 if (!stream -> allocated )
@@ -444,8 +444,8 @@ static int catpt_dai_hw_free(struct snd_pcm_substream *substream,
444444static int catpt_dai_prepare (struct snd_pcm_substream * substream ,
445445 struct snd_soc_dai * dai )
446446{
447- struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
448447 struct catpt_stream_runtime * stream ;
448+ struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
449449 int ret ;
450450
451451 stream = snd_soc_dai_get_dma_data (dai , substream );
@@ -467,9 +467,9 @@ static int catpt_dai_prepare(struct snd_pcm_substream *substream,
467467static int catpt_dai_trigger (struct snd_pcm_substream * substream , int cmd ,
468468 struct snd_soc_dai * dai )
469469{
470- struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
471- struct catpt_stream_runtime * stream ;
472470 struct snd_pcm_runtime * runtime = substream -> runtime ;
471+ struct catpt_stream_runtime * stream ;
472+ struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
473473 snd_pcm_uframes_t pos ;
474474 int ret ;
475475
@@ -595,20 +595,19 @@ static int catpt_component_open(struct snd_soc_component *component,
595595{
596596 struct snd_soc_pcm_runtime * rtm = substream -> private_data ;
597597
598- if (rtm -> dai_link -> no_pcm )
599- return 0 ;
600- snd_soc_set_runtime_hwparams (substream , & catpt_pcm_hardware );
598+ if (!rtm -> dai_link -> no_pcm )
599+ snd_soc_set_runtime_hwparams (substream , & catpt_pcm_hardware );
601600 return 0 ;
602601}
603602
604603static snd_pcm_uframes_t
605604catpt_component_pointer (struct snd_soc_component * component ,
606605 struct snd_pcm_substream * substream )
607606{
608- struct catpt_dev * cdev = dev_get_drvdata (component -> dev );
609- struct catpt_stream_runtime * stream ;
610607 struct snd_soc_pcm_runtime * rtm = substream -> private_data ;
611608 struct snd_soc_dai * cpu_dai = asoc_rtd_to_cpu (rtm , 0 );
609+ struct catpt_stream_runtime * stream ;
610+ struct catpt_dev * cdev = dev_get_drvdata (component -> dev );
612611 u32 pos ;
613612
614613 if (rtm -> dai_link -> no_pcm )
@@ -633,8 +632,8 @@ static int catpt_dai_pcm_new(struct snd_soc_pcm_runtime *rtm,
633632 struct snd_soc_dai * dai )
634633{
635634 struct snd_soc_dai * codec_dai = asoc_rtd_to_codec (rtm , 0 );
636- struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
637635 struct catpt_ssp_device_format devfmt ;
636+ struct catpt_dev * cdev = dev_get_drvdata (dai -> dev );
638637 int ret ;
639638
640639 devfmt .iface = dai -> driver -> id ;
@@ -894,8 +893,8 @@ static int catpt_stream_volume_get(struct snd_kcontrol *kcontrol,
894893{
895894 struct snd_soc_component * component =
896895 snd_soc_kcontrol_component (kcontrol );
897- struct catpt_dev * cdev = dev_get_drvdata (component -> dev );
898896 struct catpt_stream_runtime * stream ;
897+ struct catpt_dev * cdev = dev_get_drvdata (component -> dev );
899898 long * ctlvol = (long * )kcontrol -> private_value ;
900899 u32 dspvol ;
901900 int i ;
@@ -926,8 +925,8 @@ static int catpt_stream_volume_put(struct snd_kcontrol *kcontrol,
926925{
927926 struct snd_soc_component * component =
928927 snd_soc_kcontrol_component (kcontrol );
929- struct catpt_dev * cdev = dev_get_drvdata (component -> dev );
930928 struct catpt_stream_runtime * stream ;
929+ struct catpt_dev * cdev = dev_get_drvdata (component -> dev );
931930 long * ctlvol = (long * )kcontrol -> private_value ;
932931 int ret , i ;
933932
@@ -1002,8 +1001,8 @@ static int catpt_loopback_switch_put(struct snd_kcontrol *kcontrol,
10021001{
10031002 struct snd_soc_component * component =
10041003 snd_soc_kcontrol_component (kcontrol );
1005- struct catpt_dev * cdev = dev_get_drvdata (component -> dev );
10061004 struct catpt_stream_runtime * stream ;
1005+ struct catpt_dev * cdev = dev_get_drvdata (component -> dev );
10071006 bool mute ;
10081007 int ret ;
10091008
0 commit comments