浏览代码

spi: fixed odd static string conventions in core code

This patch removes convention of passing a static string as a
parameter to another static string.  The convention is intended to
reduce text usage by sharing the common bits of the string, but the
implementation is inherently fragile (a change to one format string
but not the other will nullify any possible advantage), it isn't
necessarily a net win depending on what this compiler does, and it
it reduces code readability.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
[grant.likely@secretlab.ca: removed dev_dbg->dev_err hunk]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Linus Walleij 14 年之前
父节点
当前提交
eb288a1f45
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      drivers/spi/spi.c

+ 5 - 5
drivers/spi/spi.c

@@ -300,16 +300,16 @@ int spi_add_device(struct spi_device *spi)
 	 */
 	 */
 	status = spi_setup(spi);
 	status = spi_setup(spi);
 	if (status < 0) {
 	if (status < 0) {
-		dev_err(dev, "can't %s %s, status %d\n",
-				"setup", dev_name(&spi->dev), status);
+		dev_err(dev, "can't setup %s, status %d\n",
+				dev_name(&spi->dev), status);
 		goto done;
 		goto done;
 	}
 	}
 
 
 	/* Device may be bound to an active driver when this returns */
 	/* Device may be bound to an active driver when this returns */
 	status = device_add(&spi->dev);
 	status = device_add(&spi->dev);
 	if (status < 0)
 	if (status < 0)
-		dev_err(dev, "can't %s %s, status %d\n",
-				"add", dev_name(&spi->dev), status);
+		dev_err(dev, "can't add %s, status %d\n",
+				dev_name(&spi->dev), status);
 	else
 	else
 		dev_dbg(dev, "registered child %s\n", dev_name(&spi->dev));
 		dev_dbg(dev, "registered child %s\n", dev_name(&spi->dev));
 
 
@@ -658,7 +658,7 @@ int spi_setup(struct spi_device *spi)
 	 */
 	 */
 	bad_bits = spi->mode & ~spi->master->mode_bits;
 	bad_bits = spi->mode & ~spi->master->mode_bits;
 	if (bad_bits) {
 	if (bad_bits) {
-		dev_dbg(&spi->dev, "setup: unsupported mode bits %x\n",
+		dev_err(&spi->dev, "setup: unsupported mode bits %x\n",
 			bad_bits);
 			bad_bits);
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}