Skip to contentSkip to conversation

usb: core: of.c: fix defined but not declare warning

PATCH In review Peter Chen 2 participants 2 messages Jun 15, 2016 – Jul 7, 2016 USB

lore
Share & tools
lore

Peter Chen

author
#0 lore raw

PATCH 1/1 usb: core: of.c: fix defined but not declare warning

The helper usb_of_get_child_node is defined at of.c, but missing its declare as a global function. Fix it by adding related header file as well as compile it on conditional of CONFIG_OF.

---
 drivers/usb/core/Makefile | 3 ++-
 drivers/usb/core/of.c     | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/usb/core/Makefile +2 -1
index 9780877..da36b78 100644
@@ -5,8 +5,9 @@
 usbcore-y := usb.o hub.o hcd.o urb.o message.o driver.o
 usbcore-y += config.o file.o buffer.o sysfs.o endpoint.o
 usbcore-y += devio.o notify.o generic.o quirks.o devices.o
-usbcore-y += port.o of.o
+usbcore-y += port.o
 
+usbcore-$(CONFIG_OF)		+= of.o
 usbcore-$(CONFIG_PCI)		+= hcd-pci.o
 usbcore-$(CONFIG_ACPI)		+= usb-acpi.o
 
drivers/usb/core/of.c +1 -0
index 2289700..3de4f88 100644
@@ -18,6 +18,7 @@
  */
 
 #include <linux/of.h>
+#include <linux/usb/of.h>
 
 /**
  * usb_of_get_child_node - Find the device node match port number
Signature · 1 line
1.9.1
#1 lore raw
Quoted 39 lines · Peter Chen

The helper usb_of_get_child_node is defined at of.c, but missing its declare as a global function. Fix it by adding related header file as well as compile it on conditional of CONFIG_OF.

---
 drivers/usb/core/Makefile | 3 ++-
 drivers/usb/core/of.c     | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/usb/core/Makefile +2 -1
index 9780877..da36b78 100644
@@ -5,8 +5,9 @@
 usbcore-y := usb.o hub.o hcd.o urb.o message.o driver.o
 usbcore-y += config.o file.o buffer.o sysfs.o endpoint.o
 usbcore-y += devio.o notify.o generic.o quirks.o devices.o
-usbcore-y += port.o of.o
+usbcore-y += port.o
 
+usbcore-$(CONFIG_OF)		+= of.o
 usbcore-$(CONFIG_PCI)		+= hcd-pci.o
 usbcore-$(CONFIG_ACPI)		+= usb-acpi.o
 
drivers/usb/core/of.c +0 -0
index 2289700..3de4f88 100644

drivers/usb/core/of.c line 22

Quoted 5 lines
drivers/usb/core/of.c +1 -0
@@ -18,6 +18,7 @@
  */
 
 #include <linux/of.h>
+#include <linux/usb/of.h>
 

ping...

Signature · 2 lines
Best Regards,
Peter Chen