From patchwork Thu Feb 18 18:36:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: anish kumar X-Patchwork-Id: 8353481 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 478EE9F727 for ; Thu, 18 Feb 2016 18:36:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E0AC2039E for ; Thu, 18 Feb 2016 18:36:48 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 11A0A2038D for ; Thu, 18 Feb 2016 18:36:47 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 07C97265DD8; Thu, 18 Feb 2016 19:36:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E11312606E2; Thu, 18 Feb 2016 19:36:35 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D4B752606A9; Thu, 18 Feb 2016 19:36:34 +0100 (CET) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by alsa0.perex.cz (Postfix) with ESMTP id 6187C2606A9 for ; Thu, 18 Feb 2016 19:36:27 +0100 (CET) Received: by mail-pa0-f50.google.com with SMTP id fy10so35181528pac.1 for ; Thu, 18 Feb 2016 10:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=RAsBsfC8DPr0qSd0aCjIawkkYB9jDmoW5n9ZFFwlAz0=; b=RCKPQx1CZJZwVn77rdwaUXz3CqFA+CefBI1vbpIX7+xl/Bfjo/rREJ0n5CqVwtRK49 L2yu4Z3GO/4r56W5wWfiiQnHS3V5cNyLX1Mmdp36a3+vizN7kx0a0Jn9MxXXGnrKTmce uzV3Jf7Bq6q/M+Fmy1Wytafnfdv4fl8Ax8NbrHDbpkI5Fg37lCTq5gYsJ+ccM2xzdftl OuEXNywCzNOba4eNRzFmnT1aEywKt3RSd4/D/Zq/GzJ4RqBo4I2b0nq+L4osYjEzqApr m1dA89X/MlRKdhDiOkpOFYBwXRE+Axns6d2jk5G1k5insgmIUDoiz1QVHp0qBUBMwSRA O1rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RAsBsfC8DPr0qSd0aCjIawkkYB9jDmoW5n9ZFFwlAz0=; b=Bl4x/UUpuBlxoxVL5ueDkGtdkEtwjQ467+9Yfi91pOepaBYV1QaLKm5f/OJHtLR+vb e+c1gQH/ST0Oqv3EFTBnJl3dkVmQhYpCbm9KOUrgnPKPpV2mY1H4wJGrR2N3WjOzmo0F 3ybKgxLMsUQkYHGQfsTFvhsF59YfNB48WSpQD5+EFmSDStOZdbfFohbm3+ExRgrLSkb/ qUBFhOyqPctbaFQeW+D3s2q56PaxULBMu7YWaitZzX3UiUJxFs3YdGpTtwkK9zUrf5MU Lhf1j049IbA5oBJFjze1hw5WbUE0d6XX2DugeciizJ5dkZEHV6Bq16SutWlUEI9rfWF0 lolA== X-Gm-Message-State: AG10YOTQcBwTGUwt+QGT+QNR0G+idGpgC5UUAJF6qsbs86rN7cnYrN7pu+w2mwfIk0qoVQ== X-Received: by 10.66.121.132 with SMTP id lk4mr12331969pab.33.1455820585951; Thu, 18 Feb 2016 10:36:25 -0800 (PST) Received: from aud-srv01.maxim-ic.internal ([204.17.143.20]) by smtp.gmail.com with ESMTPSA id tn5sm11884693pac.32.2016.02.18.10.36.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Feb 2016 10:36:25 -0800 (PST) From: anish kumar To: broonie@kernel.org, lgirdwood@gmail.com Date: Thu, 18 Feb 2016 10:36:20 -0800 Message-Id: <1455820580-26501-1-git-send-email-yesanishhere@gmail.com> X-Mailer: git-send-email 1.9.3 Cc: alsa-devel@alsa-project.org, anish kumar Subject: [alsa-devel] [PATCH] Changed the if-else case to switch case X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: anish kumar --- 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;