Skip to contentSkip to conversation

spi: sn-f-ospi: fix incorrect return code for invalid num-cs

PATCH In review Felix Gu 2 participants 2 messages Apr 11 – Apr 12 SPI

lore
Share & tools
lore

Felix Gu

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/spi/spi-sn-f-ospi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-sn-f-ospi.c +1 -1
index 3c61c799723b..b459d51cb3a8 100644
@@ -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;
 

---
base-commit: 66672af7a095d89f082c5327f3b15bc2f93d558e
change-id: 20260411-ispi-8e459514cdfb

Best regards,

Signature · 1 line
Felix Gu <[email protected]>
maintainer
#1 lore raw
Quoted 1 line · Felix Gu

spi: sn-f-ospi: fix incorrect return code for invalid num-cs

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.1

Thanks!

[1/1] spi: sn-f-ospi: fix incorrect return code for invalid num-cs

      https://git.kernel.org/broonie/spi/c/c4c3fc872d2a

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark