From patchwork Mon Aug 13 21:48:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 144050 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3563252ljj; Mon, 13 Aug 2018 14:49:44 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxC9SSP+f/M8mxkiBCj+jD/q8AjFQ6EvLvjaFO9GSfTaX95bXGTz/+YQYd/WuYaOf9P+/zi X-Received: by 2002:a17:902:342:: with SMTP id 60-v6mr17899285pld.15.1534196984615; Mon, 13 Aug 2018 14:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534196984; cv=none; d=google.com; s=arc-20160816; b=0vuWO+RLphVSpdw94n4N9FvrBZMGd/8JG7G9bHNVvxlTN+fqJUqIBwzmTIOQ9Hh9dK rZtYfVRwMlS9DtwIw22iXJVavntpEbL4kGPcQ6+jDGu0mDuCCdQKTibQUEX9c7rQ7BZu XIFIloazKgb525eZEJ37KfLG2MJGbbWan/MANnjnX9EDOw8vZTypMUzzhOa208tcxyml py3Ktj00eKVIML6kaoRbOb6k313CVJqfW7zsoX08EAy7gswg1UfgbGxOB1bGacEnAmuQ ZS2rTgn5TpaqJwp/MF8obx15dURcWHDiiEJ0+fawGet5YzfjIcn05mFjBHTFgN5112WR BqXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=zk/V8w25lCTRyuGaB0BxSClQNS693n2Sq7ogf70Biss=; b=HsPSu/ydnj/ztkBxQx1Yae6mJvv2Fv5IHolfDgQ3v+rVhG6giH6J+KvdAoHlV7/u1E tUK5kGTjQwy4GqbUoHXQHiJLerKQi/G8R9mzxb1BYO+Eogygo06W3FAd82hnJjXytTea o7EDrbtgetqWoiJoOamdtDhBRPyHDc9ibMYw2LoAwmU6gbgjptSYvkfXuFxhh9p26GHC QbpMLm2yFxP9/Pyq9XJyUTX9qSuQYAxAynG56xzBO6cWzXokqB5Y4E4Qe+ZpHTma0Fqr NkEvWYZmfp3BKpBLanEi1CPQECNyCZfuHkIYApc9Ls0hrjeAfEi/CrJ/KU2nHUoY/a+g +//w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11-v6si16227840pgu.649.2018.08.13.14.49.44; Mon, 13 Aug 2018 14:49:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731850AbeHNAdj (ORCPT + 31 others); Mon, 13 Aug 2018 20:33:39 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:53316 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731690AbeHNAdj (ORCPT ); Mon, 13 Aug 2018 20:33:39 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0MCk22-1fh3Ey1FGE-009Mj7; Mon, 13 Aug 2018 23:49:26 +0200 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: Arnd Bergmann , Felipe Balbi , Geert Uytterhoeven , Yoshihiro Shimoda , Johan Hovold , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: hide usb_of_get_companion_dev for CONFIG_USB=n Date: Mon, 13 Aug 2018 23:48:46 +0200 Message-Id: <20180813214924.3567840-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:+C/AY/FsJPTL/edJ8vjd+U5L1h5y/lkPFRi66nBg2KO9OM5fO0w 5aOg8QyirCrauT6HZaXu93C/92Wtsx0OwxCt6b3eePzit7CWh1hRgpIJ9a0m00p+Ryb7pvb cc58QsoomZ0vlhFWBDpIq67aGjvf5XbAR8BbeR0F2tfusHZPrtG+XTzQ5oSFI03HlHDTpMZ or+54bV9OeLh77PufL0iA== X-UI-Out-Filterresults: notjunk:1; V01:K0:0JJ1W3OBiY0=:2XToV9Ex8w6bA5UFVZBgLd BFF6BMRVyhGsv51b9e1UQ3NGBNGCTBrjuk5SuZ20vBkAT4W3EZ/A4nrXpkn148yhu0y6gqgsM 7LwXnq9iIf1uoYEe8SUU90k8hhxlk9RDIxtAMZhTL/d2dAGJcuygwaSaN7cgrh4yNBsRU+yC1 rlwIiJv9IZvzWosNJrLj1AGX3C1AXDkLPVapZO6FnCzOkje6OF2x/lDoT/XwoxTYj9jFUDg/r timyN2wREiATYtj0s28rjwozDO19MwBu8YlYwNFMoUc/HBfMy/AEyqUiT42zjgOvaqsBXfi1O 99iKcSV3rzAlqMOaaGnyJ4yeuNxFVtWifldMb1/qlvd8YfTMPRZGEWwCesabLlP1592wPSsKa KxJMOZXf2Hnwn4PvvQcDdQFH13+cvnCTtlt9yCax1lfJDSGWH+gACRsrIn+a8GM2yNQ8EbFv7 hgJYwgZSE5FTTJ7OHCQC7poZaFlmqtYW/7ehbiDNIb+XI9ymQpG02vREZyEo7s3g/R4+QK10w 2ALCtowj+tk6IDXY+hAPVs+9Plfr+3IJRVhKVM1e+jSOiIgTU3X1BsiI9KAAoKmJUeeGJmUEO +xTvzysovC0s2eSVLRl6VT9LOGwV9Ue+xENrfnO2HweHGDY2zFDZwIwJJtEuTt2vsWEGQVuZz m87dnDazi/BTVnb/1/oxhuYWmq8oZ5CjxDOLoBe2SDTyZdExT8z5sOqAxN8J1hZZvftY= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The renesas UDC implementation now calls usb_of_get_companion_dev(), which is only defined when CONFIG_USB is enabled: drivers/usb/gadget/udc/renesas_usb3.o: In function `renesas_usb3_probe': renesas_usb3.c:(.text+0xa34): undefined reference to `usb_of_get_companion_dev' To avoid the build error, we need two changes: - usb_of_get_companion_dev must be stubbed out when CONFIG_USB is disabled, so it the udc driver can be built for a gadget-only mode kernel - With CONFIG_USB=m, we must not attempt to have USB_RENESAS_USB3 built-in, so we need a soft dependency on USB. Fixes: 39facfa01c9f ("usb: gadget: udc: renesas_usb3: Add register of usb role switch") Signed-off-by: Arnd Bergmann --- drivers/usb/gadget/udc/Kconfig | 1 + include/linux/usb/of.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) -- 2.18.0 diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig index 0a16cbd4e528..663a8bd67a7b 100644 --- a/drivers/usb/gadget/udc/Kconfig +++ b/drivers/usb/gadget/udc/Kconfig @@ -193,6 +193,7 @@ config USB_RENESAS_USB3 tristate 'Renesas USB3.0 Peripheral controller' depends on ARCH_RENESAS || COMPILE_TEST depends on EXTCON + depends on USB || !USB select USB_ROLE_SWITCH help Renesas USB3.0 Peripheral controller is a USB peripheral controller diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h index dba55ccb9b53..733339218466 100644 --- a/include/linux/usb/of.h +++ b/include/linux/usb/of.h @@ -23,7 +23,6 @@ struct device_node *usb_of_get_device_node(struct usb_device *hub, int port1); bool usb_of_has_combined_node(struct usb_device *udev); struct device_node *usb_of_get_interface_node(struct usb_device *udev, u8 config, u8 ifnum); -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) @@ -53,6 +52,11 @@ usb_of_get_interface_node(struct usb_device *udev, u8 config, u8 ifnum) { return NULL; } +#endif + +#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB) +struct device *usb_of_get_companion_dev(struct device *dev); +#else static inline struct device *usb_of_get_companion_dev(struct device *dev) { return NULL;