提交 3936e4c8 编写于 作者: A Andy Shevchenko 提交者: Greg Kroah-Hartman

at25: fix debug and error messaging

The patch does the following:
- fixes specifiers and removes explicit casting of the parameters
- joins literals to one line
- increases readability of the parameters
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 13decfb4
...@@ -121,9 +121,8 @@ static int at25_ee_read(void *priv, unsigned int offset, ...@@ -121,9 +121,8 @@ static int at25_ee_read(void *priv, unsigned int offset,
* this chip is clocked very slowly * this chip is clocked very slowly
*/ */
status = spi_sync(at25->spi, &m); status = spi_sync(at25->spi, &m);
dev_dbg(&at25->spi->dev, dev_dbg(&at25->spi->dev, "read %zu bytes at %d --> %zd\n",
"read %Zd bytes at %d --> %d\n", count, offset, status);
count, offset, (int) status);
mutex_unlock(&at25->lock); mutex_unlock(&at25->lock);
return status; return status;
...@@ -167,8 +166,7 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count) ...@@ -167,8 +166,7 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count)
*cp = AT25_WREN; *cp = AT25_WREN;
status = spi_write(at25->spi, cp, 1); status = spi_write(at25->spi, cp, 1);
if (status < 0) { if (status < 0) {
dev_dbg(&at25->spi->dev, "WREN --> %d\n", dev_dbg(&at25->spi->dev, "WREN --> %d\n", status);
(int) status);
break; break;
} }
...@@ -196,9 +194,8 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count) ...@@ -196,9 +194,8 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count)
memcpy(cp, buf, segment); memcpy(cp, buf, segment);
status = spi_write(at25->spi, bounce, status = spi_write(at25->spi, bounce,
segment + at25->addrlen + 1); segment + at25->addrlen + 1);
dev_dbg(&at25->spi->dev, dev_dbg(&at25->spi->dev, "write %u bytes at %u --> %d\n",
"write %u bytes at %u --> %d\n", segment, offset, status);
segment, offset, (int) status);
if (status < 0) if (status < 0)
break; break;
...@@ -225,8 +222,7 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count) ...@@ -225,8 +222,7 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count)
if ((sr < 0) || (sr & AT25_SR_nRDY)) { if ((sr < 0) || (sr & AT25_SR_nRDY)) {
dev_err(&at25->spi->dev, dev_err(&at25->spi->dev,
"write %d bytes offset %d, " "write %u bytes offset %u, timeout after %u msecs\n",
"timeout after %u msecs\n",
segment, offset, segment, offset,
jiffies_to_msecs(jiffies - jiffies_to_msecs(jiffies -
(timeout - EE_TIMEOUT))); (timeout - EE_TIMEOUT)));
...@@ -368,9 +364,7 @@ static int at25_probe(struct spi_device *spi) ...@@ -368,9 +364,7 @@ static int at25_probe(struct spi_device *spi)
return PTR_ERR(at25->nvmem); return PTR_ERR(at25->nvmem);
dev_info(&spi->dev, "%d %s %s eeprom%s, pagesize %u\n", dev_info(&spi->dev, "%d %s %s eeprom%s, pagesize %u\n",
(chip.byte_len < 1024) (chip.byte_len < 1024) ? chip.byte_len : (chip.byte_len / 1024),
? chip.byte_len
: (chip.byte_len / 1024),
(chip.byte_len < 1024) ? "Byte" : "KByte", (chip.byte_len < 1024) ? "Byte" : "KByte",
at25->chip.name, at25->chip.name,
(chip.flags & EE_READONLY) ? " (readonly)" : "", (chip.flags & EE_READONLY) ? " (readonly)" : "",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册