[alsa-devel] [PATCH] sound: tlv320aic32x4: Fixed Coding style issues

ShaRab Shaik sharab.shaik at gmail.com
Wed Jun 4 13:19:54 CEST 2014


>From 617d7a25f3c0c08e0b95b24de2d1ea0f3f4b98c7 Mon Sep 17 00:00:00 2001
From: Shahina Shaik <sharab.shaik at gmail.com>
Date: Wed, 4 Jun 2014 16:27:19 +0530
Subject: [PATCH] sound: tlv320aic32x4: Fixed Coding style issues.

Fixed brace coding style, lines morethan 80 characters issues.
Replaced printk with pr_err as pr_err is prefered than printk.

Signed-off-by: Shahina Shaik <sharab.shaik at gmail.com>
---
 sound/soc/codecs/tlv320aic32x4.c |   34 +++++++++++++++++++---------------
 1 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic32x4.c
b/sound/soc/codecs/tlv320aic32x4.c
index 1d9b117..9e45490 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -306,7 +306,7 @@ static inline int aic32x4_get_divs(int mclk, int rate)
             return i;
         }
     }
-    printk(KERN_ERR "aic32x4: master clock and sample rate is not
supported\n");
+    pr_err(KERN_ERR "aic32x4: master clock and sample rate is not
supported\n");
     return -EINVAL;
 }

@@ -323,7 +323,7 @@ static int aic32x4_set_dai_sysclk(struct snd_soc_dai
*codec_dai,
         aic32x4->sysclk = freq;
         return 0;
     }
-    printk(KERN_ERR "aic32x4: invalid frequency to set DAI system
clock\n");
+    pr_err(KERN_ERR "aic32x4: invalid frequency to set DAI system
clock\n");
     return -EINVAL;
 }

@@ -349,7 +349,7 @@ static int aic32x4_set_dai_fmt(struct snd_soc_dai
*codec_dai, unsigned int fmt)
     case SND_SOC_DAIFMT_CBS_CFS:
         break;
     default:
-        printk(KERN_ERR "aic32x4: invalid DAI master/slave interface\n");
+        pr_err(KERN_ERR "aic32x4: invalid DAI master/slave interface\n");
         return -EINVAL;
     }

@@ -374,7 +374,7 @@ static int aic32x4_set_dai_fmt(struct snd_soc_dai
*codec_dai, unsigned int fmt)
             (AIC32X4_LEFT_JUSTIFIED_MODE << AIC32X4_PLLJ_SHIFT);
         break;
     default:
-        printk(KERN_ERR "aic32x4: invalid DAI interface format\n");
+        pr_err(KERN_ERR "aic32x4: invalid DAI interface format\n");
         return -EINVAL;
     }

@@ -395,7 +395,7 @@ static int aic32x4_hw_params(struct snd_pcm_substream
*substream,

     i = aic32x4_get_divs(aic32x4->sysclk, params_rate(params));
     if (i < 0) {
-        printk(KERN_ERR "aic32x4: sampling rate not supported\n");
+        pr_err(KERN_ERR "aic32x4: sampling rate not supported\n");
         return i;
     }

@@ -626,32 +626,36 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
         snd_soc_write(codec, AIC32X4_MICBIAS, AIC32X4_MICBIAS_LDOIN |
                               AIC32X4_MICBIAS_2075V);
     }
-    if (aic32x4->power_cfg & AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE) {
+    if (aic32x4->power_cfg & AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE)
         snd_soc_write(codec, AIC32X4_PWRCFG, AIC32X4_AVDDWEAKDISABLE);
-    }
+

     tmp_reg = (aic32x4->power_cfg & AIC32X4_PWR_AIC32X4_LDO_ENABLE) ?
             AIC32X4_LDOCTLEN : 0;
     snd_soc_write(codec, AIC32X4_LDOCTL, tmp_reg);

     tmp_reg = snd_soc_read(codec, AIC32X4_CMMODE);
-    if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36) {
+    if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36)
         tmp_reg |= AIC32X4_LDOIN_18_36;
-    }
-    if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_HP_LDOIN_POWERED) {
+
+    if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_HP_LDOIN_POWERED)
         tmp_reg |= AIC32X4_LDOIN2HP;
-    }
+
     snd_soc_write(codec, AIC32X4_CMMODE, tmp_reg);

     /* Mic PGA routing */
     if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K)
-        snd_soc_write(codec, AIC32X4_LMICPGANIN,
AIC32X4_LMICPGANIN_IN2R_10K);
+        snd_soc_write(codec, AIC32X4_LMICPGANIN,
+                AIC32X4_LMICPGANIN_IN2R_10K);
     else
-        snd_soc_write(codec, AIC32X4_LMICPGANIN,
AIC32X4_LMICPGANIN_CM1L_10K);
+        snd_soc_write(codec, AIC32X4_LMICPGANIN,
+                AIC32X4_LMICPGANIN_CM1L_10K);
     if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K)
-        snd_soc_write(codec, AIC32X4_RMICPGANIN,
AIC32X4_RMICPGANIN_IN1L_10K);
+        snd_soc_write(codec, AIC32X4_RMICPGANIN,
+                AIC32X4_RMICPGANIN_IN1L_10K);
     else
-        snd_soc_write(codec, AIC32X4_RMICPGANIN,
AIC32X4_RMICPGANIN_CM1R_10K);
+        snd_soc_write(codec, AIC32X4_RMICPGANIN,
+                AIC32X4_RMICPGANIN_CM1R_10K);

     aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-sound-tlv320aic32x4-Fixed-Coding-style-issues.patch
Type: text/x-patch
Size: 4084 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20140604/f017323d/attachment-0001.bin>


More information about the Alsa-devel mailing list