Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: sn-f-ospi: fix incorrect return code for invalid num-cs

Returning -ENOMEM for an invalid num-cs value is semantically wrong. Use
-EINVAL instead.

Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Link: https://patch.msgid.link/20260411-ispi-v1-1-af384e81c4c8@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Felix Gu and committed by
Mark Brown
c4c3fc87 f79ee9e4

+1 -1
+1 -1
drivers/spi/spi-sn-f-ospi.c
··· 625 625 of_property_read_u32(dev->of_node, "num-cs", &num_cs); 626 626 if (num_cs > OSPI_NUM_CS) { 627 627 dev_err(dev, "num-cs too large: %d\n", num_cs); 628 - return -ENOMEM; 628 + return -EINVAL; 629 629 } 630 630 ctlr->num_chipselect = num_cs; 631 631