Thread (29 messages) 29 messages, 4 authors, 2015-07-17

[PATCH v2 07/12] backlight: register dependency parser for firmware nodes

From: Tomeu Vizoso <hidden>
Date: 2015-07-01 09:44:37
Also in: alsa-devel, dri-devel, linux-acpi, linux-devicetree, linux-gpio, linux-pwm, lkml
Subsystem: backlight class/subsystem, framebuffer layer, the rest · Maintainers: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Linus Torvalds

So others can find out what depends on backlight devices, as specified
in bindings/video/backlight/backlight.txt.

Signed-off-by: Tomeu Vizoso <redacted>
---

Changes in v2: None

 drivers/video/backlight/backlight.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index bddc8b1..ab8f5e7 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -566,8 +566,22 @@ struct backlight_device *of_find_backlight_by_node(struct device_node *node)
 EXPORT_SYMBOL(of_find_backlight_by_node);
 #endif
 
+static void backlight_get_dependencies(struct fwnode_handle *fwnode,
+					  struct list_head *deps)
+{
+	struct device_node *np;
+
+	np = of_parse_phandle(to_of_node(fwnode), "backlight", 0);
+	if (!np)
+		return;
+
+	fwnode_add_dependency(&np->fwnode, deps);
+}
+
 static void __exit backlight_class_exit(void)
 {
+	fwnode_remove_dependency_parser(backlight_get_dependencies);
+
 	class_destroy(backlight_class);
 }
 
@@ -586,6 +600,8 @@ static int __init backlight_class_init(void)
 	mutex_init(&backlight_dev_list_mutex);
 	BLOCKING_INIT_NOTIFIER_HEAD(&backlight_notifier);
 
+	fwnode_add_dependency_parser(backlight_get_dependencies);
+
 	return 0;
 }
 
-- 
2.4.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help