The recently added of_usb_get_dr_mode_by_phy function causes a link error
when CONFIG_OF is disabled:

drivers/usb/common/built-in.o: In function `of_usb_get_dr_mode_by_phy':
include/linux/usb/of.h:23: multiple definition of `of_usb_get_dr_mode_by_phy'
drivers/usb/dwc3/built-in.o:/git/arm-soc/obj-tmp/../include/linux/usb/of.h:23: 
first defined here

This patch marks the dummy stub implementation of the function as
'static inline' so we don't get duplicate definitions when the
header gets included multiple times.

Signed-off-by: Arnd Bergmann <a...@arndb.de>
Fixes: 98bfb3946695 ("usb: of: add an api to get dr_mode by the phy node")
---
Found today on linux-next ARM randconfig builds

diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h
index 3805757dcdc2..cfba1d2079dd 100644
--- a/include/linux/usb/of.h
+++ b/include/linux/usb/of.h
@@ -17,7 +17,7 @@ bool of_usb_host_tpl_support(struct device_node *np);
 int of_usb_update_otg_caps(struct device_node *np,
                        struct usb_otg_caps *otg_caps);
 #else
-enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *phy_np)
+static inline enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node 
*phy_np)
 {
        return USB_DR_MODE_UNKNOWN;
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to