From patchwork Fri Mar 16 13:25:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10287145 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 CEDA7601A0 for ; Fri, 16 Mar 2018 13:50:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C323428ED3 for ; Fri, 16 Mar 2018 13:50:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B74D928EEA; Fri, 16 Mar 2018 13:50:40 +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 4617628EDA for ; Fri, 16 Mar 2018 13:50:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752130AbeCPNuZ (ORCPT ); Fri, 16 Mar 2018 09:50:25 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:49282 "EHLO laurent.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753513AbeCPNtv (ORCPT ); Fri, 16 Mar 2018 09:49:51 -0400 Received: from ayla.of.borg ([84.194.111.163]) by laurent.telenet-ops.be with bizsmtp id Ndpl1x00Z3XaVaC01dpl1X; Fri, 16 Mar 2018 14:49:49 +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 1ewpex-0000J2-W6; Fri, 16 Mar 2018 14:44:39 +0100 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1ewpMh-0000PM-HO; Fri, 16 Mar 2018 14:25:47 +0100 From: Geert Uytterhoeven To: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Felipe Balbi , Greg Kroah-Hartman , "James E . J . Bottomley" , "Martin K . Petersen" , Andrew Morton Cc: iommu@lists.linux-foundation.org, linux-usb@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 3/5] usb: gadget: Add NO_DMA dummies for DMA mapping API Date: Fri, 16 Mar 2018 14:25:42 +0100 Message-Id: <1521206744-1504-4-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521206744-1504-1-git-send-email-geert@linux-m68k.org> References: <1521206744-1504-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 Reviewed-by: Mark Brown Acked-by: Robin Murphy Acked-by: Felipe Balbi Acked-by: Greg Kroah-Hartman --- v2: - Add Reviewed-by, Acked-by, - Drop RFC state. --- 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 */ /*-------------------------------------------------------------------------*/