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: 13752828 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011002.outbound.protection.outlook.com [52.101.125.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA3886138 for ; Mon, 5 Aug 2024 00:35:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.2 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818117; cv=fail; b=L9OmybXBxwWARn2CXfS9H+d4DOPGap2OTpmG/iQgpVQwkiUG4gb7utC6m+Q9BhjQXLfdInXwbumYVMcIBoE9+aWjivIWKBQLeyhaEYlSn0RindJpo71azNoky6P2e8iEFKKOAQXRJxBzdWx6QFAYH6PHHDgCA9at8RODJ3Dk074= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818117; c=relaxed/simple; bh=N7WYGc4xp4YzmzjWHqh7NC9smpp+INH73rQ4aqDnD68=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=UwZOVEICdspVXIRRzlyQqeJ5X5ROJlHPh+rlT1XQYF0brswz5NDellIliLB3/Uj2nIs3KVTOZrBxp9FG1iETvmmhProqUk34uMh9jA7fQ8JgH+MtegH45IcNk/yCPWjbX5ykX1wqaIztd5MSYpcRh1p4ARgv2+88LXalQ1Fztkk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=ZHos9fAi; arc=fail smtp.client-ip=52.101.125.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com 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) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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+er3FGLwIWnEpKL8hZA1CZ1LWctwOd957EdA92OFHXGshX0AGKZMNRg28sieMd5Lb6qxEsu4PoMWcI/aJklFv+APQ0t8tSGFS8ChqX7gf9HPOWi5pc8Xw7FKMxBOAQ6HgYEoaDiRkCeYhxnjj/9RuCvofogkUUwfzSWvVvGWMYoa9d5+FThy6mdXxnRMEK9I9/GkYi7YZ7wNChseh8Ib7f1ezM2KW5n47LkT7bl8PAWUruT+crWbdnhfaa3Pcta+nRvKpPA6nnJvshNsnfXFOfBY3n0LZkiivjCLT22nHr3dsldsMd+7645miU/dq05zuWdF9JGL5B62XJuw6hT2Qilm6+yKK83E5eAGpXRILJ6hu3p5iIPXowt+QBI928k8fw1K9fkQKy0aXFhOUhzWDRxgnZ+3mG5k6dVW38W1hW5IH8Hc/qmthHCjxsaaLQdozZHRfEGQYOi5L1h3xPtXl0+FOm1g7BVdgXlvs7bGe9ECtnr+tdXQ9w3lSZV39Zs55Vtqjvq4W4ICUPF0XKfY9Fduwlf/7rY8bkcuSoLirtjlkiBXdC7X6sXGNyEUaNV4SXesTgpfsvkK1MzsrjHf71AkFYNQk+jn1HXFiZJxm1N4Pz268UiBlzWVZijLCpgbTUl4XaOhYYU4Ep6B05BSpBxi2+ahrIaIOKydgg22UHdcaFzb2jgpA8iFYPSFITyQAEL1Usp76g+Bg8uZtQhMit4DUB5C5HQ3HiddyRydSXbMJLpiIbT4ZbSTkBs73LmQAEU7agACc9lLRDlLztZA8SXIdDzgxp/mnCeIxafMyBrbd3URSUMyjXIvu/T2NptUHyhh04Y1uXTNZLtw1Z4RLVc0Nh187Iy3iKhcb/3IBA07JERoBFzi1Cv4hdzIRYJnLTNIIpw7f9K8Si3RLynRrfMveUO2n7uTaFRrxYk1gMaTrAj07e9jyT+nwFius4NkygG30Ym2FBKa2yLYUnfYayKbn6gORw78QSjHlZXAl+E01XqCyEFLXhO3cEOHNLKcl3js4HWZsHNqNkT8ecrjWY1phi7+2jqLyIpoRBg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV: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: Ujp9C9LTOwMrdSHrfHVKOpyKK8pi7g2Q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FgUZdFjZ+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 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);