From patchwork Thu Sep 30 09:57:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 219482 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8U9wGQI025687 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 30 Sep 2010 09:58:38 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1P1Fty-0007j5-KG; Thu, 30 Sep 2010 09:58:10 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1P1Ftx-0007iu-RC for spi-devel-general@lists.sourceforge.net; Thu, 30 Sep 2010 09:58:09 +0000 X-ACL-Warn: Received: from eu1sys200aog105.obsmtp.com ([207.126.144.119]) by sog-mx-4.v43.ch3.sourceforge.com with smtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1P1Ftw-0003mP-GE for spi-devel-general@lists.sourceforge.net; Thu, 30 Sep 2010 09:58:09 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob105.postini.com ([207.126.147.11]) with SMTP ID DSNKTKRfJkKO6MBXkqp3nlmR80bk8315+BXY@postini.com; Thu, 30 Sep 2010 09:58:08 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CB09BA6; Thu, 30 Sep 2010 09:57:55 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7FC882090; Thu, 30 Sep 2010 09:57:55 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 0CB5EA8083; Thu, 30 Sep 2010 11:57:50 +0200 (CEST) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.1.393.1; Thu, 30 Sep 2010 11:57:54 +0200 From: Linus Walleij To: Grant Likely , Subject: [PATCH] spi/pl022: compare bitwidth to enums Date: Thu, 30 Sep 2010 11:57:51 +0200 Message-ID: <1285840671-9567-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.6.3.3 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1P1Ftw-0003mP-GE Cc: Linus Walleij , linux-arm-kernel@lists.infradead.org X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 30 Sep 2010 09:58:39 +0000 (UTC) diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c index 90a7e5d..981f78d 100644 --- a/drivers/spi/amba-pl022.c +++ b/drivers/spi/amba-pl022.c @@ -1605,12 +1605,12 @@ static int pl022_setup(struct spi_device *spi) chip->xfer_type = chip_info->com_mode; chip->cs_control = chip_info->cs_control; - if (chip_info->data_size <= 8) { + if (chip_info->data_size <= SSP_DATA_BITS_8) { dev_dbg(&spi->dev, "1 <= n <=8 bits per word\n"); chip->n_bytes = 1; chip->read = READING_U8; chip->write = WRITING_U8; - } else if (chip_info->data_size <= 16) { + } else if (chip_info->data_size <= SSP_DATA_BITS_16) { dev_dbg(&spi->dev, "9 <= n <= 16 bits per word\n"); chip->n_bytes = 2; chip->read = READING_U16; diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h index abf26cc..3c83c62 100644 --- a/include/linux/amba/pl022.h +++ b/include/linux/amba/pl022.h @@ -90,7 +90,7 @@ enum ssp_tx_endian { * enum ssp_data_size - number of bits in one data element */ enum ssp_data_size { - SSP_DATA_BITS_4 = 0x03, SSP_DATA_BITS_5, SSP_DATA_BITS_6, + SSP_DATA_BITS_4 = 0x04, SSP_DATA_BITS_5, SSP_DATA_BITS_6, SSP_DATA_BITS_7, SSP_DATA_BITS_8, SSP_DATA_BITS_9, SSP_DATA_BITS_10, SSP_DATA_BITS_11, SSP_DATA_BITS_12, SSP_DATA_BITS_13, SSP_DATA_BITS_14, SSP_DATA_BITS_15,