Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1589164

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

From Dmitry Torokhov <dmitry.torokhov@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v2 3/3] spi: allow registering empty spi_board_info lists
Date 2017-02-28 05:30 +0100
Message-ID <tfHAd-7Cn-1@gated-at.bofh.it> (permalink)
References <tfHAd-7Cn-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 1b66e0497327..dbc4f00dc2fc 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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v2 3/3] spi: allow registering empty spi_board_info lists Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-02-28 05:30 +0100
  Re: [PATCH v2 3/3] spi: allow registering empty spi_board_info lists Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-02-28 15:10 +0100
    Re: [PATCH v2 3/3] spi: allow registering empty spi_board_info lists Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-02-28 19:30 +0100

csiph-web