mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user