From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 163C0CA9EB5 for ; Mon, 4 Nov 2019 10:50:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA0D921D7F for ; Mon, 4 Nov 2019 10:50:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728540AbfKDKuN (ORCPT ); Mon, 4 Nov 2019 05:50:13 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:5257 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726071AbfKDKuN (ORCPT ); Mon, 4 Nov 2019 05:50:13 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id DE46E2099A79968604F1; Mon, 4 Nov 2019 18:50:10 +0800 (CST) Received: from [127.0.0.1] (10.177.96.96) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Mon, 4 Nov 2019 18:50:07 +0800 Subject: Re: [PATCH -next] usb: gadget: Add dependency for USB_TEGRA_XUDC To: Thierry Reding CC: , , , , , , , , References: <20191104025945.172620-1-maowenan@huawei.com> <20191104100410.GB996639@ulmo> From: maowenan Message-ID: <51315499-99d0-eca3-a7df-b8dd84628bbd@huawei.com> Date: Mon, 4 Nov 2019 18:50:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <20191104100410.GB996639@ulmo> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.96.96] X-CFilter-Loop: Reflected Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On 2019/11/4 18:04, Thierry Reding wrote: > On Mon, Nov 04, 2019 at 10:59:45AM +0800, Mao Wenan wrote: >> If CONFIG_USB_TEGRA_XUDC=y and CONFIG_USB_ROLE_SWITCH=m, >> below erros can be seen: >> drivers/usb/gadget/udc/tegra-xudc.o: In function `tegra_xudc_remove': >> tegra-xudc.c:(.text+0x6b0): undefined reference to `usb_role_switch_unregister' >> drivers/usb/gadget/udc/tegra-xudc.o: In function `tegra_xudc_probe': >> tegra-xudc.c:(.text+0x1b88): undefined reference to `usb_role_switch_register' >> drivers/usb/gadget/udc/tegra-xudc.o: In function `tegra_xudc_usb_role_sw_work': >> tegra-xudc.c:(.text+0x5ecc): undefined reference to `usb_role_switch_get_role' >> >> This patch add dependency USB_ROLE_SWITCH for UDC driver. >> >> Fixes: 49db427232fe ("usb: gadget: Add UDC driver for tegra XUSB device mode controller") >> Signed-off-by: Mao Wenan >> --- >> drivers/usb/gadget/udc/Kconfig | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig >> index acaec3a..d103154 100644 >> --- a/drivers/usb/gadget/udc/Kconfig >> +++ b/drivers/usb/gadget/udc/Kconfig >> @@ -445,6 +445,7 @@ config USB_TEGRA_XUDC >> tristate "NVIDIA Tegra Superspeed USB 3.0 Device Controller" >> depends on ARCH_TEGRA || COMPILE_TEST >> depends on PHY_TEGRA_XUSB >> + depends on USB_ROLE_SWITCH > > It looks like most other drivers that use the USB role switch class do > "select" here. Now, that's suboptimal because USB_ROLE_SWITCH is a user- > visible symbol, which can lead to conflicts, so it should be avoided. I > think that in this case it might make sense to hide USB_ROLE_SWITCH and > then convert all "depends on USB_ROLE_SWITCH" occurrences to "select > USB_ROLE_SWITCH". The USB role switch class is, after all, not useful by > itself. It always needs a host and/or gadget driver to make use of it. > Thanks, I send v2 and change 'depends on' to 'select' for this patch. > Thierry >