* [PATCH] spi: sn-f-ospi: fix incorrect return code for invalid num-cs
@ 2026-04-11 11:49 Felix Gu
0 siblings, 0 replies; only message in thread
From: Felix Gu @ 2026-04-11 11:49 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-spi, linux-kernel, Felix Gu
Returning -ENOMEM for an invalid num-cs value is semantically wrong. Use
-EINVAL instead.
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
drivers/spi/spi-sn-f-ospi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-sn-f-ospi.c b/drivers/spi/spi-sn-f-ospi.c
index 3c61c799723b..b459d51cb3a8 100644
--- a/drivers/spi/spi-sn-f-ospi.c
+++ b/drivers/spi/spi-sn-f-ospi.c
@@ -625,7 +625,7 @@ static int f_ospi_probe(struct platform_device *pdev)
of_property_read_u32(dev->of_node, "num-cs", &num_cs);
if (num_cs > OSPI_NUM_CS) {
dev_err(dev, "num-cs too large: %d\n", num_cs);
- return -ENOMEM;
+ return -EINVAL;
}
ctlr->num_chipselect = num_cs;
---
base-commit: 66672af7a095d89f082c5327f3b15bc2f93d558e
change-id: 20260411-ispi-8e459514cdfb
Best regards,
--
Felix Gu <ustc.gu@gmail.com>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-04-11 11:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-11 11:49 [PATCH] spi: sn-f-ospi: fix incorrect return code for invalid num-cs Felix Gu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox