From patchwork Mon Jul 14 05:41:45 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: 4542601 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 C90479F295 for ; Mon, 14 Jul 2014 05:45:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 154732012B for ; Mon, 14 Jul 2014 05:45:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 352AF20172 for ; Mon, 14 Jul 2014 05:45:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753010AbaGNFpS (ORCPT ); Mon, 14 Jul 2014 01:45:18 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:24521 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752274AbaGNFpQ (ORCPT ); Mon, 14 Jul 2014 01:45:16 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N8O000RKTBDK370@mailout2.samsung.com>; Mon, 14 Jul 2014 14:45:13 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 29.F0.24374.96E63C35; Mon, 14 Jul 2014 14:45:13 +0900 (KST) X-AuditID: cbfee68d-b7fd46d000005f36-5a-53c36e69c2ad Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 52.A2.05196.96E63C35; Mon, 14 Jul 2014 14:45:13 +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 <0N8O00G1ETB5S4P0@mmp1.samsung.com>; Mon, 14 Jul 2014 14:45:13 +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 v6] spi: s3c64xx: for DT platofrms always get the chipselect info from DT node Date: Mon, 14 Jul 2014 11:11:45 +0530 Message-id: <1405316506-27855-3-git-send-email-ch.naveen@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1405316506-27855-1-git-send-email-ch.naveen@samsung.com> References: <1405316506-27855-1-git-send-email-ch.naveen@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeLIzCtJLcpLzFFi42JZI2JSq5uZdzjYoHG6ssXUh0/YLF4e0rSY f+Qcq8WrMxvZLCZvus9o0bvgKpvFpsfXWC1mnN/HZLFo239miyNTGtkduDx2zrrL7rFpVSeb x51re9g8Ni+p99i94DOTR9+WVYweP1/qeHzeJBfAEcVlk5Kak1mWWqRvl8CVsenVb9aCO1wV Hd9XsjYwPuDoYuTkkBAwkXi39DwzhC0mceHeerYuRi4OIYGljBLT10wCSnCAFT2YaAZSIySw iFGibzE/RE0/k0T/jA+sIAk2ATOJg4tWs4PUiwiUScybUAdSwyywiVFi8sOXbCA1wgIpEq9X vmICsVkEVCV2zjzJAmLzCrhKvF52mg1il4LEnEk2IGFOATeJvTv+MkHsdZVYcHAdK8hMCYFD 7BIXJn5ih5gjIPFt8iEWiF5ZiU0HoH6RlDi44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6vzeV4P2Bpu ndiaE7DzUaSU58SSmrI/KUXinpse3A83S50ka3L9cpi95xaTr9/CZx9iet2jl+XmdG2FmPnz dK9OGeFWpYCfP7qPWQg9//yKr+Pah/LG/rhH9jH+DmuOzP7FZf9kU0M/uxaDe/uUAOnbtzZc UG4y9761+qGZEktxRqKhFnNRcSIAtpopI9ECAAA= 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=-6.9 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 v5: None 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 b61ff3d..a4b1af0 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);