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

Dmitry Torokhov
2017-02-28T04:16:40Z

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>
---
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++) {