From: Felix Gu <ustc.gu@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Felix Gu <ustc.gu@gmail.com>
Subject: [PATCH] spi: sn-f-ospi: fix incorrect return code for invalid num-cs
Date: Sat, 11 Apr 2026 19:49:38 +0800 [thread overview]
Message-ID: <20260411-ispi-v1-1-af384e81c4c8@gmail.com> (raw)
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>
reply other threads:[~2026-04-11 11:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260411-ispi-v1-1-af384e81c4c8@gmail.com \
--to=ustc.gu@gmail.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox