All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/8] spi: spi-ep93xx: don't bother calculating the divisors in ep93xx_spi_setup()
@ 2013-06-28 18:45 H Hartley Sweeten
  2013-06-30 16:27 ` Mika Westerberg
  0 siblings, 1 reply; 2+ messages in thread
From: H Hartley Sweeten @ 2013-06-28 18:45 UTC (permalink / raw)
  To: Linux Kernel
  Cc: spi-devel-general, Ryan Mallon, mika.westerberg, broonie, grant.likely

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@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Cc: Mika Westerberg <mika.westerberg@iki.fi>
Cc: Mark Brown <broonie@kernel.org>
Cc: Grant Likely <grant.likely@linaro.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 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;
 }
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 6/8] spi: spi-ep93xx: don't bother calculating the divisors in ep93xx_spi_setup()
  2013-06-28 18:45 [PATCH 6/8] spi: spi-ep93xx: don't bother calculating the divisors in ep93xx_spi_setup() H Hartley Sweeten
@ 2013-06-30 16:27 ` Mika Westerberg
  0 siblings, 0 replies; 2+ messages in thread
From: Mika Westerberg @ 2013-06-30 16:27 UTC (permalink / raw)
  To: H Hartley Sweeten
  Cc: Linux Kernel, spi-devel-general, Ryan Mallon, broonie, grant.likely

On Fri, Jun 28, 2013 at 11:45:02AM -0700, H Hartley Sweeten wrote:
> 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@visionengravers.com>
> Cc: Ryan Mallon <rmallon@gmail.com>
> Cc: Mika Westerberg <mika.westerberg@iki.fi>

Acked-by: Mika Westerberg <mika.westerberg@iki.fi>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-30 16:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-28 18:45 [PATCH 6/8] spi: spi-ep93xx: don't bother calculating the divisors in ep93xx_spi_setup() H Hartley Sweeten
2013-06-30 16:27 ` Mika Westerberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.