diff options
author | Nicolin Chen <Guangyu.Chen@freescale.com> | 2013-12-20 03:41:05 -0500 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:57:37 -0400 |
commit | 998ad471ae7d2f5e726d0d53a2b541fcb9caf0ff (patch) | |
tree | f3a32158e6251ba3676a01c9da8b3dfeb560deee /sound/soc/fsl/fsl_sai.c | |
parent | 9de469e93b618a608edde8c131ae3dfa200dff7b (diff) |
ASoC: fsl_sai: Sort local variable in general way
Generally we would write code for local variable like:
static new_func()
{
struct xxx *yyy;
...
int ret;
}
But this driver only follows this pattern for some functions, not all.
Thus this patch sorts the local variable in the general way.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Reviewed-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 4e3a99f5b004b30bc604d82e5498700649148e0d)
Diffstat (limited to 'sound/soc/fsl/fsl_sai.c')
-rw-r--r-- | sound/soc/fsl/fsl_sai.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 68d666b491de..b72132fa70de 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c | |||
@@ -53,8 +53,8 @@ static inline void sai_writel(struct fsl_sai *sai, | |||
53 | static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai, | 53 | static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai, |
54 | int clk_id, unsigned int freq, int fsl_dir) | 54 | int clk_id, unsigned int freq, int fsl_dir) |
55 | { | 55 | { |
56 | u32 val_cr2, reg_cr2; | ||
57 | struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); | 56 | struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); |
57 | u32 val_cr2, reg_cr2; | ||
58 | 58 | ||
59 | if (fsl_dir == FSL_FMT_TRANSMITTER) | 59 | if (fsl_dir == FSL_FMT_TRANSMITTER) |
60 | reg_cr2 = FSL_SAI_TCR2; | 60 | reg_cr2 = FSL_SAI_TCR2; |
@@ -90,8 +90,8 @@ static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai, | |||
90 | static int fsl_sai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, | 90 | static int fsl_sai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, |
91 | int clk_id, unsigned int freq, int dir) | 91 | int clk_id, unsigned int freq, int dir) |
92 | { | 92 | { |
93 | int ret; | ||
94 | struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); | 93 | struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); |
94 | int ret; | ||
95 | 95 | ||
96 | if (dir == SND_SOC_CLOCK_IN) | 96 | if (dir == SND_SOC_CLOCK_IN) |
97 | return 0; | 97 | return 0; |
@@ -128,8 +128,8 @@ err_clk: | |||
128 | static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai, | 128 | static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai, |
129 | unsigned int fmt, int fsl_dir) | 129 | unsigned int fmt, int fsl_dir) |
130 | { | 130 | { |
131 | u32 val_cr2, val_cr3, val_cr4, reg_cr2, reg_cr3, reg_cr4; | ||
132 | struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); | 131 | struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); |
132 | u32 val_cr2, val_cr3, val_cr4, reg_cr2, reg_cr3, reg_cr4; | ||
133 | 133 | ||
134 | if (fsl_dir == FSL_FMT_TRANSMITTER) { | 134 | if (fsl_dir == FSL_FMT_TRANSMITTER) { |
135 | reg_cr2 = FSL_SAI_TCR2; | 135 | reg_cr2 = FSL_SAI_TCR2; |
@@ -207,8 +207,8 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai, | |||
207 | 207 | ||
208 | static int fsl_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) | 208 | static int fsl_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) |
209 | { | 209 | { |
210 | int ret; | ||
211 | struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); | 210 | struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); |
211 | int ret; | ||
212 | 212 | ||
213 | ret = clk_prepare_enable(sai->clk); | 213 | ret = clk_prepare_enable(sai->clk); |
214 | if (ret) | 214 | if (ret) |
@@ -236,9 +236,9 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream, | |||
236 | struct snd_pcm_hw_params *params, | 236 | struct snd_pcm_hw_params *params, |
237 | struct snd_soc_dai *cpu_dai) | 237 | struct snd_soc_dai *cpu_dai) |
238 | { | 238 | { |
239 | struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); | ||
239 | u32 val_cr4, val_cr5, val_mr, reg_cr4, reg_cr5, reg_mr; | 240 | u32 val_cr4, val_cr5, val_mr, reg_cr4, reg_cr5, reg_mr; |
240 | unsigned int channels = params_channels(params); | 241 | unsigned int channels = params_channels(params); |
241 | struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); | ||
242 | u32 word_width = snd_pcm_format_width(params_format(params)); | 242 | u32 word_width = snd_pcm_format_width(params_format(params)); |
243 | 243 | ||
244 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 244 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
@@ -383,10 +383,10 @@ static const struct snd_soc_component_driver fsl_component = { | |||
383 | 383 | ||
384 | static int fsl_sai_probe(struct platform_device *pdev) | 384 | static int fsl_sai_probe(struct platform_device *pdev) |
385 | { | 385 | { |
386 | int ret; | 386 | struct device_node *np = pdev->dev.of_node; |
387 | struct fsl_sai *sai; | 387 | struct fsl_sai *sai; |
388 | struct resource *res; | 388 | struct resource *res; |
389 | struct device_node *np = pdev->dev.of_node; | 389 | int ret; |
390 | 390 | ||
391 | sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL); | 391 | sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL); |
392 | if (!sai) | 392 | if (!sai) |