drivers: spi: stm32: remove extraneous unaligned macros
Byte access is always naturally aligned; there's no need to use UNALIGNED_GET or UNALIGNED_PUT. Those would only be needed when supporting 16-bit data frames. Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
This commit is contained in:
parent
78214d0569
commit
d5ee0cfbf9
1 changed files with 2 additions and 5 deletions
|
@ -222,8 +222,7 @@ static int spi_stm32_configure(struct spi_config *config)
|
||||||
static void spi_stm32_transmit(SPI_TypeDef *spi, struct spi_stm32_data *data)
|
static void spi_stm32_transmit(SPI_TypeDef *spi, struct spi_stm32_data *data)
|
||||||
{
|
{
|
||||||
if (spi_context_tx_on(&data->ctx)) {
|
if (spi_context_tx_on(&data->ctx)) {
|
||||||
LL_SPI_TransmitData8(spi, UNALIGNED_GET((u8_t *)
|
LL_SPI_TransmitData8(spi, *data->ctx.tx_buf);
|
||||||
(data->ctx.tx_buf)));
|
|
||||||
} else {
|
} else {
|
||||||
/* Transmit NOP byte */
|
/* Transmit NOP byte */
|
||||||
LL_SPI_TransmitData8(spi, 0);
|
LL_SPI_TransmitData8(spi, 0);
|
||||||
|
@ -235,9 +234,7 @@ static void spi_stm32_transmit(SPI_TypeDef *spi, struct spi_stm32_data *data)
|
||||||
static void spi_stm32_receive(SPI_TypeDef *spi, struct spi_stm32_data *data)
|
static void spi_stm32_receive(SPI_TypeDef *spi, struct spi_stm32_data *data)
|
||||||
{
|
{
|
||||||
if (spi_context_rx_on(&data->ctx)) {
|
if (spi_context_rx_on(&data->ctx)) {
|
||||||
u8_t byte = LL_SPI_ReceiveData8(spi);
|
*data->ctx.rx_buf = LL_SPI_ReceiveData8(spi);
|
||||||
|
|
||||||
UNALIGNED_PUT(byte, (u8_t *)data->ctx.rx_buf);
|
|
||||||
} else {
|
} else {
|
||||||
LL_SPI_ReceiveData8(spi);
|
LL_SPI_ReceiveData8(spi);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue