From patchwork Fri Jun 13 03:59:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naveen Krishna Chatradhi X-Patchwork-Id: 4346711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8BA459F314 for ; Fri, 13 Jun 2014 04:05:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF85D20254 for ; Fri, 13 Jun 2014 04:05:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DF4C62024C for ; Fri, 13 Jun 2014 04:05:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WvIht-0005iC-Hg; Fri, 13 Jun 2014 04:03:13 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WvIhl-0005eG-Nx for linux-arm-kernel@lists.infradead.org; Fri, 13 Jun 2014 04:03:06 +0000 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N7300ASU9WIJK10@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 13 Jun 2014 13:02:42 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.126]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id EE.8B.14704.2E77A935; Fri, 13 Jun 2014 13:02:42 +0900 (KST) X-AuditID: cbfee68f-b7fef6d000003970-ae-539a77e26b0f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 78.8A.07139.2E77A935; Fri, 13 Jun 2014 13:02:42 +0900 (KST) Received: from chnaveen-ubuntu.sisodomain.com ([107.108.83.161]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N73001949W8DA40@mmp1.samsung.com>; Fri, 13 Jun 2014 13:02:42 +0900 (KST) From: Naveen Krishna Chatradhi To: linux-arm-kernel@lists.infradead.org, spi-devel-general@lists.sourceforge.net, linux-samsung-soc@vger.kernel.org Subject: [PATCH 2/3 v5] spi: s3c64xx: for DT platofrms always get the chipselect info from DT node Date: Fri, 13 Jun 2014 09:29:51 +0530 Message-id: <1402631992-500-2-git-send-email-ch.naveen@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1402631992-500-1-git-send-email-ch.naveen@samsung.com> References: <1402631992-500-1-git-send-email-ch.naveen@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeLIzCtJLcpLzFFi42JZI2JSp/uofFawwYMDUhZTHz5hs3h5SNNi /pFzrBavzmxks5i86T6jRe+Cq2wWmx5fY7WYcX4fk8Wibf+ZLY5MaWR34PLYOesuu8emVZ1s Hneu7WHz2Lyk3mP3gs9MHn1bVjF6/Hyp4/F5k1wARxSXTUpqTmZZapG+XQJXxq1fF5kLDnNV rLv5l6WB8SxHFyMHh4SAicS03swuRk4gU0ziwr31bF2MXBxCAksZJTZtecUMkTCR6Dq0Byqx CCjx9i0LSEJIoJ9JYlmrC4jNJmAmcXDRanaQoSICZRLzJtSB1DMLbGKUmPzwJRtIjbBAisSX tbsZQWwWAVWJZRd/gMV5BZwlni+awAhxkILEnEk2IGFOAReJiyu6mCFWOUtsfLeLBWSmhMAp dolny4+wQ8wRkPg2+RALRK+s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cwWJg5OqQZGzRfVB7vWmf64Put/ s/6ca0v9frWKnzfYpblBLaMw0c/R65fh7c2x+bYXP1tNf/7uXfbx3bN1GtRuy39X2FHHe8lj 2c95u9ZuPGV7WLIutiGq4rCv++otbPV1Hi3N9TczRIxfTFFwsm25teeDsv/7bfq9+moeW4NP sVvvrrO2jopM3N18SddfiaU4I9FQi7moOBEAqzNKEgADAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140612_210305_945043_66CAF8B4 X-CRM114-Status: GOOD ( 10.05 ) X-Spam-Score: -5.7 (-----) Cc: devicetree@vger.kernel.org, kgene.kim@samsung.com, grant.likely@secretlab.ca, jaswinder.singh@linaro.org, broonie@kernel.org, cpgs@samsung.com, naveenkrishna.ch@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use controller_data structure only for the Non Device tree platforms. For Device tree platforms, always derive the chipselect info from DT node. Signed-off-by: Naveen Krishna Chatradhi Reviewed-by: Javier Martinez Canillas Tested-by: Doug Anderson --- Changes since v4: 1. Added reviewed by from Javier and Tested by from Doug Changes since v3: New change drivers/spi/spi-s3c64xx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index b888c66..f27e15d 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -795,14 +795,15 @@ static int s3c64xx_spi_setup(struct spi_device *spi) int err; sdd = spi_master_get_devdata(spi->master); - if (!cs && spi->dev.of_node) { + if (spi->dev.of_node) { cs = s3c64xx_get_slave_ctrldata(spi); spi->controller_data = cs; - } - - /* For the non-DT platforms derive chip selects from controller data */ - if (!spi->dev.of_node) + } else { + /* For the non-DT platforms derive chip + * selects from controller data + */ spi->cs_gpio = cs->line; + } if (IS_ERR_OR_NULL(cs)) { dev_err(&spi->dev, "No CS for SPI(%d)\n", spi->chip_select);