summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2017-02-28 14:25:19 -0800
committerMark Brown <broonie@kernel.org>2017-03-06 11:38:04 +0100
commitf974cf57b1b95839b224b01335c45347f746a365 (patch)
tree1d0ebdb64dfe826d626de17b438639d7f9aad3d2
parent826cf175ed705f70a49d04aca832c1cc9ff048d8 (diff)
downloadblackbird-op-linux-f974cf57b1b95839b224b01335c45347f746a365.tar.gz
blackbird-op-linux-f974cf57b1b95839b224b01335c45347f746a365.zip
spi: allow registering empty spi_board_info lists
Many boards form list of spi_board_info entries depending on config, and it is possible to end up with empty list. Do not report error in such cases. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 6cc86060d22f..f699ea530b88 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -690,7 +690,7 @@ int spi_register_board_info(struct spi_board_info const *info, unsigned n)
int i;
if (!n)
- return -EINVAL;
+ return 0;
bi = kcalloc(n, sizeof(*bi), GFP_KERNEL);
if (!bi)
OpenPOWER on IntegriCloud