From patchwork Sat Nov 21 08:16:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 11923253 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 57610C388F9 for ; Sat, 21 Nov 2020 08:18:02 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 002C32168B for ; Sat, 21 Nov 2020 08:17:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="eSXJWqGn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 002C32168B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=wanadoo.fr Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9F03916CC; Sat, 21 Nov 2020 09:17:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9F03916CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1605946677; bh=7oZgV1V8QvtNNs1hT5Sg2EoL+hYdVaDhCVp2FmBiFSQ=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=eSXJWqGnissX/JO2vpQ2mGNr/aNwWxFhWmdAfAyT3bR0DwXA3bLtlSJv6oksAGC0D TKkpaSJRyDfT4k+XWy6kD1aT89yG+NNnCCy/4RkEyCci84RVOgL3JYhV0iz9wLIwzT bvcdKOlt78h5H4h5HMNk5U7zRiNHsPE5lCRIv0X0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 30EDEF80166; Sat, 21 Nov 2020 09:17:07 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 51D65F80157; Sat, 21 Nov 2020 09:17:05 +0100 (CET) Received: from smtp.smtpout.orange.fr (smtp05.smtpout.orange.fr [80.12.242.127]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1D5B2F80166 for ; Sat, 21 Nov 2020 09:16:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1D5B2F80166 Received: from localhost.localdomain ([81.185.161.242]) by mwinf5d61 with ME id uwGk2300J5E5lq903wGkm7; Sat, 21 Nov 2020 09:16:46 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 21 Nov 2020 09:16:46 +0100 X-ME-IP: 81.185.161.242 From: Christophe JAILLET To: perex@perex.cz, tiwai@suse.com, dan.carpenter@oracle.com Subject: [PATCH] ALSA: emu10k1: Use dma_set_mask_and_coherent to simplify code Date: Sat, 21 Nov 2020 09:16:32 +0100 Message-Id: <20201121081632.1330159-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Cc: Christophe JAILLET , alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 'pci_set_dma_mask()' + 'pci_set_consistent_dma_mask()' can be replaced by an equivalent 'dma_set_mask_and_coherent()' which is much less verbose. With at it replace the 'card->dev' parameter passed to a 'dev_err()' call by an equivalent '&pci->dev' which is more consistent with the test just one line above. Signed-off-by: Christophe JAILLET --- sound/pci/emu10k1/emu10k1x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index def8161cde4c..f2b6fd434474 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c @@ -894,9 +894,9 @@ static int snd_emu10k1x_create(struct snd_card *card, if ((err = pci_enable_device(pci)) < 0) return err; - if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 || - pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) { - dev_err(card->dev, "error to set 28bit mask DMA\n"); + + if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(28)) < 0) { + dev_err(&pci->dev, "error to set 28bit mask DMA\n"); pci_disable_device(pci); return -ENXIO; }