提交 04ba24b3 编写于 作者: J Jan Nikitenko 提交者: Grant Likely

spi/au1550_spi: fix setupxfer not to override cfg with zeros

fix setupxfer() not to override generic configuration of speed_hz
and bits_per_word with zeros
Signed-off-by: NJan Nikitenko <jan.nikitenko@gmail.com>
Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
上级 b3a08945
......@@ -237,8 +237,14 @@ static int au1550_spi_setupxfer(struct spi_device *spi, struct spi_transfer *t)
unsigned bpw, hz;
u32 cfg, stat;
bpw = t ? t->bits_per_word : spi->bits_per_word;
hz = t ? t->speed_hz : spi->max_speed_hz;
bpw = spi->bits_per_word;
hz = spi->max_speed_hz;
if (t) {
if (t->bits_per_word)
bpw = t->bits_per_word;
if (t->speed_hz)
hz = t->speed_hz;
}
if (bpw < 4 || bpw > 24) {
dev_err(&spi->dev, "setupxfer: invalid bits_per_word=%d\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册