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: 4346671 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 D9F189F4BC for ; Fri, 13 Jun 2014 04:02:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 10D2520303 for ; Fri, 13 Jun 2014 04:02:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF0C12028D for ; Fri, 13 Jun 2014 04:02:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751331AbaFMECp (ORCPT ); Fri, 13 Jun 2014 00:02:45 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:8941 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292AbaFMECo (ORCPT ); Fri, 13 Jun 2014 00:02:44 -0400 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>; 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 Cc: naveenkrishna.ch@gmail.com, broonie@kernel.org, grant.likely@secretlab.ca, jaswinder.singh@linaro.org, kgene.kim@samsung.com, cpgs@samsung.com, devicetree@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+sxKYDUDdLShxccYNlAqPw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Wmf64Put/ s/6ca0v9frWKnzfYpblBLaMw0c/R65fh7c2x+bYXP1tNf/7uXfbx3bN1GtRuy39X2FHHe8lj 2c95u9ZuPGV7WLIutiGq4rCv++otbPV1Hi3N9TczRIxfTFFwsm25teeDsv/7bfq9+moeW4NP sVvvrrO2jopM3N18SddfiaU4I9FQi7moOBEAqzNKEgADAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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);