From patchwork Tue Jul 5 10:00:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102047 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp222288qgy; Tue, 5 Jul 2016 02:58:28 -0700 (PDT) X-Received: by 10.98.0.83 with SMTP id 80mr30582850pfa.0.1467712708048; Tue, 05 Jul 2016 02:58:28 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y15si3586103pfb.59.2016.07.05.02.58.27; Tue, 05 Jul 2016 02:58:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-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-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754484AbcGEJ6L (ORCPT + 5 others); Tue, 5 Jul 2016 05:58:11 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:63480 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752664AbcGEJ6H (ORCPT ); Tue, 5 Jul 2016 05:58:07 -0400 Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0LkyOr-1buFlH0w6f-00aoqg; Tue, 05 Jul 2016 11:57:46 +0200 From: Arnd Bergmann To: kernel-build-reports@lists.linaro.org Cc: Mark Brown , Greg Kroah-Hartman , Magnus Damm , Simon Horman , linaro-kernel@lists.linaro.org, linux-next@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH, RESEND] staging: emxx_udc: allow modular build Date: Tue, 05 Jul 2016 12:00:49 +0200 Message-ID: <4551753.qTqdp3sOje@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-22-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20160705095242.GP6247@sirena.org.uk> References: <20160705095242.GP6247@sirena.org.uk> MIME-Version: 1.0 X-Provags-ID: V03:K0:dkg5wTF0qTDNPcPX4YfrSEZLeyJdYbhdiwzhRehZNTiKPWvGLPa 6n13rd5CYBkcsf0kjm4LqsPBJMG71Kg+apzFwgKtnNZmaSn19YQBJU6GxEKwyB+gKu9Cdhu Ffcmb7LTNMWx8+KIMTW/m4YmNhFutSDvjtq5fophhpq5P9enHbOiVu1K9WkrmEzG9Umrpw8 /z3ZeYsFz3IHO3+n+eRig== X-UI-Out-Filterresults: notjunk:1; V01:K0:DHBn5E0jXFU=:gayfDEpCX0m5L6O8VN1oQb /ETHSFqF8AiZzFV3TaPXh5lbul4O74j9HgSh3kf6K9keGHbLKm9ks1ElDNHPbtqW+mklU+EOP /4rml7pMWDpI6Y5dhmyleX4UMMx8x/d72bVBY46c1ZZF+1crgTkINpxtbzsQlP6q/YCO+RfCL YlzR/iy1FPkExW8wag0gmh52W66xo3iST9zdKuTb68JYWg/1Mii+WvZuuCPbG+K+uKduKC9/V 4OhKhQ79C4eTJUjSBljToVjziEudwJyJnXXiugDMEM0r3PJxV/23lk67GZe8jdZixM8PYItFZ fqU6eYv0nOKzgTlkJOv6mhmqRa66pkhSg8QuZNBa1DDjv2D1+IjgdnXZq1gAxNmue4O3tSCjt k/0EYVNmJjvKP1Pryw3XNbsN8VX/51tMA4FnH+LN9LzWjUuzaarX+Sl0vrj/eWsteyC/bARwy c3eVQRC+044/eTzZLPNjGQA/S4a4i5WDw73tbWO9FR/MYHblZ6k2I7Rv9vbukIyfLxZ37bH5W bdNm0tFDb5ZAq0GuG6PSM0x5G1vH5QIOlPy0OMDB15Rg2Q76ofAsLegyxZ+GIdE5ZXmKNbvSO B6QdIhKSBl2wyaV3e8kQNtDjPphgP+R4DiGRSXA/TxtjKeRH98rNY3azP92Dv30ejetxhitHR 4iVbEgUeLXLUXzB1ztEWVBr03k9Ijb3lGZYpik3Gp6Wvgphjvy6Bagjq0BzFxVd/6ZVPNEsVH VnbsYmZ9UTgQL4jg Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org A change to the usb gadget core allowed certain API functions to be part of a loadable module, which breaks having emxx_udc built-in: drivers/staging/built-in.o: In function `nbu2ss_drv_probe': (.text+0x2428): undefined reference to `usb_ep_set_maxpacket_limit' The original patch already fixed tons of other cases that have the added dependency but apparently missed this one that now appears in an ARM allmodconfig build. This patch makes the symbol "tristate", which lets the Kconfig dependency tracking handle it correctly. To make the module actually usable, I also revert 0af61e66ee16 ("drivers/staging: make emxx_udc.c explicitly non-modular"), which Paul Gortmaker added after noticing that the Kconfig symbol was 'bool'. Compared to the original version however, I leave out the '__exit' annotation on the remove callback, as Paul pointed out that this was incorrect. Signed-off-by: Arnd Bergmann Fixes: 5a8d651a2bde ("usb: gadget: move gadget API functions to udc-core") --- On Tuesday, July 5, 2016 11:52:42 AM CEST Mark Brown wrote: > On Tue, Jul 05, 2016 at 10:15:03AM +0100, Build bot for Mark Brown wrote: > > For the past little while both arm and arm64 allmodconfig builds have > been failing with: > > > drivers/built-in.o: In function `nbu2ss_drv_probe': > > binder.c:(.text+0x29438c): undefined reference to `usb_ep_set_maxpacket_limit' > > binder.c:(.text+0x294468): undefined reference to `usb_ep_set_maxpacket_limit' > > That function is a static inline in linux/usb/gadget.h which does seem > to be included (the driver builds fine) so I'm not entirely sure why > this is failing - I've not had time to investigate properly, I don't > know if the compiler is misfiring here. > This is the patch I sent for it when it first appeared: https://lkml.org/lkml/2016/6/23/528 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/emxx_udc/Kconfig b/drivers/staging/emxx_udc/Kconfig index cc3402020487..d7577096fb25 100644 --- a/drivers/staging/emxx_udc/Kconfig +++ b/drivers/staging/emxx_udc/Kconfig @@ -1,5 +1,5 @@ config USB_EMXX - bool "EMXX USB Function Device Controller" + tristate "EMXX USB Function Device Controller" depends on USB_GADGET && (ARCH_SHMOBILE || (ARM && COMPILE_TEST)) help The Emma Mobile series of SoCs from Renesas Electronics and diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index 3bd91758b2da..3b56b2826263 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -15,7 +15,7 @@ */ #include -#include +#include #include #include #include @@ -39,9 +39,11 @@ #include "emxx_udc.h" +#define DRIVER_DESC "EMXX UDC driver" #define DMA_ADDR_INVALID (~(dma_addr_t)0) static const char driver_name[] = "emxx_udc"; +static const char driver_desc[] = DRIVER_DESC; /*===========================================================================*/ /* Prototype */ @@ -3296,6 +3298,28 @@ static void nbu2ss_drv_shutdown(struct platform_device *pdev) } /*-------------------------------------------------------------------------*/ +static int nbu2ss_drv_remove(struct platform_device *pdev) +{ + struct nbu2ss_udc *udc; + struct nbu2ss_ep *ep; + int i; + + udc = &udc_controller; + + for (i = 0; i < NUM_ENDPOINTS; i++) { + ep = &udc->ep[i]; + if (ep->virt_buf) + dma_free_coherent(NULL, PAGE_SIZE, + (void *)ep->virt_buf, ep->phys_buf); + } + + /* Interrupt Handler - Release */ + free_irq(INT_VBUS, udc); + + return 0; +} + +/*-------------------------------------------------------------------------*/ static int nbu2ss_drv_suspend(struct platform_device *pdev, pm_message_t state) { struct nbu2ss_udc *udc; @@ -3347,12 +3371,16 @@ static int nbu2ss_drv_resume(struct platform_device *pdev) static struct platform_driver udc_driver = { .probe = nbu2ss_drv_probe, .shutdown = nbu2ss_drv_shutdown, + .remove = nbu2ss_drv_remove, .suspend = nbu2ss_drv_suspend, .resume = nbu2ss_drv_resume, .driver = { - .name = driver_name, - .suppress_bind_attrs = true, + .name = driver_name, }, }; -builtin_platform_driver(udc_driver); +module_platform_driver(udc_driver); + +MODULE_DESCRIPTION(DRIVER_DESC); +MODULE_AUTHOR("Renesas Electronics Corporation"); +MODULE_LICENSE("GPL");