summaryrefslogtreecommitdiff
path: root/drivers/spi/stm32_spi.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-07-14 09:09:49 -0400
committerTom Rini <trini@konsulko.com>2019-07-14 09:09:49 -0400
commita9a3a37f92b072a56693ad665ab4c5cc73028d16 (patch)
treed0a4e94e94d77ba06983abbe4b89d2c39a0c5d7f /drivers/spi/stm32_spi.c
parent6070ef409c1018860e8dd1f077297546d9d80115 (diff)
parent291f00bb3ea7e9f9acdddbe680991e76313732d6 (diff)
downloadu-boot-a9a3a37f92b072a56693ad665ab4c5cc73028d16.tar.gz
Merge tag 'u-boot-stm32-20190712' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
- syscon: add support for power off - stm32mp1: add op-tee config - stm32mp1: add specific commands: stboard and stm32key - add stm32 mailbox driver - solve many stm32 warnings when building with W=1 - update stm32 gpio driver
Diffstat (limited to 'drivers/spi/stm32_spi.c')
-rw-r--r--drivers/spi/stm32_spi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/spi/stm32_spi.c b/drivers/spi/stm32_spi.c
index 34b217584d..75b6006b45 100644
--- a/drivers/spi/stm32_spi.c
+++ b/drivers/spi/stm32_spi.c
@@ -99,8 +99,8 @@ struct stm32_spi_priv {
unsigned int cur_bpw;
unsigned int cur_hz;
unsigned int cur_xferlen; /* current transfer length in bytes */
- int tx_len; /* number of data to be written in bytes */
- int rx_len; /* number of data to be read in bytes */
+ unsigned int tx_len; /* number of data to be written in bytes */
+ unsigned int rx_len; /* number of data to be read in bytes */
const void *tx_buf; /* data to be written, or NULL */
void *rx_buf; /* data to be read, or NULL */
u32 cur_mode;
@@ -322,7 +322,8 @@ static int stm32_spi_set_fthlv(struct udevice *dev, u32 xfer_len)
static int stm32_spi_set_speed(struct udevice *bus, uint hz)
{
struct stm32_spi_priv *priv = dev_get_priv(bus);
- u32 div, mbrdiv;
+ u32 mbrdiv;
+ long div;
debug("%s: hz=%d\n", __func__, hz);
@@ -341,7 +342,7 @@ static int stm32_spi_set_speed(struct udevice *bus, uint hz)
else
mbrdiv = fls(div) - 1;
- if ((mbrdiv - 1) < 0)
+ if (!mbrdiv)
return -EINVAL;
clrsetbits_le32(priv->base + STM32_SPI_CFG1, SPI_CFG1_MBR,
@@ -481,7 +482,7 @@ static int stm32_spi_probe(struct udevice *dev)
struct stm32_spi_priv *priv = dev_get_priv(dev);
unsigned long clk_rate;
int ret;
- int i;
+ unsigned int i;
priv->base = dev_remap_addr(dev);
if (!priv->base)