From patchwork Thu Jun 12 13:13:40 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: 4342011 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 7DB909F333 for ; Thu, 12 Jun 2014 13:20:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5D932034C for ; Thu, 12 Jun 2014 13:20:45 +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 A02002034A for ; Thu, 12 Jun 2014 13:20:44 +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 1Wv4u1-0002LH-1I; Thu, 12 Jun 2014 13:18:49 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wv4tx-0002C3-Cr for linux-arm-kernel@lists.infradead.org; Thu, 12 Jun 2014 13:18:46 +0000 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N72003WM4YNEFA0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 12 Jun 2014 22:18:24 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 55.30.16580.F98A9935; Thu, 12 Jun 2014 22:18:23 +0900 (KST) X-AuditID: cbfee691-b7f2f6d0000040c4-73-5399a89f25f0 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id DF.01.08203.F98A9935; Thu, 12 Jun 2014 22:18:23 +0900 (KST) Received: from chnaveen-ubuntu.sisodomain.com ([107.108.83.161]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N720043G4V85LA0@mmp2.samsung.com>; Thu, 12 Jun 2014 22:18:23 +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 v4] spi: s3c64xx: for DT platofrms always get the chipselect info from DT node Date: Thu, 12 Jun 2014 18:43:40 +0530 Message-id: <1402578821-27338-2-git-send-email-ch.naveen@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1402578821-27338-1-git-send-email-ch.naveen@samsung.com> References: <1402578821-27338-1-git-send-email-ch.naveen@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRmVeSWpSXmKPExsWyRsSkVnf+ipnBBj3zjS2mPnzCZvHykKbF /CPnWC3OLjvIZvHqzEY2i8mb7jNaHP1dYNG74CqbxabH11gtZpzfx2SxaNt/ZosjUxrZLdbP eM3iwOsxu+Eii8ff59dZPHbOusvusWlVJ5vHnWt72Dw2L6n32L3gM5NH35ZVjB4/X+p4fN4k F8AVxWWTkpqTWZZapG+XwJXxZNIBpoKXnBVXth1kbmDs5Ohi5OSQEDCRmPr0PBuELSZx4d56 MFtIYCmjxKTWNJia7m1TWboYuYDi0xklmo7/Yodw+pkk/lxpZQWpYhMwkzi4aDVQgoNDRKBM Yt6EOpAaZoHdTBKXzz4FmyoskCKxa/9VFhCbRUBV4tW8ZkYQm1fAVWLOjEYWkF4JAQWJOZNs QMKcAm4Sj/ZtYI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WUmE12TazGAh3pTEyqrU ovz4otKc1OJDjMlAR01klhJNzgemkbySeENjE3NTY1NLEwsTM0vShJXEeQ+0WgcKCaQnlqRm p6YWpBbBbGHi4JRqYGTOMIm+Hb9iWwTTvcmzUjXyFzJdbJg5Rbmq8veTV3+l9i4V+GDPv/tH Gdf708K/s5j5e77GHLj3yPXWlKfRMadPRP67HSBue1tMe/qKeYy5l4LfNl76WLtPlydlU4A0 t/qVhdwae2sXl3duyJyzSu3zhMWdMbsmncoIepJW4lfkLvr6SAJ/FosSS3FGoqEWc1FxIgCJ 7wtfGQMAAA== 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_061845_616028_C34C2EB2 X-CRM114-Status: UNSURE ( 9.77 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.7 (-----) Cc: devicetree@vger.kernel.org, kgene.kim@samsung.com, Tomasz Figa , Doug Anderson , grant.likely@secretlab.ca, jaswinder.singh@linaro.org, broonie@kernel.org, cpgs@samsung.com, naveenkrishna.ch@gmail.com, Javier Martinez Canillas 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 Cc: Javier Martinez Canillas Cc: Doug Anderson Cc: Tomasz Figa Reviewed-by: Javier Martinez Canillas Tested-by: Doug Anderson --- 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);