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:
parent
f79ee9e4b2
commit
c4c3fc872d
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue