[PATCH 2/4] usb: typec: use typec cap fwnode's of_node for typec port

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Asssign typec cap fwnode's of_node to typec port, then we can use
typec port device to get properties from its OF.

Signed-off-by: Li Jun <jun.li@xxxxxxx>
---
 drivers/usb/typec/class.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index b9429c9f65f6..a29bf2c32233 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -8,6 +8,7 @@
 
 #include <linux/module.h>
 #include <linux/mutex.h>
+#include <linux/of.h>
 #include <linux/property.h>
 #include <linux/slab.h>
 #include <linux/usb/pd_vdo.h>
@@ -2049,6 +2050,7 @@ struct typec_port *typec_register_port(struct device *parent,
 	port->dev.class = &typec_class;
 	port->dev.parent = parent;
 	port->dev.fwnode = cap->fwnode;
+	port->dev.of_node = to_of_node(cap->fwnode);
 	port->dev.type = &typec_port_dev_type;
 	dev_set_name(&port->dev, "port%d", id);
 	dev_set_drvdata(&port->dev, cap->driver_data);
-- 
2.25.1




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux