public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: use of_usb_get_dr_mode_by_phy() inline helper without USB
@ 2016-09-14 13:51 Arnd Bergmann
  2016-09-14 22:56 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-09-14 13:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Kishon Vijay Abraham I, Hans de Goede, Martin Blumenstingl,
	Jerome Brunet, Arnd Bergmann, Felipe Balbi, Peter Chen,
	Rob Herring, linux-usb, linux-kernel

We have had two new PHY drivers call of_usb_get_dr_mode_by_phy()
recently without having a dependency on CONFIG_USB_COMMON, resulting
in a link error:

ERROR: "of_usb_get_dr_mode_by_phy" [drivers/phy/phy-meson-usb2.ko] undefined!

I fixed up the first one (sun4i) by adding the dependency, but
if we get more of this, it's probably better to allow the PHY
drivers to build without the dependency.

This changes the guard around declarations so we only refer to
them when both CONFIG_OF and CONFIG_USB_COMMON are enabled,
which is the right thing for all of the first calls but not the
one that already has a correct check for USB_SUPPORT rather than
USB_COMMON.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 5ed935458519 ("phy: meson: add USB2 PHY support for Meson8b and GXBB")
---
 include/linux/usb/of.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h
index 5ff9032ee1b4..3ed539626840 100644
--- a/include/linux/usb/of.h
+++ b/include/linux/usb/of.h
@@ -11,7 +11,7 @@
 #include <linux/usb/otg.h>
 #include <linux/usb/phy.h>
 
-#if IS_ENABLED(CONFIG_OF)
+#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_COMMON)
 enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0);
 bool of_usb_host_tpl_support(struct device_node *np);
 int of_usb_update_otg_caps(struct device_node *np,
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-14 22:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-14 13:51 [PATCH] usb: use of_usb_get_dr_mode_by_phy() inline helper without USB Arnd Bergmann
2016-09-14 22:56 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox