Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2217897rwd; Fri, 19 May 2023 02:37:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6qhYM8WZNfPUk9qRiRgAdNKpELCNCFaFmHJxeTrw4/zYzbSVXo9iUMl2OjcXmV1pZQbmsm X-Received: by 2002:a05:6a20:440e:b0:101:2ad0:134c with SMTP id ce14-20020a056a20440e00b001012ad0134cmr1819328pzb.45.1684489050450; Fri, 19 May 2023 02:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684489050; cv=none; d=google.com; s=arc-20160816; b=rxZMfi1iyFTTRJcEhCLBK7k4j16UHjKt+1WfhytPmzP49Qu4+k9fw98GB4qJOPXcOT tYZn2/r8Ws9Ql0KAaxDDRk1qY6ICZlR2nC6QFm6JUIPC9Nq7+Va+76r9ZgabjaGTzGsZ deZy/iUc/eH72znvpp9iluGhDxKNQFW6RF0ybrDwW2wh1L/gvnsU0C5s83sCCSsi4Nwp t7wS9d6ZVF30rK1C1GMH3I0D2Jj8b12olvQ4S/nmrUCHJsPe0RhlX13U5dUdnpxNIYoT dLzQR9cc+8qgq02aQ412p5I8N/q97SXoD8Yy/iCTI4LJG1EAA+dZAN6m3NoeMEKPd1i9 8aaA== 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=xtUBn64TCPUL2NIYTOf1vmSRVo+5qn88GJVMSzzNLZI=; b=qQF/mjEvMcARy08/FYsIRAtSBQD4n61xuQWI1BCVxCs4oP9T+TciQdyW8BvWC0T1tZ EucQXM1Pa+4SVKq1077YruAM9DCBTOTAbblY5D7sCNfJlmZHbhDn4Oa/pP7BJ+R+62m+ MQH07nAPmuwblVh9FNAkctpoL6dFeQKAxMMX30befhfEhGAOSCQdkHJvaQ9WwAGxq3Fe Pf0AqPafmgANNzzNWKHiiV7OGwYrm0mOcyr3UjfK+hDukrQdz3L9uE3G9eFw/J3dugJP 6Ca4Xov9pAuEnBjFDib8cFx4P+R4srFcIf++G6H9ZOvvnKth9dQCoDxVflMuHN38iz0i HnCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=q9TNsrmW; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=z0SPz73a; 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 g26-20020a63375a000000b0052856cec94asi3361481pgn.884.2023.05.19.02.37.17; Fri, 19 May 2023 02:37:30 -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=q9TNsrmW; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=z0SPz73a; 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 S231635AbjESJc2 (ORCPT + 99 others); Fri, 19 May 2023 05:32:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231514AbjESJbq (ORCPT ); Fri, 19 May 2023 05:31:46 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FB2310DC for ; Fri, 19 May 2023 02:31:42 -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 CF6211FE4B; Fri, 19 May 2023 09:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684488700; 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=xtUBn64TCPUL2NIYTOf1vmSRVo+5qn88GJVMSzzNLZI=; b=q9TNsrmWsdCHjDwkrpA+p5dUpGzXPbOBWcWsz/Rqg+vVOV0B1qVcn1KoggxC1duFFYKMDC Sze+35i89kP1Xi6R5ND6fk90BLdHaiRRYkvOHC6qvx616EgNIASPfYvi++DeDUmfgdKrJ3 bmtWP0Mv19mJdIhRFHTd/5ZE1ifonSA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684488700; 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=xtUBn64TCPUL2NIYTOf1vmSRVo+5qn88GJVMSzzNLZI=; b=z0SPz73a2RxbdU1dzaMht1HPJB3CSz13K6b72hJWOtsaSpqMaKGq7AhiGUypI4rbbkevt7 OWd3KTDNz/nSDtDA== 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 AE34F13A12; Fri, 19 May 2023 09:31:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UI9gKfxBZ2RXJAAAMHmgww (envelope-from ); Fri, 19 May 2023 09:31:40 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 18/36] ALSA: seq: Treat snd_seq_client object directly in client drivers Date: Fri, 19 May 2023 11:30:56 +0200 Message-Id: <20230519093114.28813-19-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230519093114.28813-1-tiwai@suse.de> References: <20230519093114.28813-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. 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