From patchwork Thu Dec 21 12:06:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 10127561 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D91DF6019C for ; Thu, 21 Dec 2017 12:07:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C12C929BF3 for ; Thu, 21 Dec 2017 12:07:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B62BB29BFE; Thu, 21 Dec 2017 12:07:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6418429BF3 for ; Thu, 21 Dec 2017 12:07:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752586AbdLUMHg (ORCPT ); Thu, 21 Dec 2017 07:07:36 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:33730 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbdLUMHf (ORCPT ); Thu, 21 Dec 2017 07:07:35 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2B91880D; Thu, 21 Dec 2017 04:07:35 -0800 (PST) Received: from e107814-lin.cambridge.arm.com (e107814-lin.cambridge.arm.com [10.1.206.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5F71E3F24A; Thu, 21 Dec 2017 04:07:33 -0800 (PST) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Suzuki K Poulose , linux-renesas-soc@vger.kernel.org, Kishon Vijay Abraham I , Yoshihiro Shimoda , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Bin Liu , Felipe Balbi Subject: [PATCH] of: usb: Fix definition of of_usb_get_dr_mode_by_phy Date: Thu, 21 Dec 2017 12:06:42 +0000 Message-Id: <20171221120642.2899-1-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.13.6 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Declaration of of_usb_get_dr_mode_by_phy only depends on CONFIG_OF and not on CONFIG_USB_SUPPORT, which actually defines it. This can break the build like below, if USB_SUPPORT is not selected : drivers/phy/renesas/phy-rcar-gen3-usb2.o: In function `rcar_gen3_phy_usb2_probe': drivers/phy/renesas/phy-rcar-gen3-usb2.c:444: undefined reference to `of_usb_get_dr_mode_by_phy' drivers/phy/renesas/phy-rcar-gen3-usb2.c:444:(.text+0x2d4): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `of_usb_get_dr_mode_by_phy' drivers/phy/renesas/phy-rcar-gen3-usb2.c:444: undefined reference to `of_usb_get_dr_mode_by_phy' drivers/phy/renesas/phy-rcar-gen3-usb2.c:444:(.text+0x3bc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `of_usb_get_dr_mode_by_phy' make: *** [Makefile:993: vmlinux] Error 1 Fixes: commit 98bfb39466954c69d2 ("usb: of: add an api to get dr_mode by the phy node") Cc: linux-renesas-soc@vger.kernel.org Cc: Kishon Vijay Abraham I Cc: Yoshihiro Shimoda Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: Bin Liu Cc: Felipe Balbi Signed-off-by: Suzuki K Poulose --- include/linux/usb/of.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h index 6cbe7a5c2b57..181245e5fe36 100644 --- a/include/linux/usb/of.h +++ b/include/linux/usb/of.h @@ -13,7 +13,6 @@ #include #if IS_ENABLED(CONFIG_OF) -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, struct usb_otg_caps *otg_caps); @@ -21,11 +20,6 @@ struct device_node *usb_of_get_child_node(struct device_node *parent, int portnum); struct device *usb_of_get_companion_dev(struct device *dev); #else -static inline enum usb_dr_mode -of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0) -{ - return USB_DR_MODE_UNKNOWN; -} static inline bool of_usb_host_tpl_support(struct device_node *np) { return false; @@ -48,7 +42,13 @@ static inline struct device *usb_of_get_companion_dev(struct device *dev) #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_SUPPORT) enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np); +enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0); #else +static inline enum usb_dr_mode +of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0) +{ + return USB_DR_MODE_UNKNOWN; +} static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np) { return USBPHY_INTERFACE_MODE_UNKNOWN;