[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <201307021010.00977.hartleys@visionengravers.com>
Date: Tue, 2 Jul 2013 10:10:00 -0700
From: H Hartley Sweeten <hartleys@...ionengravers.com>
To: Linux Kernel <linux-kernel@...r.kernel.org>
CC: <spi-devel-general@...ts.sourceforge.net>,
Ryan Mallon <rmallon@...il.com>, <mika.westerberg@....fi>,
<broonie@...nel.org>, <grant.likely@...aro.org>,
<hsweeten@...ionengravers.com>
Subject: [PATCH v2 08/11] spi: spi-ep93xx: don't bother calculating the divisors in ep93xx_spi_setup()
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 <hsweeten@...ionengravers.com>
Acked-by: Mika Westerberg <mika.westerberg@....fi>
Cc: Ryan Mallon <rmallon@...il.com>
Cc: Mark Brown <broonie@...nel.org>
Cc: Grant Likely <grant.likely@...aro.org>
---
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;
}
--
1.8.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists