[PATCH 3/3] spi: allow registering empty spi_board_info lists

From: Dmitry Torokhov
Date: Mon Feb 27 2017 - 23:16:44 EST


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@xxxxxxxxx>
---
drivers/spi/spi.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 029864410a5f..ca6cee37a445 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -683,9 +683,6 @@ int spi_register_board_info(struct spi_board_info const *info, unsigned n)
struct boardinfo *bi;
int i;

- if (!n)
- return -EINVAL;
-
for (i = 0; i < n; i++, info++) {
struct spi_master *master;

--
2.11.0.483.g087da7b7c-goog