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>
This commit is contained in:
Felix Gu 2026-04-11 19:49:38 +08:00 committed by Mark Brown
commit c4c3fc872d
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -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;