Skip to content

Commit eb288a1

Browse files
Linus Walleijglikely
authored andcommitted
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 <[email protected]> [[email protected]: removed dev_dbg->dev_err hunk] Signed-off-by: Grant Likely <[email protected]>
1 parent 73e1ac1 commit eb288a1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/spi/spi.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,16 @@ int spi_add_device(struct spi_device *spi)
300300
*/
301301
status = spi_setup(spi);
302302
if (status < 0) {
303-
dev_err(dev, "can't %s %s, status %d\n",
304-
"setup", dev_name(&spi->dev), status);
303+
dev_err(dev, "can't setup %s, status %d\n",
304+
dev_name(&spi->dev), status);
305305
goto done;
306306
}
307307

308308
/* Device may be bound to an active driver when this returns */
309309
status = device_add(&spi->dev);
310310
if (status < 0)
311-
dev_err(dev, "can't %s %s, status %d\n",
312-
"add", dev_name(&spi->dev), status);
311+
dev_err(dev, "can't add %s, status %d\n",
312+
dev_name(&spi->dev), status);
313313
else
314314
dev_dbg(dev, "registered child %s\n", dev_name(&spi->dev));
315315

@@ -658,7 +658,7 @@ int spi_setup(struct spi_device *spi)
658658
*/
659659
bad_bits = spi->mode & ~spi->master->mode_bits;
660660
if (bad_bits) {
661-
dev_dbg(&spi->dev, "setup: unsupported mode bits %x\n",
661+
dev_err(&spi->dev, "setup: unsupported mode bits %x\n",
662662
bad_bits);
663663
return -EINVAL;
664664
}

0 commit comments

Comments
 (0)