Unverified Commit c4c3fc87 authored by Felix Gu's avatar Felix Gu Committed by Mark Brown
Browse files

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: default avatarFelix Gu <ustc.gu@gmail.com>
Link: https://patch.msgid.link/20260411-ispi-v1-1-af384e81c4c8@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f79ee9e4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;