diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2018-06-27 21:54:27 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-07-02 06:36:53 +0200 |
commit | 0ca998a69bb3f889141aad1872ff0fb53979605a (patch) | |
tree | 54726d589bb240076b063b088ec5299856a8ac53 | |
parent | 29e9cd15dcf1e152582cdd9eef89d5e70a55aa7e (diff) | |
download | barebox-0ca998a69bb3f889141aad1872ff0fb53979605a.tar.gz barebox-0ca998a69bb3f889141aad1872ff0fb53979605a.tar.xz |
mtd: mtd_dataflash: Don't print bogus command values for READs
Call to dev_dbg in dataflash_read() is located to early, before
command[] is initialize to correct values, so it end up printing
values from previous invocation. Move it such that it prints current
call's values.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/mtd/devices/mtd_dataflash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 4b8eaec057..7980a91e19 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c @@ -246,9 +246,6 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len, command = priv->command; - dev_dbg(&priv->spi->dev, "READ: (%x) %x %x %x\n", - command[0], command[1], command[2], command[3]); - spi_message_init(&msg); memset(&x[0], 0, sizeof(struct spi_transfer) * 2); @@ -271,6 +268,9 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len, command[3] = (u8)(addr >> 0); /* plus 4 "don't care" bytes */ + dev_dbg(&priv->spi->dev, "READ: (%x) %x %x %x\n", + command[0], command[1], command[2], command[3]); + status = spi_sync(priv->spi, &msg); if (status >= 0) { |