From patchwork Mon Aug 5 00:35:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5BA3BC52D70 for ; Mon, 5 Aug 2024 00:43:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 071753C1D; Mon, 5 Aug 2024 02:42:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 071753C1D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818541; bh=N7WYGc4xp4YzmzjWHqh7NC9smpp+INH73rQ4aqDnD68=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=TuMKagdEYTSeC9qeQp9b/rKeAOg9DadrpSN03uXXK3UQZ9vxK1iy61HrjODzyH28k ashKK6LYneIxsjvevcpApTsaPOMbYu8WiP3TyfjNA4fu4g9/dvKu/DYW70xEXg46ph dthltchDJLz9/zHNOnN+VqRpIOowmhbwQM3NhVMY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7FD32F806D0; Mon, 5 Aug 2024 02:38:58 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DD68BF8075E; Mon, 5 Aug 2024 02:38:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1D703F802DB; Mon, 5 Aug 2024 02:35:21 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A061FF800B0 for ; Mon, 5 Aug 2024 02:35:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A061FF800B0 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=ZHos9fAi ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GS8M1gzOaiL8Jd0ySeHuL9dB6DzCizqtCPn6viPppBQU9t2uXIZWTZfrJgJSw1E6wgZsXixsS1V32uzA2qhUO2PMCh8si00Vm99Fo2+M0ygGLd2FMhNo/4oMvkzXlDRbpuIP++cYXZI2IkmqZr4MxLRdfPVZnsCvzvLgyTpobS+Gr19LPxXXPYid61RGOu0+6ctWS6cxzzDUoTghWNvnj32b9soGd/YsI4c8vWgWFVsGyyi/HGkXCRfXKpOvIss00a+785z1M+67+SfBr6LjWedBE+W1L+wWI8Y7b3OxWdgvLm7jCqEFsQOCUuG2URt+RqF6cxMuFyl3sVy76mSNxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TIeh9UFk5aLeWLWckP6h+PobhxPgKOygL3SUWnoHDcE=; b=u5Zskscy8pGwk7w+Oe21rHz7TQz1Hj2BGVbUHQ+/bsSAiKy3okVZdwcvWOXC5TjV/c2riRbp1RWRPuPWNV/7OF8JHE037HMhfttGRNjotsyPceQdloBePwHKbTPPH63+z8SAbW2SEfBZHqlJ8tThlChyR/mJ0VE/8zcFVs6g/q56tN9RpCnECnHEHuMIwhqYSijpcaMaI9Ie3n+bciyoFEsNpHl4R6cSwJ3RYMmhYbS9wInVPUsE67IVVEAztM/UfSeqEmzeIZkchhmUgp6Tz9aRfnXggArXgQBaTCLs7o8Dr/snhOoxWLcomH/y+XuXrf8ae55Zx5UPSHYFob7Kqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TIeh9UFk5aLeWLWckP6h+PobhxPgKOygL3SUWnoHDcE=; b=ZHos9fAi5UEVfVKLvkRcHghaSctP/IJ2TdpR9SArGhCYzhw3ZVpHMG4vHdAEGQU2AGq4KZhFahGU7ZwsVjCj587jWxng0APd2mLyKwokrqkluK70IpXu4TsjOmxQNgysE7kAgewjWHh+AdjzY8cZ14e/7zqfwJQ97aG0Evz/hM0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by OS3PR01MB7994.jpnprd01.prod.outlook.com (2603:1096:604:163::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Mon, 5 Aug 2024 00:35:13 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024 00:35:13 +0000 Message-ID: <87plqn24e7.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 010/113] ALSA: isa: use snd_pcm_is_playback/capture() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-staging@lists.linux.dev, Linux-ALSA In-Reply-To: <874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com> References: <874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 5 Aug 2024 00:35:12 +0000 X-ClientProxiedBy: TYCP286CA0271.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::16) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: d8a39f26-c2dc-47b0-d536-08dcb4e67830 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: N23fPjWVHSLQ5iShx9qT6HO2wmZ193LYBu/ZmBm+SAMkvkw8AnqKLgxBtwCyxaPlMP/hqnOIzZMs9wF5WOY/NPs26aEMIQ8Xxbw61DmyNdNFf8J4v9B0YuH6iJvonjWu2znfWlzmSvUbscgXf6oJ1YEGzUJAAovSsQefsKQHrscjnGlBDL42//aBQKXMJ8fGce9nAn0V4Z43CNTgIPVZpDq12bE4LLLIsd5IXPeMED/00+Mqq90a2vRmg3co+0dxBiXRACQFz36kV+vEAwQQ/7wA4G5tONy2w6AK8p1HO5dKmqe76tWymPpA4Wg4786+7ahUCdY9/FACklkKoKFruSyMkv4jm7ol5Ba5mp1vDQKryE2+er3FGLwIWnEpKL8hZA1CZ1LWctwOd957EdA92OFHXGshX0AGKZM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FV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ujp9C9LTOwMrdSHrfHVKOpyKK8pi7g2QLt9v/McWLgCavrd4m+EMs3LwcuyJvgSRhqZID4eEZ4MWQyiBRYdAYVEqbJ9GkQAQwGfMVQABHJEScRey7NhecmYtldqI2uTPDoxVjD4NLEBUfkmn9nJH3iR9fZgZTXYdlz+3MTo9qSpFZ07m8mxWUsVzGr3tDyUHaw1uPkyFBalcLbRr/vD85tIweHgnpUzM65vnf7wNEUj6gVNkfuvwS4GHkdbgxSqADhxyFaECsgCCf9rrYuvodYK4jWeO9VwkIypStG1GRpZe2lmu9M29M5/Tc6c9UzgUBX6K0ZJSUqaTnvugU64DQpdzCL2tV72vPPvvQIBOEuZ8PG9v61g5svYj0SbxSM2iaobIWB0d6xD2Ih96H/h6UlVaDG+/5eNSjVyDj64nKKYTUTxZ+CFSkwIKK9y3X8OLGrwxDPD4WEQEoxF+sgOj8Xy31X6qLkG4GNASqZwxTy7J1BxXXK+cYa1gRH4KxyRxxmv1Me737oTrM/Mn9/NeaaX+sdM0VZMwjbP+JfKSb7/HsRBgUds866XDSq5EQBvO8KJdS5rcXfePZIuKvBRaEgATGPkbVnQgkdU3oNKKoRlw+Qx8VP2c+P0EWrBWYuNnHnWqCNrzEV5f2ruyxEbUP37MUndUfxcibTP4zxLtx30/Qp7r2CjdKj0/Qot8XGCZ4OJRUiYkVtlYqR8KxkdTB3j4+QdHkxbubRLdpSyqZOGu3TrY82r6/KPRCclUggXNAlkCKRYqfz+YHW43Gxhb7NEckPFyaStLv6OERefkz55iI8Nub9xpW6N3rV3rJxxGzv9GFYJaSj/iapifBh5sy9x0uFWnDL6bApA6sw1jYJ1dHwU2M+jATVZRX5dw/f9QAm7PutsY/zYSWrzXaiLCfRtwBrw+RIaj5vZ3TnuCMylsF9gsIzDyMJh5Y/yz9yWwws30VcmGKQMnA1l1Gp97iwOKtS8vYa1Ijv9q2JXNkClNQYZcHBfG2dxrIDbl46ekLyCXLkZRKHFq/Frdr3RQgIvgrilIz7/chP6fTMgWUreWt74dTrSfJUmY10IVZuYW9nvWZMyWAH2J3kPFgUZdFjZ+DYFwjjlIHLqKEX6CO7n4rhYUGoP31Tc49zzeQ2u1ZOmxHiqEVnYkdtonGDBpDBB8yREdZnNE54KogesadQhJ08Q+V1zDWHt6WSMZ1C4DCO2lYJYwbyHuh3YOUtOiDbrNL37Z5lPRANPZPn7CQU4I5WJ8FjAt2/lMoxR9GJW9QQv5JUM5qYLe9q81uYIA/lDHODtmfaHFXKHYVjRu38ncWo5kwlwH85+ut/XtYAUONCjAoeHQKaaSTc/RLZnFox0rBJ6WL7m9wiy54LuWIPs5+IEw+LC6f70alqkbFsbuTdVBV+7v/FMOyeS2OZuSJgvJ0hZyOYyu/iwfvw4g5F+znqLytqZCJC5kNmpFXsrOUZOSvGsWB1BbUiXMFu9K1AFL1Z+tQKwz3Q9RDHoNE70anYy4wMcazg9Pf/J224X4BSoGHVS/kGmok3ZtbtIt5wUi0x1ypYG4+qWWMPBJr61DNbE3RbWr76udQEB3AMQJKjZ1Wq1GYm4JoiNayYUK1LWsCoKMSXKfDg3wr+L1wXY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8a39f26-c2dc-47b0-d536-08dcb4e67830 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 00:35:13.2577 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mlzbs2BYRChT15zTLZ+ivaPfDNn4bLnZtTEpyiUwHNKNw+XM0ttvzyG9HpjLZgM28Wlna/ooaMGfewSRX11vyzZ7hRcQUERJv7A/G76VPTYCay5Z3GYb3rUmYLIo0PTk X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 Message-ID-Hash: UENMHEH47D7QZLMTQGXVCUCNUUKAWB7F X-Message-ID-Hash: UENMHEH47D7QZLMTQGXVCUCNUUKAWB7F X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/isa/sb/sb16_main.c | 4 ++-- sound/isa/sb/sb8_main.c | 6 +++--- sound/isa/wss/wss_lib.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c index a9b87e159b2d1..7145dcb4417a5 100644 --- a/sound/isa/sb/sb16_main.c +++ b/sound/isa/sb/sb16_main.c @@ -216,7 +216,7 @@ static void snd_sb16_setup_rate(struct snd_sb *chip, unsigned long flags; spin_lock_irqsave(&chip->reg_lock, flags); - if (chip->mode & (channel == SNDRV_PCM_STREAM_PLAYBACK ? SB_MODE_PLAYBACK_16 : SB_MODE_CAPTURE_16)) + if (chip->mode & (snd_pcm_is_playback(channel) ? SB_MODE_PLAYBACK_16 : SB_MODE_CAPTURE_16)) snd_sb_ack_16bit(chip); else snd_sb_ack_8bit(chip); @@ -860,7 +860,7 @@ int snd_sb16dsp_pcm(struct snd_sb *chip, int device) const struct snd_pcm_ops *snd_sb16dsp_get_pcm_ops(int direction) { - return direction == SNDRV_PCM_STREAM_PLAYBACK ? + return snd_pcm_is_playback(direction) ? &snd_sb16_playback_ops : &snd_sb16_capture_ops; } diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c index 2ed176a5a5743..dbb08e9e0f367 100644 --- a/sound/isa/sb/sb8_main.c +++ b/sound/isa/sb/sb8_main.c @@ -473,7 +473,7 @@ static int snd_sb8_open(struct snd_pcm_substream *substream) } chip->open |= SB_OPEN_PCM; spin_unlock_irqrestore(&chip->open_lock, flags); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { chip->playback_substream = substream; runtime->hw = snd_sb8_playback; } else { @@ -501,7 +501,7 @@ static int snd_sb8_open(struct snd_pcm_substream *substream) SNDRV_PCM_HW_PARAM_RATE, -1); break; case SB_HW_201: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { runtime->hw.rate_max = 44100; } else { runtime->hw.rate_max = 15000; @@ -532,7 +532,7 @@ static int snd_sb8_close(struct snd_pcm_substream *substream) chip->capture_substream = NULL; spin_lock_irqsave(&chip->open_lock, flags); chip->open &= ~SB_OPEN_PCM; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) chip->mode &= ~SB_MODE_PLAYBACK; else chip->mode &= ~SB_MODE_CAPTURE; diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index 026061b55ee94..d3f1a80c3a574 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c @@ -2196,7 +2196,7 @@ EXPORT_SYMBOL(snd_wss_mixer); const struct snd_pcm_ops *snd_wss_get_pcm_ops(int direction) { - return direction == SNDRV_PCM_STREAM_PLAYBACK ? + return snd_pcm_is_playback(direction) ? &snd_wss_playback_ops : &snd_wss_capture_ops; } EXPORT_SYMBOL(snd_wss_get_pcm_ops);