From patchwork Fri Jun 28 18:45:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hartley Sweeten X-Patchwork-Id: 2801281 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 921ECBF4A1 for ; Fri, 28 Jun 2013 19:05:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 766B8202CC for ; Fri, 28 Jun 2013 19:05:42 +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 07707202CA for ; Fri, 28 Jun 2013 19:05:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1UsdzI-00037G-9k; Fri, 28 Jun 2013 19:05:40 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1UsdzF-00036r-Dp for spi-devel-general@lists.sourceforge.net; Fri, 28 Jun 2013 19:05:37 +0000 X-ACL-Warn: Received: from mail1.bemta8.messagelabs.com ([216.82.243.208]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1UsdzD-0004hG-N0 for spi-devel-general@lists.sourceforge.net; Fri, 28 Jun 2013 19:05:37 +0000 Received: from [216.82.242.99:48481] by server-16.bemta-8.messagelabs.com id A2/C4-01682-3D9DDC15; Fri, 28 Jun 2013 18:45:39 +0000 X-Env-Sender: hartleys@visionengravers.com X-Msg-Ref: server-2.tower-131.messagelabs.com!1372445126!23361819!21 X-Originating-IP: [216.166.12.31] X-StarScan-Received: X-StarScan-Version: 6.9.9; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18996 invoked from network); 28 Jun 2013 18:45:38 -0000 Received: from out001.collaborationhost.net (HELO out001.collaborationhost.net) (216.166.12.31) by server-2.tower-131.messagelabs.com with RC4-SHA encrypted SMTP; 28 Jun 2013 18:45:38 -0000 Received: from etch.local (10.2.3.210) by smtp.collaborationhost.net (10.2.0.46) with Microsoft SMTP Server (TLS) id 8.3.213.0; Fri, 28 Jun 2013 13:45:31 -0500 From: H Hartley Sweeten To: Linux Kernel Subject: [PATCH 6/8] spi: spi-ep93xx: don't bother calculating the divisors in ep93xx_spi_setup() Date: Fri, 28 Jun 2013 11:45:02 -0700 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Disposition: inline Message-ID: <201306281145.02815.hartleys@visionengravers.com> X-Spam-Score: 0.0 (/) X-Headers-End: 1UsdzD-0004hG-N0 Cc: grant.likely@linaro.org, spi-devel-general@lists.sourceforge.net, mika.westerberg@iki.fi, broonie@kernel.org, Ryan Mallon 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=-8.2 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 The divisors needed to generate the SPI clock are calculated per transfer based on the t->speed_hz. There is no reason to calculate them in ep93xx_spi_setup(). Signed-off-by: H Hartley Sweeten Cc: Ryan Mallon Cc: Mika Westerberg Cc: Mark Brown Cc: Grant Likely Acked-by: Mika Westerberg --- drivers/spi/spi-ep93xx.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c index cb22c89..2f2d51a 100644 --- a/drivers/spi/spi-ep93xx.c +++ b/drivers/spi/spi-ep93xx.c @@ -137,7 +137,6 @@ struct ep93xx_spi { /** * struct ep93xx_spi_chip - SPI device hardware settings * @spi: back pointer to the SPI device - * @rate: max rate in hz this chip supports * @div_cpsr: cpsr (pre-scaler) divider * @div_scr: scr divider * @ops: private chip operations @@ -148,7 +147,6 @@ struct ep93xx_spi { */ struct ep93xx_spi_chip { const struct spi_device *spi; - unsigned long rate; u8 div_cpsr; u8 div_scr; struct ep93xx_spi_chip_ops *ops; @@ -291,18 +289,6 @@ static int ep93xx_spi_setup(struct spi_device *spi) spi_set_ctldata(spi, chip); } - if (spi->max_speed_hz != chip->rate) { - int err; - - err = ep93xx_spi_calc_divisors(espi, chip, spi->max_speed_hz); - if (err != 0) { - spi_set_ctldata(spi, NULL); - kfree(chip); - return err; - } - chip->rate = spi->max_speed_hz; - } - ep93xx_spi_cs_control(spi, false); return 0; }