aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-03-02 09:30:32 -0500
committerMark Brown <broonie@linaro.org>2014-03-02 20:46:42 -0500
commitb14158603288b9d898716b41f2f0acb7d49dad2c (patch)
tree348eb676871eefc6d4c7d48c5c68482baa0fa9c4 /drivers
parent1bd6363bc0c69ff6120b53daa35cf9459c3628ad (diff)
spi: sh-msiof: Kill sh_msiof_spi_bits and sh_msiof_spi_hz functions
In the implementation of __spi_validate(), spi core will set transfer bits_per_word and max speed as spi device default if it is not set for this transfer. So we can remove the same implementation in this driver. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/spi-sh-msiof.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index db687011dc4f..3ffb8eed5ac5 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -417,26 +417,6 @@ static void sh_msiof_spi_read_fifo_s32u(struct sh_msiof_spi_priv *p,
417 put_unaligned(swab32(sh_msiof_read(p, RFDR) >> fs), &buf_32[k]); 417 put_unaligned(swab32(sh_msiof_read(p, RFDR) >> fs), &buf_32[k]);
418} 418}
419 419
420static int sh_msiof_spi_bits(struct spi_device *spi, struct spi_transfer *t)
421{
422 int bits;
423
424 bits = t ? t->bits_per_word : 0;
425 if (!bits)
426 bits = spi->bits_per_word;
427 return bits;
428}
429
430static u32 sh_msiof_spi_hz(struct spi_device *spi, struct spi_transfer *t)
431{
432 u32 hz;
433
434 hz = t ? t->speed_hz : 0;
435 if (!hz)
436 hz = spi->max_speed_hz;
437 return hz;
438}
439
440static int sh_msiof_spi_setup(struct spi_device *spi) 420static int sh_msiof_spi_setup(struct spi_device *spi)
441{ 421{
442 struct device_node *np = spi->master->dev.of_node; 422 struct device_node *np = spi->master->dev.of_node;
@@ -574,7 +554,7 @@ static int sh_msiof_transfer_one(struct spi_master *master,
574 int n; 554 int n;
575 bool swab; 555 bool swab;
576 556
577 bits = sh_msiof_spi_bits(spi, t); 557 bits = t->bits_per_word;
578 558
579 if (bits <= 8 && t->len > 15 && !(t->len & 3)) { 559 if (bits <= 8 && t->len > 15 && !(t->len & 3)) {
580 bits = 32; 560 bits = 32;
@@ -624,8 +604,7 @@ static int sh_msiof_transfer_one(struct spi_master *master,
624 } 604 }
625 605
626 /* setup clocks (clock already enabled in chipselect()) */ 606 /* setup clocks (clock already enabled in chipselect()) */
627 sh_msiof_spi_set_clk_regs(p, clk_get_rate(p->clk), 607 sh_msiof_spi_set_clk_regs(p, clk_get_rate(p->clk), t->speed_hz);
628 sh_msiof_spi_hz(spi, t));
629 608
630 /* transfer in fifo sized chunks */ 609 /* transfer in fifo sized chunks */
631 words = t->len / bytes_per_word; 610 words = t->len / bytes_per_word;