Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3976528rwd; Tue, 23 May 2023 00:58:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7bzASVUvpq/PIEyQlSKTsc8MQSrq3cOgjc6SAD1MSwwldH2EUpau0mvDkL56/fMCvFPREE X-Received: by 2002:a17:90a:cb14:b0:253:726c:d6e6 with SMTP id z20-20020a17090acb1400b00253726cd6e6mr12093210pjt.3.1684828701392; Tue, 23 May 2023 00:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684828701; cv=none; d=google.com; s=arc-20160816; b=HHVPO+joacdcHCeQo6Pgbw+CwCk2DOvTZD9l0JV0y314Ge7xYTC3zFjp1aTQ4i3b/l y4RlvxL6zTeTxAkgqxihxvEZCILROYc6eciV6eDzC3+/v3fPzobtJWOYG822kEf1g372 coaZiSy5lPZYC0rGQloHM37KmWfNE5BYhcQUYI4aRvGAt382OXVhWV1MNSdmYVZPONEP ZXtLipGwk5luqWz9Ywo8oNs1AAIXPXh4T5oV9IJ5Ji5coD4NKM5TxS5mvJvCKxHMepD0 jXnhKhZw4hmarp/zk9NpltKf3yGF5b0pxW65OsvLlwHmp6J5GO+yai1/PjKIq9leptlk J8mA== 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=l4DZ5woY6gmacraFwH4PrBR7nOGakjNJMIBScTlvDFE=; b=lFsd1FJ8AI+nd5O4/+/Qb61snqiSASzH7YBg43veToPmu1wm94Bj4NMvxWh3t5c1Je ZVBfYk6GU1EWt/cxUO9tQbIIgd3FjUFAJVbv3inDRyDcPHrP3MEPm3wjWe1ZrT3Gc9M3 nmY+kCBnmnZVCzdr3j1sst0J3JVOm1AAeweku86xn2qEThc7uDuE+d7cTd5fmDEfckI3 aYVjyNbh8bHS3hr9UEAsd9DNnSwYKcVVONVAKysZSkqTfEFau4mfryfgwX//Mvh+mR4d BGmFjqszgFkYNO62xjWVPs7lDOlO3UPYIbaZH1r4Ixw+GheJprhG/lJyId3bzT5iCeRe ws7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HkjeYC0Q; dkim=neutral (no key) header.i=@suse.de header.b=XpHHji8S; 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 g2-20020a17090a290200b0025378fb1538si2428531pjd.41.2023.05.23.00.58.08; Tue, 23 May 2023 00:58:21 -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=HkjeYC0Q; dkim=neutral (no key) header.i=@suse.de header.b=XpHHji8S; 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 S235767AbjEWH4w (ORCPT + 99 others); Tue, 23 May 2023 03:56:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235330AbjEWHzh (ORCPT ); Tue, 23 May 2023 03:55:37 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82A9BCD for ; Tue, 23 May 2023 00:55:13 -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-out2.suse.de (Postfix) with ESMTPS id 7CD8720410; Tue, 23 May 2023 07:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684828448; 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=l4DZ5woY6gmacraFwH4PrBR7nOGakjNJMIBScTlvDFE=; b=HkjeYC0QuYOlGB79i3zWQ/9nWZoV0V00HmPoZjX8OD3mqJf/3zUTw9Eb//H552FIYpcm9x R9FfayH9I+Xn4sSfIE6He1cX/yhBeKa/6S8syoOB8VSzThoY1S86tUrGg7Yfora7TmCj6O K08n5j33ogHA3gs0vajGR/5etm9bJEQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684828448; 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=l4DZ5woY6gmacraFwH4PrBR7nOGakjNJMIBScTlvDFE=; b=XpHHji8S3+L9y7x/IwkdgDVaipr1QtJ8kmLMfx6sxcg2inXZ1uZQA0V1yFFRsC+ChRksAm v6YIzmrwfWxOM0DQ== 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 4291D13A1A; Tue, 23 May 2023 07:54:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wN89DiBxbGT4KgAAMHmgww (envelope-from ); Tue, 23 May 2023 07:54:08 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2 19/37] ALSA: seq: Treat snd_seq_client object directly in client drivers Date: Tue, 23 May 2023 09:53:40 +0200 Message-Id: <20230523075358.9672-20-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230523075358.9672-1-tiwai@suse.de> References: <20230523075358.9672-1-tiwai@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Introduce the new helpers, snd_seq_kernel_client_get() and _put() for kernel client drivers to treat the snd_seq_client more directly. This allows us to reduce the exported symbols and APIs at each time we need to access some field in future. Reviewed-by: Jaroslav Kysela Signed-off-by: Takashi Iwai --- sound/core/seq/seq_clientmgr.c | 15 +++++++++++++++ sound/core/seq/seq_clientmgr.h | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index 2d707afa1ef1..98e8032a32e2 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c @@ -2390,6 +2390,21 @@ int snd_seq_kernel_client_write_poll(int clientid, struct file *file, poll_table } EXPORT_SYMBOL(snd_seq_kernel_client_write_poll); +/* get a sequencer client object; for internal use from a kernel client */ +struct snd_seq_client *snd_seq_kernel_client_get(int id) +{ + return snd_seq_client_use_ptr(id); +} +EXPORT_SYMBOL_GPL(snd_seq_kernel_client_get); + +/* put a sequencer client object; for internal use from a kernel client */ +void snd_seq_kernel_client_put(struct snd_seq_client *cptr) +{ + if (cptr) + snd_seq_client_unlock(cptr); +} +EXPORT_SYMBOL_GPL(snd_seq_kernel_client_put); + /*---------------------------------------------------------------------------*/ #ifdef CONFIG_SND_PROC_FS diff --git a/sound/core/seq/seq_clientmgr.h b/sound/core/seq/seq_clientmgr.h index 8cdd0ee53fb1..f05704e45ab4 100644 --- a/sound/core/seq/seq_clientmgr.h +++ b/sound/core/seq/seq_clientmgr.h @@ -88,4 +88,8 @@ void snd_seq_client_ioctl_unlock(int clientid); extern int seq_client_load[15]; +/* for internal use between kernel sequencer clients */ +struct snd_seq_client *snd_seq_kernel_client_get(int client); +void snd_seq_kernel_client_put(struct snd_seq_client *cptr); + #endif -- 2.35.3