alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: anish kumar <yesanishhere@gmail.com>
To: broonie@kernel.org, lgirdwood@gmail.com
Cc: alsa-devel@alsa-project.org, anish kumar <yesanishhere@gmail.com>
Subject: [PATCH] Changed the if-else case to switch case
Date: Thu, 18 Feb 2016 10:36:20 -0800	[thread overview]
Message-ID: <1455820580-26501-1-git-send-email-yesanishhere@gmail.com> (raw)

Signed-off-by: anish kumar <yesanishhere@gmail.com>
---
 sound/soc/codecs/max9867.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/max9867.c b/sound/soc/codecs/max9867.c
index b9d989f..5a8481b 100755
--- a/sound/soc/codecs/max9867.c
+++ b/sound/soc/codecs/max9867.c
@@ -212,16 +212,22 @@ static int max9867_dai_hw_params(struct snd_pcm_substream *substream,
 		switch (snd_pcm_format_width(params_format(params))) {
 		case 8:
 		case 16:
-			if (pclk_bclk_ratio == 2)
+			switch (pclk_bclk_ratio) {
+			case 2:
 				bclk_value = MAX9867_IFC1B_PCLK_2;
-			else if (pclk_bclk_ratio == 4)
+				break;
+			case 4:
 				bclk_value = MAX9867_IFC1B_PCLK_4;
-			else if (pclk_bclk_ratio == 8)
+				break;
+			case 8:
 				bclk_value = MAX9867_IFC1B_PCLK_8;
-			else if (pclk_bclk_ratio == 16)
+				break;
+			case 16:
 				bclk_value = MAX9867_IFC1B_PCLK_16;
-			else {
-				dev_err(codec->dev, "unsupported sampling rate\n");
+				break;
+			default:
+				dev_err(codec->dev,
+					"unsupported sampling rate\n");
 				return -EINVAL;
 			}
 			break;
-- 
1.9.3

             reply	other threads:[~2016-02-18 18:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 18:36 anish kumar [this message]
2016-02-18 20:19 ` Applied "ASoC: max9867: Changed the if-else case to switch case" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455820580-26501-1-git-send-email-yesanishhere@gmail.com \
    --to=yesanishhere@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).