Linux-LEDs Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] led: max77650: add of_match table
@ 2019-12-10 10:08 Bartosz Golaszewski
  2019-12-21 19:03 ` Pavel Machek
  0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Golaszewski @ 2019-12-10 10:08 UTC (permalink / raw)
  To: Jacek Anaszewski, Pavel Machek, Dan Murphy
  Cc: linux-kernel, linux-leds, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We need the of_match table if we want to use the compatible string in
the pmic's child node and get the led driver loaded automatically.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/leds/leds-max77650.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/leds/leds-max77650.c b/drivers/leds/leds-max77650.c
index 4c2d0b3c6dad..a0d4b725c917 100644
--- a/drivers/leds/leds-max77650.c
+++ b/drivers/leds/leds-max77650.c
@@ -135,9 +135,16 @@ static int max77650_led_probe(struct platform_device *pdev)
 	return rv;
 }
 
+static const struct of_device_id max77650_led_of_match[] = {
+	{ .compatible = "maxim,max77650-led" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, max77650_led_of_match);
+
 static struct platform_driver max77650_led_driver = {
 	.driver = {
 		.name = "max77650-led",
+		.of_match_table = max77650_led_of_match,
 	},
 	.probe = max77650_led_probe,
 };
-- 
2.23.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] led: max77650: add of_match table
  2019-12-10 10:08 [PATCH] led: max77650: add of_match table Bartosz Golaszewski
@ 2019-12-21 19:03 ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2019-12-21 19:03 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Jacek Anaszewski, Dan Murphy, linux-kernel, linux-leds,
	Bartosz Golaszewski

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

On Tue 2019-12-10 11:08:32, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> We need the of_match table if we want to use the compatible string in
> the pmic's child node and get the led driver loaded automatically.

Thanks, applied.
							Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 10:08 [PATCH] led: max77650: add of_match table Bartosz Golaszewski
2019-12-21 19:03 ` Pavel Machek

Linux-LEDs Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-leds/0 linux-leds/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-leds linux-leds/ https://lore.kernel.org/linux-leds \
		linux-leds@vger.kernel.org
	public-inbox-index linux-leds

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-leds


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git