diff mbox

sound: tlv320aic32x4: Fixed Coding style issues

Message ID CAHWZSxgM17azkvwxOAcR3skaUXRcaoxbiHxE3bMNrfg2dNTRkw@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

ShaRab Shaik June 4, 2014, 11:19 a.m. UTC
From 617d7a25f3c0c08e0b95b24de2d1ea0f3f4b98c7 Mon Sep 17 00:00:00 2001
From: Shahina Shaik <sharab.shaik@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@gmail.com>
---
 sound/soc/codecs/tlv320aic32x4.c |   34 +++++++++++++++++++---------------
 1 files changed, 19 insertions(+), 15 deletions(-)

 }

@@ -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);

Comments

ShaRab Shaik June 4, 2014, 5:36 p.m. UTC | #1
Hi Mark,

Sorry for the mistakes and thanks for the suggestions.
I will get back again with proper patches.


Thanks,
Shahina


On Wed, Jun 4, 2014 at 6:12 PM, Mark Brown <broonie@kernel.org> wrote:

> On Wed, Jun 04, 2014 at 04:49:54PM +0530, ShaRab Shaik wrote:
> > From 617d7a25f3c0c08e0b95b24de2d1ea0f3f4b98c7 Mon Sep 17 00:00:00 2001
> > From: Shahina Shaik <sharab.shaik@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.
>
> Your patch appears to have been corrupted by your mailer, it's word
> wrapped so can't be applied by the tools.  Please see
> Documentation/SubmittingPatches and Documentation/email-clients.txt for
> some suggestions on how to set this up.
>
> > Replaced printk with pr_err as pr_err is prefered than printk.
>
> In general dev_err() is going to be usable by CODEC drivers and is even
> more strongly preferred than pr_err() since it provides more information
> about the source of the error.
>
> Please also avoid making multiple kinds of change in the same patch - it
> is much easier to review things if the patch is simpler.
>
> > -    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);
> > -    }
> > +
>
> So for example the print changes should be a separate patch to these
> brace  changes.  If you're removing the } you should also just delete
> the line.
>
diff mbox

Patch

From 617d7a25f3c0c08e0b95b24de2d1ea0f3f4b98c7 Mon Sep 17 00:00:00 2001
From: Shahina Shaik <sharab.shaik@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@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);
 
-- 
1.7.0.4