From patchwork Tue Jul 2 17:10:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hartley Sweeten X-Patchwork-Id: 2814131 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 450F3BF4A1 for ; Tue, 2 Jul 2013 17:10:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C8C620185 for ; Tue, 2 Jul 2013 17:10:41 +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 4540B2017A for ; Tue, 2 Jul 2013 17:10:40 +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 1Uu46B-0008An-IB; Tue, 02 Jul 2013 17:10:39 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Uu469-0008Ad-7B for spi-devel-general@lists.sourceforge.net; Tue, 02 Jul 2013 17:10:37 +0000 X-ACL-Warn: Received: from mail1.bemta12.messagelabs.com ([216.82.251.11]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1Uu467-0000jY-Dh for spi-devel-general@lists.sourceforge.net; Tue, 02 Jul 2013 17:10:37 +0000 Received: from [216.82.250.115:2369] by server-11.bemta-12.messagelabs.com id 3A/E6-32766-58903D15; Tue, 02 Jul 2013 17:10:29 +0000 X-Env-Sender: hartleys@visionengravers.com X-Msg-Ref: server-13.tower-127.messagelabs.com!1372785007!6212267!31 X-Originating-IP: [216.166.12.97] X-StarScan-Received: X-StarScan-Version: 6.9.9; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26337 invoked from network); 2 Jul 2013 17:10:28 -0000 Received: from out001.collaborationhost.net (HELO out001.collaborationhost.net) (216.166.12.97) by server-13.tower-127.messagelabs.com with RC4-SHA encrypted SMTP; 2 Jul 2013 17:10:28 -0000 Received: from etch.local (10.2.3.210) by smtp.collaborationhost.net (10.2.0.21) with Microsoft SMTP Server (TLS) id 8.3.213.0; Tue, 2 Jul 2013 12:10:20 -0500 From: H Hartley Sweeten To: Linux Kernel Subject: [PATCH v2 08/11] spi: spi-ep93xx: don't bother calculating the divisors in ep93xx_spi_setup() Date: Tue, 2 Jul 2013 10:10:00 -0700 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Disposition: inline Message-ID: <201307021010.00977.hartleys@visionengravers.com> X-Spam-Score: 0.0 (/) X-Headers-End: 1Uu467-0000jY-Dh Cc: Ryan Mallon , mika.westerberg@iki.fi, hsweeten@visionengravers.com, broonie@kernel.org, grant.likely@linaro.org, spi-devel-general@lists.sourceforge.net 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=-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 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 Acked-by: Mika Westerberg Cc: Ryan Mallon Cc: Mark Brown Cc: Grant Likely --- 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 cc2a240..6cdfc40 100644 --- a/drivers/spi/spi-ep93xx.c +++ b/drivers/spi/spi-ep93xx.c @@ -136,7 +136,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 @@ -147,7 +146,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; @@ -315,18 +313,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; }