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


Groups > linux.kernel > #1589845 > unrolled thread

[PATCH v3 0/2] Allow specifying properties with spi_register_board_info

Started byDmitry Torokhov <dmitry.torokhov@gmail.com>
First post2017-02-28 23:40 +0100
Last post2017-03-01 01:30 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 0/2] Allow specifying properties with spi_register_board_info Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-02-28 23:40 +0100
    [PATCH v3 2/2] spi: allow registering empty spi_board_info lists Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-03-01 01:30 +0100

#1589845 — [PATCH v3 0/2] Allow specifying properties with spi_register_board_info

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-02-28 23:40 +0100
Subject[PATCH v3 0/2] Allow specifying properties with spi_register_board_info
Message-ID<tfYB4-28l-11@gated-at.bofh.it>
I am trying to convert some input drivers to use only generic device
properties, and get rid of legacy platform data. For that I need to be
able to attach property lists to devices before they are registered, and
quite a few boards use spi_register_board_info() to create their devices.

v3: dropped former patch #2 (spi: allocate spi_board_info entries one by
    one), changed patch #1 to not copy empty property sets and also to
    remove added properties when spi_add_device() fails (when it is
    successful driver core will free properties upon device removal).

v2: change patch #2 from kmemdup to kmalloc + copy as they are different
    data types.

v1: initial posting


Dmitry Torokhov (2):
  spi: allow attaching device properties to SPI board info
  spi: allow registering empty spi_board_info lists

 drivers/spi/spi.c       | 34 +++++++++++++++++++++++++++++-----
 include/linux/spi/spi.h |  4 ++++
 2 files changed, 33 insertions(+), 5 deletions(-)

-- 
Dmitry

[toc] | [next] | [standalone]


#1589900 — [PATCH v3 2/2] spi: allow registering empty spi_board_info lists

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-03-01 01:30 +0100
Subject[PATCH v3 2/2] spi: allow registering empty spi_board_info lists
Message-ID<tg0jw-3kp-9@gated-at.bofh.it>
In reply to#1589845
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web