Module: xenomai-3
Branch: stable-3.0.x
Commit: f6d88b8d4c0d1e68673726dca5d668c29f275662
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f6d88b8d4c0d1e68673726dca5d668c29f275662

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Aug 10 10:14:28 2016 +0200

drivers/spi: fix read/write transfer descriptor

---

 kernel/drivers/spi/spi-bcm2835.c |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/kernel/drivers/spi/spi-bcm2835.c b/kernel/drivers/spi/spi-bcm2835.c
index 117cf38..da44bf7 100644
--- a/kernel/drivers/spi/spi-bcm2835.c
+++ b/kernel/drivers/spi/spi-bcm2835.c
@@ -324,13 +324,10 @@ static ssize_t bcm2835_read(struct rtdm_spi_remote_slave 
*slave,
        struct spi_master_bcm2835 *spim = to_master_bcm2835(slave);
        struct spi_slave_bcm2835 *bcm = to_slave_bcm2835(slave);
 
-       if (bcm->io_len == 0)
-               return -EINVAL; /* No I/O buffers set. */
-       
-       spim->tx_len = bcm->io_len / 2;
-       spim->rx_len = spim->tx_len;
+       spim->tx_len = len;
+       spim->rx_len = len;
        spim->tx_buf = NULL;
-       spim->rx_buf = bcm->io_virt;
+       spim->rx_buf = rx;
 
        return do_transfer_irq(slave) ?: len;
 }
@@ -341,12 +338,9 @@ static ssize_t bcm2835_write(struct rtdm_spi_remote_slave 
*slave,
        struct spi_master_bcm2835 *spim = to_master_bcm2835(slave);
        struct spi_slave_bcm2835 *bcm = to_slave_bcm2835(slave);
 
-       if (bcm->io_len == 0)
-               return -EINVAL; /* No I/O buffers set. */
-       
-       spim->tx_len = bcm->io_len / 2;
-       spim->rx_len = spim->tx_len;
-       spim->tx_buf = bcm->io_virt + bcm->io_len / 2;
+       spim->tx_len = len;
+       spim->rx_len = len;
+       spim->tx_buf = tx;
        spim->rx_buf = NULL;
 
        return do_transfer_irq(slave) ?: len;


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to