linux/tools/spi
Tiezhu Yang 470a072e12
spi: spidev_test: Use perror() only if errno is not 0
It is better to use perror() only if errno is not 0, it should use printf()
when errno is 0, otherwise there exists redudant ": Success".

E.g. without this patch:

$ ./spidev_test -p 1234 --input test.bin
only one of -p and --input may be selected: Success
Aborted (core dumped)

With this patch:

$ ./spidev_test -p 1234 --input test.bin
only one of -p and --input may be selected
Aborted (core dumped)

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/1581567368-8055-3-git-send-email-yangtiezhu@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-13 13:17:39 +00:00
..
.gitignore spi: tools: move spidev_test metadata 2015-11-30 12:14:12 +00:00
Build spi: tools: move to tools buildsystem 2017-07-26 12:25:23 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
spidev_fdx.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spidev_test.c spi: spidev_test: Use perror() only if errno is not 0 2020-02-13 13:17:39 +00:00