summaryrefslogtreecommitdiff
path: root/drivers/usb/core/ledtrig-usbport.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/ledtrig-usbport.c')
-rw-r--r--drivers/usb/core/ledtrig-usbport.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/core/ledtrig-usbport.c b/drivers/usb/core/ledtrig-usbport.c
index 9dbb429cd471..d775ffea20c3 100644
--- a/drivers/usb/core/ledtrig-usbport.c
+++ b/drivers/usb/core/ledtrig-usbport.c
@@ -137,11 +137,17 @@ static bool usbport_trig_port_observed(struct usbport_trig_data *usbport_data,
if (!led_np)
return false;
- /* Get node of port being added */
- port_np = usb_of_get_child_node(usb_dev->dev.of_node, port1);
+ /*
+ * Get node of port being added
+ *
+ * FIXME: This is really the device node of the connected device
+ */
+ port_np = usb_of_get_device_node(usb_dev, port1);
if (!port_np)
return false;
+ of_node_put(port_np);
+
/* Amount of trigger sources for this LED */
count = of_count_phandle_with_args(led_np, "trigger-sources",
"#trigger-source-cells");