summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorNicolin Chen <Guangyu.Chen@freescale.com>2013-12-20 08:41:05 (GMT)
committerMatthew Weigel <Matthew.Weigel@freescale.com>2014-12-11 18:36:23 (GMT)
commitfbadc482cdadf739ff08fde113e8a0baafcfe4b5 (patch)
treee835c71f10963d6af79eb2060a4c1db3136a1d08 /sound
parent0b18ebcbb99526652e3f15cce614e35651b94cb8 (diff)
downloadlinux-fsl-qoriq-fbadc482cdadf739ff08fde113e8a0baafcfe4b5.tar.xz
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> --- This patch is pulled back from upstream: commit 4e3a99f5b004b30bc604d82e5498700649148e0d Change-Id: Idcc0aea15b8b1daca140b05c5c9655cea43746b6 Reviewed-on: http://git.am.freescale.net:8181/19745 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Zhengxiong Jin <Jason.Jin@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_sai.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 886274e..8a85dc9 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,
static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai,
int clk_id, unsigned int freq, int fsl_dir)
{
- u32 val_cr2, reg_cr2;
struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
+ u32 val_cr2, reg_cr2;
if (fsl_dir == FSL_FMT_TRANSMITTER)
reg_cr2 = FSL_SAI_TCR2;
@@ -90,8 +90,8 @@ static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai,
static int fsl_sai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
int clk_id, unsigned int freq, int dir)
{
- int ret;
struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
+ int ret;
if (dir == SND_SOC_CLOCK_IN)
return 0;
@@ -128,8 +128,8 @@ err_clk:
static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
unsigned int fmt, int fsl_dir)
{
- u32 val_cr2, val_cr3, val_cr4, reg_cr2, reg_cr3, reg_cr4;
struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
+ u32 val_cr2, val_cr3, val_cr4, reg_cr2, reg_cr3, reg_cr4;
if (fsl_dir == FSL_FMT_TRANSMITTER) {
reg_cr2 = FSL_SAI_TCR2;
@@ -207,8 +207,8 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
static int fsl_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
{
- int ret;
struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
+ int ret;
ret = clk_prepare_enable(sai->clk);
if (ret)
@@ -236,9 +236,9 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *cpu_dai)
{
+ struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
u32 val_cr4, val_cr5, val_mr, reg_cr4, reg_cr5, reg_mr;
unsigned int channels = params_channels(params);
- struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
u32 word_width = snd_pcm_format_width(params_format(params));
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
@@ -383,10 +383,10 @@ static const struct snd_soc_component_driver fsl_component = {
static int fsl_sai_probe(struct platform_device *pdev)
{
- int ret;
+ struct device_node *np = pdev->dev.of_node;
struct fsl_sai *sai;
struct resource *res;
- struct device_node *np = pdev->dev.of_node;
+ int ret;
sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL);
if (!sai)