From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 3/3] spi: allow registering empty spi_board_info lists
Date: Mon, 27 Feb 2017 20:18:57 -0800 [thread overview]
Message-ID: <20170228041857.13292-4-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <20170228041857.13292-1-dmitry.torokhov@gmail.com>
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
next prev parent reply other threads:[~2017-02-28 4:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 4:18 [PATCH v2 0/3] Allow specifying properties with spi_register_board_info Dmitry Torokhov
2017-02-28 4:18 ` [PATCH v2 1/3] spi: allow attaching device properties to SPI board info Dmitry Torokhov
2017-02-28 4:18 ` [PATCH v2 2/3] spi: allocate spi_board_info entries one by one Dmitry Torokhov
[not found] ` <20170228041857.13292-3-dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-28 9:16 ` Mark Brown
[not found] ` <20170228091650.eiypppxblfhh33pb-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-02-28 18:24 ` Dmitry Torokhov
2017-02-28 18:54 ` Mark Brown
[not found] ` <20170228185455.mdmvuc232chlveve-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-02-28 20:15 ` Geert Uytterhoeven
2017-02-28 22:12 ` Dmitry Torokhov
2017-02-28 20:52 ` Lars-Peter Clausen
2017-02-28 4:18 ` Dmitry Torokhov [this message]
[not found] ` <20170228041857.13292-4-dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-28 14:01 ` [PATCH v2 3/3] spi: allow registering empty spi_board_info lists Andy Shevchenko
2017-02-28 18:26 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170228041857.13292-4-dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).