From patchwork Sun Jul 9 19:31:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 9831985 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 9D53F60317 for ; Sun, 9 Jul 2017 19:31:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C014274A3 for ; Sun, 9 Jul 2017 19:31:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8078B27A98; Sun, 9 Jul 2017 19:31:23 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5005274A3 for ; Sun, 9 Jul 2017 19:31:22 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id BAB74266B98; Sun, 9 Jul 2017 21:31:21 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2B13F266C25; Sun, 9 Jul 2017 21:31:21 +0200 (CEST) Received: from andre.telenet-ops.be (andre.telenet-ops.be [195.130.132.53]) by alsa0.perex.cz (Postfix) with ESMTP id 444BF266B13 for ; Sun, 9 Jul 2017 21:31:05 +0200 (CEST) Received: from ayla.of.borg ([84.195.106.246]) by andre.telenet-ops.be with bizsmtp id ijX41v0095JzmfG01jX4hZ; Sun, 09 Jul 2017 21:31:05 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1dUHv6-0001mq-5y; Sun, 09 Jul 2017 21:31:04 +0200 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1dUHv6-00042W-3x; Sun, 09 Jul 2017 21:31:04 +0200 From: Geert Uytterhoeven To: Jaroslav Kysela , Takashi Iwai Date: Sun, 9 Jul 2017 21:31:02 +0200 Message-Id: <1499628662-15490-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 2.7.4 Cc: alsa-devel@alsa-project.org, Geert Uytterhoeven , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ALSA: pcm: Protect call to dma_mmap_coherent() by check for HAS_DMA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP If NO_DMA=y: sound/core/pcm_native.o: In function `snd_pcm_lib_default_mmap': pcm_native.c:(.text+0x144c): undefined reference to `bad_dma_ops' pcm_native.c:(.text+0x1474): undefined reference to `dma_common_mmap' Add a check for HAS_DMA to fix this. Signed-off-by: Geert Uytterhoeven --- sound/core/pcm_native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index b3d5bed750297ec2..e540a22aa3d8988a 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -3502,7 +3502,7 @@ int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, } #endif /* CONFIG_GENERIC_ALLOCATOR */ #ifndef CONFIG_X86 /* for avoiding warnings arch/x86/mm/pat.c */ - if (!substream->ops->page && + if (IS_ENABLED(CONFIG_HAS_DMA) && !substream->ops->page && substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV) return dma_mmap_coherent(substream->dma_buffer.dev.dev, area,