From patchwork Tue Feb 6 10:14:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10202689 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 71D6D60247 for ; Tue, 6 Feb 2018 10:15:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65E2528899 for ; Tue, 6 Feb 2018 10:15:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A8FC288B5; Tue, 6 Feb 2018 10:15:13 +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=ham 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 C57AC28899 for ; Tue, 6 Feb 2018 10:15:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752712AbeBFKPJ (ORCPT ); Tue, 6 Feb 2018 05:15:09 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:45482 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752496AbeBFKPD (ORCPT ); Tue, 6 Feb 2018 05:15:03 -0500 Received: from ayla.of.borg ([84.194.111.163]) by andre.telenet-ops.be with bizsmtp id 7NEv1x00D3XaVaC01NEvmT; Tue, 06 Feb 2018 11:15:01 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1ej0H8-0002iB-Q9; Tue, 06 Feb 2018 11:14:54 +0100 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1ej0H8-00042X-PG; Tue, 06 Feb 2018 11:14:54 +0100 From: Geert Uytterhoeven To: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Arnd Bergmann , Mark Brown , Richard Weinberger Cc: Felipe Balbi , Greg Kroah-Hartman , "James E . J . Bottomley" , "Martin K . Petersen" , iommu@lists.linux-foundation.org, linux-usb@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 3/6] usb: gadget: Add NO_DMA dummies for DMA mapping API Date: Tue, 6 Feb 2018 11:14:49 +0100 Message-Id: <1517912092-15470-4-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517912092-15470-1-git-send-email-geert@linux-m68k.org> References: <1517912092-15470-1-git-send-email-geert@linux-m68k.org> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add dummies for usb_gadget_{,un}map_request{,_by_dev}(), to allow compile-testing if NO_DMA=y. This prevents the following from showing up later: ERROR: "usb_gadget_unmap_request_by_dev" [drivers/usb/renesas_usbhs/renesas_usbhs.ko] undefined! ERROR: "usb_gadget_map_request_by_dev" [drivers/usb/renesas_usbhs/renesas_usbhs.ko] undefined! ERROR: "usb_gadget_map_request" [drivers/usb/mtu3/mtu3.ko] undefined! ERROR: "usb_gadget_unmap_request" [drivers/usb/mtu3/mtu3.ko] undefined! ERROR: "usb_gadget_map_request" [drivers/usb/gadget/udc/renesas_usb3.ko] undefined! ERROR: "usb_gadget_unmap_request" [drivers/usb/gadget/udc/renesas_usb3.ko] undefined! Signed-off-by: Geert Uytterhoeven Acked-by: Felipe Balbi --- include/linux/usb/gadget.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 66a5cff7ee142d6a..b68e7f9b210be122 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -805,6 +805,7 @@ int usb_otg_descriptor_init(struct usb_gadget *gadget, /* utility to simplify map/unmap of usb_requests to/from DMA */ +#ifdef CONFIG_HAS_DMA extern int usb_gadget_map_request_by_dev(struct device *dev, struct usb_request *req, int is_in); extern int usb_gadget_map_request(struct usb_gadget *gadget, @@ -814,6 +815,17 @@ extern void usb_gadget_unmap_request_by_dev(struct device *dev, struct usb_request *req, int is_in); extern void usb_gadget_unmap_request(struct usb_gadget *gadget, struct usb_request *req, int is_in); +#else /* !CONFIG_HAS_DMA */ +static inline int usb_gadget_map_request_by_dev(struct device *dev, + struct usb_request *req, int is_in) { return -ENOSYS; } +static inline int usb_gadget_map_request(struct usb_gadget *gadget, + struct usb_request *req, int is_in) { return -ENOSYS; } + +static inline void usb_gadget_unmap_request_by_dev(struct device *dev, + struct usb_request *req, int is_in) { } +static inline void usb_gadget_unmap_request(struct usb_gadget *gadget, + struct usb_request *req, int is_in) { } +#endif /* !CONFIG_HAS_DMA */ /*-------------------------------------------------------------------------*/