From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: [PATCH v3 2/2] spi: allow registering empty spi_board_info lists
Date: Tue, 28 Feb 2017 14:25:19 -0800 [thread overview]
Message-ID: <20170228222519.38217-3-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <20170228222519.38217-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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index bdecba9be2fa..ff37bc5b3947 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -687,7 +687,7 @@ int spi_register_board_info(struct spi_board_info const *info, unsigned n)
int i;
if (!n)
- return -EINVAL;
+ return 0;
bi = kzalloc(n * sizeof(*bi), GFP_KERNEL);
if (!bi)
--
2.11.0.483.g087da7b7c-goog
prev parent reply other threads:[~2017-02-28 22:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 22:25 [PATCH v3 0/2] Allow specifying properties with spi_register_board_info Dmitry Torokhov
2017-02-28 22:25 ` [PATCH v3 1/2] spi: allow attaching device properties to SPI board info Dmitry Torokhov
2017-02-28 22:25 ` Dmitry Torokhov [this message]
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=20170228222519.38217-3-dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=andy.shevchenko@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).