Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2578390rdg; Mon, 14 Aug 2023 07:05:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHLJumUFeVrb8AtOdKhVG3OUbCb7iShmYI/QFrs3Ca2t+5SQx4p15xTVnKsFMnDjLgaHDui X-Received: by 2002:a17:906:18:b0:99b:48b9:8e45 with SMTP id 24-20020a170906001800b0099b48b98e45mr7629429eja.76.1692021909856; Mon, 14 Aug 2023 07:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692021909; cv=none; d=google.com; s=arc-20160816; b=W9iewJZsdW3Bfg/ERJwDx3ZUmkwbMrW72AwoDtsFnCw1wj/O6TzZjjCrFj48Tzoob9 qYbM/+ywCA+YsYrGW8TzV9KHhvvQXry1fLdtKW4DLJ/PY/lbPEOMN1Dws+YhSUfmZ2J3 pp3Hnxe3aAWwUboDJ1T5fX7+6wBzX4qeRiWP/4FQIVMy/w/umhYXBSzQj64G+vBGGa65 hHBVlOfbKWVkcX1PP7xvhSFeuOapDD3yEjjvKPJU7hvW4gNk7e/+L/6MfeGBcq09s/fR 5zxGFeAhrRcPA0QM73k9SMYMKz9DPPpK1+iFEeUeLXtM7CTXfaSDgzbRz6gkA3vX7wbO g5SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=jjxBtA0K776P/pHFSLKAptmDdu6ejterm7BFJcjarEE=; fh=DP61/jJCya+1W1X7P2vK6pKSD4lkczCotBkmA6jh/us=; b=F3ArqEJxno9MAWGy5GcnhbI4feD+l8E3Mee1V+yq/tqOxwL8Ia68+7cc6fQjhidSJq sbQLGkc+eipe7FKxCM0UvtXxK49mjxZg29UWMSLw1va7PYBmnQK2UXya3zl6FnueEF38 ZI7sD5weAEDHsR2Lx5RYwsJrr7Ql8n/Kzgsony2zbsuCpuvT2gSG+4ZXQeaN4/PE0lz2 9fT2QbgbXePKdOxBYKKyRecf9SlpOSFviyxBaFT1xkZ9GBn75EuIQsUjN7m9laI2DJrs tS0lB165le6eVtyonx/1TYL2agt0gv41o+TXim95Bcjqvvo31PYDQZ+MTAvtDb4A7Lal JHDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MqkYUKC8; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ss6-20020a170907038600b009942c859e77si7926779ejb.193.2023.08.14.07.04.42; Mon, 14 Aug 2023 07:05:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MqkYUKC8; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233986AbjHNL5O (ORCPT + 99 others); Mon, 14 Aug 2023 07:57:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232714AbjHNL4g (ORCPT ); Mon, 14 Aug 2023 07:56:36 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51B9619BE for ; Mon, 14 Aug 2023 04:56:19 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 99A1E2199F; Mon, 14 Aug 2023 11:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1692014149; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jjxBtA0K776P/pHFSLKAptmDdu6ejterm7BFJcjarEE=; b=MqkYUKC84WDh0gijsgQg5GT4ops+uhrtNgO+PUaxJh9gTyqfGkVbk6dozpItWX5TRqwaJv VbmN5TLs4zrL4yVyWUQaObv3zwmNgudpAEVkqptaFex4Y7PooidF73qC7B5q/9roflRL1c j3WZbnoAaLRTQsJWHPc4XEeedRmzRJI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1692014149; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jjxBtA0K776P/pHFSLKAptmDdu6ejterm7BFJcjarEE=; b=stzyMsXS3ZvNbIFzAMJllCGovy9cDi/l5ZyOEvHECSH4fBzWMGMqM9jufjE4jJ4/22eZ9r a9Dj6xuIobDxRPCA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7AE86138EE; Mon, 14 Aug 2023 11:55:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IIjvHEUW2mRnMAAAMHmgww (envelope-from ); Mon, 14 Aug 2023 11:55:49 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org, Takashi Iwai Subject: [PATCH 11/25] ALSA: rme96: Convert to generic PCM copy ops Date: Mon, 14 Aug 2023 13:55:09 +0200 Message-Id: <20230814115523.15279-12-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230814115523.15279-1-tiwai@suse.de> References: <20230814115523.15279-1-tiwai@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch converts the rme96 driver code to use the new unified PCM copy callback. It's a straightforward conversion from *_user() to *_iter() variants. Signed-off-by: Takashi Iwai --- sound/pci/rme96.c | 42 ++++++++---------------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c index bccb7e0d3d11..6b5ffb18197b 100644 --- a/sound/pci/rme96.c +++ b/sound/pci/rme96.c @@ -320,48 +320,26 @@ snd_rme96_playback_silence(struct snd_pcm_substream *substream, static int snd_rme96_playback_copy(struct snd_pcm_substream *substream, int channel, unsigned long pos, - void __user *src, unsigned long count) + struct iov_iter *src, unsigned long count) { struct rme96 *rme96 = snd_pcm_substream_chip(substream); - return copy_from_user_toio(rme96->iobase + RME96_IO_PLAY_BUFFER + pos, + return copy_from_iter_toio(rme96->iobase + RME96_IO_PLAY_BUFFER + pos, src, count); } -static int -snd_rme96_playback_copy_kernel(struct snd_pcm_substream *substream, - int channel, unsigned long pos, - void *src, unsigned long count) -{ - struct rme96 *rme96 = snd_pcm_substream_chip(substream); - - memcpy_toio(rme96->iobase + RME96_IO_PLAY_BUFFER + pos, src, count); - return 0; -} - static int snd_rme96_capture_copy(struct snd_pcm_substream *substream, int channel, unsigned long pos, - void __user *dst, unsigned long count) + struct iov_iter *dst, unsigned long count) { struct rme96 *rme96 = snd_pcm_substream_chip(substream); - return copy_to_user_fromio(dst, + return copy_to_iter_fromio(dst, rme96->iobase + RME96_IO_REC_BUFFER + pos, count); } -static int -snd_rme96_capture_copy_kernel(struct snd_pcm_substream *substream, - int channel, unsigned long pos, - void *dst, unsigned long count) -{ - struct rme96 *rme96 = snd_pcm_substream_chip(substream); - - memcpy_fromio(dst, rme96->iobase + RME96_IO_REC_BUFFER + pos, count); - return 0; -} - /* * Digital output capabilities (S/PDIF) */ @@ -1518,8 +1496,7 @@ static const struct snd_pcm_ops snd_rme96_playback_spdif_ops = { .prepare = snd_rme96_playback_prepare, .trigger = snd_rme96_playback_trigger, .pointer = snd_rme96_playback_pointer, - .copy_user = snd_rme96_playback_copy, - .copy_kernel = snd_rme96_playback_copy_kernel, + .copy = snd_rme96_playback_copy, .fill_silence = snd_rme96_playback_silence, .mmap = snd_pcm_lib_mmap_iomem, }; @@ -1531,8 +1508,7 @@ static const struct snd_pcm_ops snd_rme96_capture_spdif_ops = { .prepare = snd_rme96_capture_prepare, .trigger = snd_rme96_capture_trigger, .pointer = snd_rme96_capture_pointer, - .copy_user = snd_rme96_capture_copy, - .copy_kernel = snd_rme96_capture_copy_kernel, + .copy = snd_rme96_capture_copy, .mmap = snd_pcm_lib_mmap_iomem, }; @@ -1543,8 +1519,7 @@ static const struct snd_pcm_ops snd_rme96_playback_adat_ops = { .prepare = snd_rme96_playback_prepare, .trigger = snd_rme96_playback_trigger, .pointer = snd_rme96_playback_pointer, - .copy_user = snd_rme96_playback_copy, - .copy_kernel = snd_rme96_playback_copy_kernel, + .copy = snd_rme96_playback_copy, .fill_silence = snd_rme96_playback_silence, .mmap = snd_pcm_lib_mmap_iomem, }; @@ -1556,8 +1531,7 @@ static const struct snd_pcm_ops snd_rme96_capture_adat_ops = { .prepare = snd_rme96_capture_prepare, .trigger = snd_rme96_capture_trigger, .pointer = snd_rme96_capture_pointer, - .copy_user = snd_rme96_capture_copy, - .copy_kernel = snd_rme96_capture_copy_kernel, + .copy = snd_rme96_capture_copy, .mmap = snd_pcm_lib_mmap_iomem, }; -- 2.35.3