From patchwork Thu Apr 21 18:19:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gardiner X-Patchwork-Id: 725301 Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3LIMccr014038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 21 Apr 2011 18:23:05 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p3LIJEN2013336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 Apr 2011 13:19:14 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id p3LIJDdH009277; Thu, 21 Apr 2011 13:19:14 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 4232080627; Thu, 21 Apr 2011 13:19:13 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id EFE2E80626 for ; Thu, 21 Apr 2011 13:19:10 -0500 (CDT) Received: from white.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id p3LIJ9Op002085 for ; Thu, 21 Apr 2011 13:19:09 -0500 (CDT) Received: from psmtp.com (na3sys009amx207.postini.com [74.125.149.47]) by white.ext.ti.com (8.13.7/8.13.7) with SMTP id p3LIJ8ZM004530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 21 Apr 2011 13:19:09 -0500 Received: from na3sys009aog107.obsmtp.com ([209.85.218.46]) (using TLSv1) by na3sys009amx207.postini.com ([74.125.148.10]) with SMTP; Thu, 21 Apr 2011 18:19:09 GMT Received: from mail-yi0-f46.google.com ([209.85.218.46]) (using TLSv1) by na3sys009aob107.postini.com ([74.125.148.12]) with SMTP ID DSNKTbB1HFz/F7Rko64Ch2AVWxMr9b0te8iG@postini.com; Thu, 21 Apr 2011 11:19:09 PDT Received: by mail-yi0-f46.google.com with SMTP id 27so710298yia.33 for ; Thu, 21 Apr 2011 11:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nanometrics.ca; s=google; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=gsnsZyUiO4ZMmKKpAogudt06boPNp+fT3nqTbiIgFbI=; b=KsPu9MIzIZwlG6E2p6rkB1VatntBVnvpHX4GVGZstN2lzp6s03exydyQhrhPhSHt1Z I9V/ePxWIV8kAS3nGdkaZj+81Kt6fFmSLtJTbZgq/0S8WJxyHMA8kcDYUiX5uk6gwa/t kA2g1FL0mOhgggZS+HZ0xYjDxBvjvFiQo2Gk4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=nanometrics.ca; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=f/tksR7V2iTL5J2WzzFHItJRJcdJLHIZvcOVSvzhchBw5+6q+DN+/KgUXiuYc8DZT7 6jBbSXpbCWhXD6bcY8YBTg+DFMFwAV5xWdDmaBZsi5Obm+O4Oyz5wktPm8nM9vdJ7hyI +6pPRC+mfOvTfulC/LXo9k7NUZl2y21aKMN0M= Received: by 10.236.156.104 with SMTP id l68mr238542yhk.451.1303409948507; Thu, 21 Apr 2011 11:19:08 -0700 (PDT) Received: from localhost.localdomain ([206.191.47.130]) by mx.google.com with ESMTPS id 13sm940691yhl.72.2011.04.21.11.19.07 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Apr 2011 11:19:07 -0700 (PDT) From: Ben Gardiner To: Liam Girdwood , alsa-devel@alsa-project.org Subject: [PATCH 1/4] davinci-mcasp: correct tdm_slots limit Date: Thu, 21 Apr 2011 14:19:01 -0400 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: References: X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.0750) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] Cc: davinci-linux-open-source@linux.davincidsp.com, Takashi Iwai , Mark Brown , linux-kernel@vger.kernel.org, Jaroslav Kysela X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 21 Apr 2011 18:23:05 +0000 (UTC) The current check for the number of tdm-slots specified by platform data is always true (x >= 2 || x <= 32); therefore the else branch that warns of an incorrect number of slots can never be taken. Check that the number of tdm slots specified by platform data is between 2 and 32, inclusive. Signed-off-by: Ben Gardiner Reviewed-by: James Nuss --- sound/soc/davinci/davinci-mcasp.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index fb55d2c..e595756 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -644,7 +644,7 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream) mcasp_set_reg(dev->base + DAVINCI_MCASP_TXTDM_REG, mask); mcasp_set_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, TXORD); - if ((dev->tdm_slots >= 2) || (dev->tdm_slots <= 32)) + if ((dev->tdm_slots >= 2) && (dev->tdm_slots <= 32)) mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMCTL_REG, FSXMOD(dev->tdm_slots), FSXMOD(0x1FF)); else @@ -660,7 +660,7 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream) AHCLKRE); mcasp_set_reg(dev->base + DAVINCI_MCASP_RXTDM_REG, mask); - if ((dev->tdm_slots >= 2) || (dev->tdm_slots <= 32)) + if ((dev->tdm_slots >= 2) && (dev->tdm_slots <= 32)) mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMCTL_REG, FSRMOD(dev->tdm_slots), FSRMOD(0x1FF)); else