[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241012-spi_multi_cs_cleanup-v1-1-dc491113880d@gmail.com>
Date: Sat, 12 Oct 2024 11:53:35 +0200
From: Jonas Gorski <jonas.gorski@...il.com>
To: Mark Brown <broonie@...nel.org>,
Amit Kumar Mahapatra <amit.kumar-mahapatra@....com>
Cc: linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/6] spi: fix return code when spi device has too many
chipselects
Don't return a positive value when there are too many chipselects.
Fixes: 4d8ff6b0991d ("spi: Add multi-cs memories support in SPI core")
Signed-off-by: Jonas Gorski <jonas.gorski@...il.com>
---
drivers/spi/spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 7c5e76b154212585af1c3893005cb353a0eaeafc..ab38978e9c58517bb671d7bda017c8550cc82d58 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2452,7 +2452,7 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
if (rc > ctlr->num_chipselect) {
dev_err(&ctlr->dev, "%pOF has number of CS > ctlr->num_chipselect (%d)\n",
nc, rc);
- return rc;
+ return -EINVAL;
}
if ((of_property_read_bool(nc, "parallel-memories")) &&
(!(ctlr->flags & SPI_CONTROLLER_MULTI_CS))) {
--
2.43.0
Powered by blists - more mailing lists