public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: sn-f-ospi: fix incorrect return code for invalid num-cs
@ 2026-04-11 11:49 Felix Gu
  2026-04-11 11:58 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Gu @ 2026-04-11 11:49 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, linux-kernel, Felix Gu

Returning -ENOMEM for an invalid num-cs value is semantically wrong. Use
-EINVAL instead.

Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/spi/spi-sn-f-ospi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-sn-f-ospi.c b/drivers/spi/spi-sn-f-ospi.c
index 3c61c799723b..b459d51cb3a8 100644
--- a/drivers/spi/spi-sn-f-ospi.c
+++ b/drivers/spi/spi-sn-f-ospi.c
@@ -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,
-- 
Felix Gu <ustc.gu@gmail.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: sn-f-ospi: fix incorrect return code for invalid num-cs
  2026-04-11 11:49 [PATCH] spi: sn-f-ospi: fix incorrect return code for invalid num-cs Felix Gu
@ 2026-04-11 11:58 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-04-11 11:58 UTC (permalink / raw)
  To: Felix Gu; +Cc: linux-spi, linux-kernel

On Sat, 11 Apr 2026 19:49:38 +0800, Felix Gu wrote:
> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-12 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-11 11:49 [PATCH] spi: sn-f-ospi: fix incorrect return code for invalid num-cs Felix Gu
2026-04-11 11:58 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox