From patchwork Thu Oct 10 12:45:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Renner X-Patchwork-Id: 3015781 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F30D8BF924 for ; Thu, 10 Oct 2013 12:59:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D795201BF for ; Thu, 10 Oct 2013 12:59:44 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 203D72017D for ; Thu, 10 Oct 2013 12:59:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VUFq9-0001DO-Rg; Thu, 10 Oct 2013 12:59:41 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VUFq8-0001DI-4r for spi-devel-general@lists.sourceforge.net; Thu, 10 Oct 2013 12:59:40 +0000 X-ACL-Warn: Received: from moutng.kundenserver.de ([212.227.17.8]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1VUFq6-0001hk-6m for spi-devel-general@lists.sourceforge.net; Thu, 10 Oct 2013 12:59:40 +0000 Received: from [192.168.0.18] (dslb-178-004-232-224.pools.arcor-ip.net [178.4.232.224]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0Lp6ay-1VxpgZ1wBA-00eqib; Thu, 10 Oct 2013 14:46:00 +0200 Message-ID: <5256A186.5030708@efe-gmbh.de> Date: Thu, 10 Oct 2013 14:45:58 +0200 From: Jens Renner Organization: EFE GmbH User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: spi-devel-general@lists.sourceforge.net Subject: [PATCH] spi/xilinx: Use DT information for bits_per_word value, fix bus_num value X-Enigmail-Version: 1.5.2 X-Provags-ID: V02:K0:uBAopq8Uu/NTYPpirTCy8Wsc/SAuxmfKEQJJu+42j2/ gWsKXdLEle2YbZxVOIIgiJjbXvPfuhI3YH3PshcHcH2na8levU GCh69ZMN+iKbnTda2NnvD3H6Kr8Tc60No1U2osv855qrScoQ2z vB7j4RqX39MWcpEDzGfWXnv6ZdR5qgWNIhlkmSF4d3jj9j/TK3 hCo4TeOdEV5e5s4FTEqr6n5aencgLdJQVqikTlycmBcNQEK1th DA4M1ozb8a0CSUIFPUn+Rb2kJ1R8W7U/O/cABdi0vSbckv1eDR raCPFdlXFunxMASvKObPxPvQW+a4hgmKRPbzPlTycBHEX1qKAx AqvNXAfCspMszxxUjE7E= X-Spam-Score: 0.0 (/) X-Headers-End: 1VUFq6-0001hk-6m Cc: Renaud Muller , broonie@sirena.org.uk, Michal Simek X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Spam-Status: No, score=-7.1 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 This patch overrides the default value of bits_per_word with the actual value of "xlnx,num-transfer-bits" from the DTS file to allow for 16 and 32 bit word lengths. Also, bus_num always was (and probably should still be) derived from pdev->id. Otherwise this could lead to problems when using more than one SPI master. Signed-off-by: Jens Renner --- drivers/spi/spi-xilinx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index 0bf1b2c..5a6d9c5 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c @@ -356,6 +356,8 @@ static int xilinx_spi_probe(struct platform_device *pdev) } else { of_property_read_u32(pdev->dev.of_node, "xlnx,num-ss-bits", &num_cs); + of_property_read_u32(pdev->dev.of_node, "xlnx,num-transfer-bits", + &bits_per_word); } if (!num_cs) { @@ -385,7 +387,7 @@ static int xilinx_spi_probe(struct platform_device *pdev) goto put_master; } - master->bus_num = pdev->dev.id; + master->bus_num = pdev->id; master->num_chipselect = num_cs; master->dev.of_node = pdev->dev.of_node;