[rtems commit] bsp/atsam: Remove duplicate SPI register field

Sebastian Huber sebh at rtems.org
Wed Dec 14 12:10:18 UTC 2016


Module:    rtems
Branch:    master
Commit:    9035630f00e8d90305efa08a14a25211b0682a87
Changeset: http://git.rtems.org/rtems/commit/?id=9035630f00e8d90305efa08a14a25211b0682a87

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Dec 14 07:43:25 2016 +0100

bsp/atsam: Remove duplicate SPI register field

---

 c/src/lib/libbsp/arm/atsam/spi/atsam_spi_bus.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/c/src/lib/libbsp/arm/atsam/spi/atsam_spi_bus.c b/c/src/lib/libbsp/arm/atsam/spi/atsam_spi_bus.c
index 99df45e..4c140cc 100644
--- a/c/src/lib/libbsp/arm/atsam/spi/atsam_spi_bus.c
+++ b/c/src/lib/libbsp/arm/atsam/spi/atsam_spi_bus.c
@@ -38,7 +38,6 @@
 
 typedef struct {
   spi_bus base;
-  Spi *regs;
   rtems_vector_number irq;
   uint32_t msg_todo;
   const spi_ioc_transfer *msgs;
@@ -168,7 +167,7 @@ static void atsam_configure_spi(atsam_spi_bus *bus)
 
   SPID_Configure(
     &bus->SpiDma,
-    bus->regs,
+    bus->SpiDma.pSpiHw,
     bus->SpiDma.spiId,
     (SPI_MR_DLYBCS(delay_cs) |
       SPI_MR_MSTR |
@@ -185,7 +184,7 @@ static void atsam_configure_spi(atsam_spi_bus *bus)
 
   atsam_set_phase_and_polarity(bus->base.mode, &csr);
 
-  SPI_ConfigureNPCS(bus->regs, bus->base.cs, csr);
+  SPI_ConfigureNPCS(bus->SpiDma.pSpiHw, bus->base.cs, csr);
 }
 
 static uint8_t atsam_configure_dma_channels(
@@ -531,9 +530,9 @@ int spi_bus_register_atsam(
   bus->base.speed_hz = bus->base.max_speed_hz;
   bus->base.delay_usecs = 1;
   bus->base.cs = 1;
-  bus->regs = spi_regs;
   bus->irq = ID_XDMAC;
   bus->SpiDma.spiId = spi_peripheral_id;
+  bus->SpiDma.pSpiHw = spi_regs;
 
   PIO_Configure(pins, pin_count);
   PMC_EnablePeripheral(spi_peripheral_id);



More information about the vc mailing list