spi: spidev_test: abort when -I is selected without -S

-I (--iter) for transferring multiple iterations of the selected input
currently only has an effect when transferring random data using -S
(--size). Error out if -I is used without -S to avoid confusion.

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-5-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Jonas Rebmann 2026-09-24 15:43:55 +02:00 committed by Mark Brown
parent bd511c42d2
commit 683d7fac9b
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -463,6 +463,9 @@ int main(int argc, char *argv[])
if (random_input && transfer_size < 0)
pabort("a size argument is mandatory for -S (--size)");
if (iterations && transfer_size < 0)
pabort("-I (--iter) is only implemented for -S (--size)");
fd = open(device, O_RDWR);
if (fd < 0)
pabort("can't open device");