Skip to content

Commit c4c3fc8

Browse files
outman119broonie
authored andcommitted
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>
1 parent f79ee9e commit c4c3fc8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/spi/spi-sn-f-ospi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ static int f_ospi_probe(struct platform_device *pdev)
625625
of_property_read_u32(dev->of_node, "num-cs", &num_cs);
626626
if (num_cs > OSPI_NUM_CS) {
627627
dev_err(dev, "num-cs too large: %d\n", num_cs);
628-
return -ENOMEM;
628+
return -EINVAL;
629629
}
630630
ctlr->num_chipselect = num_cs;
631631

0 commit comments

Comments
 (0)