dect
/
linux-2.6
Archived
13
0
Fork 0

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: Jan Nikitenko <jan.nikitenko@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
Jan Nikitenko 2009-12-07 12:50:30 +00:00 committed by Grant Likely
parent b3a0894516
commit 04ba24b34a
1 changed files with 8 additions and 2 deletions

View File

@ -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",