From patchwork Fri Mar 12 15:22:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Ellis X-Patchwork-Id: 85307 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2CFMLxV024788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 12 Mar 2010 15:23:00 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Nq6gv-00047i-Pk; Fri, 12 Mar 2010 15:22:21 +0000 Received: from sfi-mx-3.v28.ch3.sourceforge.com ([172.29.28.123] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Nq6gt-00047b-Vl for spi-devel-general@lists.sourceforge.net; Fri, 12 Mar 2010 15:22:19 +0000 X-ACL-Warn: Received: from pan.gwi.net ([207.5.128.165]) by sfi-mx-3.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1Nq6gt-0000yd-67 for spi-devel-general@lists.sourceforge.net; Fri, 12 Mar 2010 15:22:19 +0000 Received: from [192.168.10.4] (66-63-88-74.static.suscom-maine.net [66.63.88.74]) by pan.gwi.net (8.13.1/8.13.1) with ESMTP id o2CFM9Bx033596; Fri, 12 Mar 2010 10:22:09 -0500 (EST) (envelope-from scott@jumpnowtek.com) From: Scott Ellis To: spi-devel-general@lists.sourceforge.net Date: Fri, 12 Mar 2010 10:22:09 -0500 Message-ID: <1268407329.14445.54.camel@quad> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. _SUMMARY_ X-Headers-End: 1Nq6gt-0000yd-67 Cc: David Brownell , Tony Lindgren , Aaro Koskinen , Kevin Hilman , Andrew Morton , linux-omap@vger.kernel.org, Roman Tereshonkov Subject: [spi-devel-general] [PATCH 5/6] SPI omap2_mcspi.c: Use num chipselects from platform data 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-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 12 Mar 2010 15:23:01 +0000 (UTC) diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index cce23c5..cd9fdc2 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c @@ -1058,33 +1058,28 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev) struct resource *r; int status = 0, i; const u8 *rxdma_id, *txdma_id; - unsigned num_chipselect; struct omap2_mcspi_platform_config *pdata; switch (pdev->id) { case 1: rxdma_id = spi1_rxdma_id; txdma_id = spi1_txdma_id; - num_chipselect = 4; break; case 2: rxdma_id = spi2_rxdma_id; txdma_id = spi2_txdma_id; - num_chipselect = 2; break; #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) \ || defined(CONFIG_ARCH_OMAP4) case 3: rxdma_id = spi3_rxdma_id; txdma_id = spi3_txdma_id; - num_chipselect = 2; break; #endif #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) case 4: rxdma_id = spi4_rxdma_id; txdma_id = spi4_txdma_id; - num_chipselect = 1; break; #endif default: @@ -1106,7 +1101,6 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev) master->setup = omap2_mcspi_setup; master->transfer = omap2_mcspi_transfer; master->cleanup = omap2_mcspi_cleanup; - master->num_chipselect = num_chipselect; dev_set_drvdata(&pdev->dev, master); @@ -1114,6 +1108,7 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev) mcspi->master = master; pdata = (struct omap2_mcspi_platform_config *)pdev->dev.platform_data; mcspi->max_clk_div = pdata->max_clk_div; + master->num_chipselect = pdata->num_cs; r = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (r == NULL) { @@ -1160,7 +1155,7 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev) if (mcspi->dma_channels == NULL) goto err3; - for (i = 0; i < num_chipselect; i++) { + for (i = 0; i < master->num_chipselect; i++) { mcspi->dma_channels[i].dma_rx_channel = -1; mcspi->dma_channels[i].dma_rx_sync_dev = rxdma_id[i]; mcspi->dma_channels[i].dma_tx_channel = -1;