From: Peter Chen Date: Wed, 15 Jun 2016 03:25:43 +0000 (+0800) Subject: usb: core: of.c: fix defined but not declare warning X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=0573f2c519e570d056989e57565e1ff1640dd794;p=deliverable%2Flinux.git 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. Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Cc: Alan Stern Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Ben Dooks Cc: linux-kernel@lists.codethink.co.uk Signed-off-by: Peter Chen Reported-by: Ben Dooks Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/Makefile b/drivers/usb/core/Makefile index 9780877010b4..da36b784a0ef 100644 --- a/drivers/usb/core/Makefile +++ b/drivers/usb/core/Makefile @@ -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 diff --git a/drivers/usb/core/of.c b/drivers/usb/core/of.c index 2289700c31d6..3de4f8873984 100644 --- a/drivers/usb/core/of.c +++ b/drivers/usb/core/of.c @@ -18,6 +18,7 @@ */ #include +#include /** * usb_of_get_child_node - Find the device node match port number