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: 4341971 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 813A19F333 for ; Thu, 12 Jun 2014 13:18:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5EE9F2034C for ; Thu, 12 Jun 2014 13:18:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0920120351 for ; Thu, 12 Jun 2014 13:18:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932770AbaFLNS0 (ORCPT ); Thu, 12 Jun 2014 09:18:26 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:14494 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932554AbaFLNSZ (ORCPT ); Thu, 12 Jun 2014 09:18:25 -0400 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>; 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 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, Javier Martinez Canillas , Doug Anderson , Tomasz Figa 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 QM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SaWFZcmXuIUYKDWUmE12TazGAh3pTEyqrU 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 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 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);