summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2017-03-01 01:25:19 +0300
committerMark Brown <broonie@kernel.org>2017-03-06 13:38:04 +0300
commitf974cf57b1b95839b224b01335c45347f746a365 (patch)
tree1d0ebdb64dfe826d626de17b438639d7f9aad3d2 /drivers/spi
parent826cf175ed705f70a49d04aca832c1cc9ff048d8 (diff)
downloadlinux-f974cf57b1b95839b224b01335c45347f746a365.tar.xz
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>
Diffstat (limited to 'drivers/spi')
-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)