Thread (2 messages) 2 messages, 2 authors, 2016-01-18

[PATCH v3 1/1] USB: core: let USB device know device node

flat view

From: Peter Chen <hidden>
Date: 2016-01-18 07:13:09
Also in: linux-devicetree

On Fri, Jan 15, 2016 at 12:30:41PM -0500, Alan Stern wrote:
On Fri, 15 Jan 2016, Philipp Zabel wrote:
quoted
quoted
+- reg: the port number which this device is connecting to.
Should it be noted here that the port number range is 1-255?
Actually the range is 1 - 31 (defined by USB_MAXCHILDREN set in 
include/uapi/linux/usb/ch11.h).
quoted
quoted
@@ -502,11 +503,14 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
 	dev->connect_time = jiffies;
 	dev->active_duration = -jiffies;
 #endif
-	if (root_hub)	/* Root hub always ok [and always wired] */
+	if (root_hub) {	/* Root hub always ok [and always wired] */
 		dev->authorized = 1;
-	else {
+		dev->of_node = bus->controller->of_node;
Why can't the root_hub reuse dev->dev.of_node?
Indeed, there's no need to add an .of_node field to struct usb_device, 
since the embedded struct device already contains an .of_node field.
No, the usb_device needs the .of_node field.

The devices belong to platform bus contains device node.
The devices (usb device) belong to USB bus which are created
dynamically do not contain device node.

-- 

Best Regards,
Peter Chen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help