devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,
	 Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	 Steffen Trumtrar <kernel@pengutronix.de>,
	Pavel Machek <pavel@kernel.org>
Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-kernel@vger.kernel.org, kernel@pengutronix.de,
	 Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: [PATCH v2 3/4] leds: lp5860: save count of multi_leds
Date: Wed, 14 May 2025 12:36:30 +0200	[thread overview]
Message-ID: <20250514-v6-14-topic-ti-lp5860-v2-3-72ecc8fa4ad7@pengutronix.de> (raw)
In-Reply-To: <20250514-v6-14-topic-ti-lp5860-v2-0-72ecc8fa4ad7@pengutronix.de>

Save the count of multi_leds child nodes for later use.
As the leds are added to a flex array, the size needs to be saved at
runtime.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 drivers/leds/leds-lp5860-spi.c | 2 ++
 drivers/leds/leds-lp5860.h     | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/leds/leds-lp5860-spi.c b/drivers/leds/leds-lp5860-spi.c
index 751cc4184037c3c0e14d3493d0a43f0885786523..eee41ee8a8c226db6a68413998642624fabffe7c 100644
--- a/drivers/leds/leds-lp5860-spi.c
+++ b/drivers/leds/leds-lp5860-spi.c
@@ -50,6 +50,8 @@ static int lp5860_probe(struct spi_device *spi)
 	if (!lp5860)
 		return -ENOMEM;
 
+	lp5860->leds_size = multi_leds;
+
 	spi_set_drvdata(spi, lp5860);
 
 	spi->mode = SPI_MODE_0;
diff --git a/drivers/leds/leds-lp5860.h b/drivers/leds/leds-lp5860.h
index b4255fb48372814c7fda86ada96f504c2036f534..3b8342a832bc75afdf2318fd4ee1ee9ce105cbe3 100644
--- a/drivers/leds/leds-lp5860.h
+++ b/drivers/leds/leds-lp5860.h
@@ -305,6 +305,7 @@ struct lp5860_led {
 struct lp5860 {
 	struct device *dev;
 	struct regmap *regmap;
+	unsigned int leds_size;
 
 	DECLARE_FLEX_ARRAY(struct lp5860_led, leds);
 };

-- 
2.47.1


  parent reply	other threads:[~2025-05-14 10:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-14 10:36 [PATCH v2 0/4] LED: Add basic LP5860 LED matrix driver Steffen Trumtrar
2025-05-14 10:36 ` [PATCH v2 1/4] dt-bindings: leds: add lp5860 LED controller Steffen Trumtrar
2025-05-21  9:02   ` Krzysztof Kozlowski
2025-05-14 10:36 ` [PATCH v2 2/4] leds: add support for TI LP5860 LED driver chip Steffen Trumtrar
2025-05-23 10:28   ` Lee Jones
2025-07-14  8:26     ` Steffen Trumtrar
2025-07-18 13:18       ` Lee Jones
2025-05-14 10:36 ` Steffen Trumtrar [this message]
2025-06-12 13:52   ` [PATCH v2 3/4] leds: lp5860: save count of multi_leds Lee Jones
2025-05-14 10:36 ` [PATCH v2 4/4] leds: lp5860: detect and report fault state Steffen Trumtrar
2025-05-23 11:53 ` [PATCH v2 0/4] LED: Add basic LP5860 LED matrix driver Pavel Machek

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=20250514-v6-14-topic-ti-lp5860-v2-3-72ecc8fa4ad7@pengutronix.de \
    --to=s.trumtrar@pengutronix.de \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=robh@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).