From patchwork Tue May 30 00:49:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 688303 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 (alsa0.perex.cz [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 452DDC77B7A for ; Tue, 30 May 2023 00:51:29 +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 F1927826; Tue, 30 May 2023 02:50:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F1927826 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1685407887; bh=X3jrfTcX9sZ0mJfA334R2cRnau6nF+rMqe41lrrJZG4=; 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=hswGpgHoE8WjgHmCJ/kkVvI+y45R4d+HcAJDk+zzv34x3r70sSZG3eTHR274PDg03 7N/mOttj1HnaAaHtEwGogmA69+iCqx2Jhg0U86LqE0q3vUcol3nyTe3Lt0ahQPf/n2 Wvyfzpa1zo9lqs1OA16VnkZoh4UMtOubYx2Wxhjk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 41632F80549; Tue, 30 May 2023 02:49:57 +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 55D1EF80551; Tue, 30 May 2023 02:49:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 99056F80551; Tue, 30 May 2023 02:49:51 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2072f.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::72f]) (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 4CC04F804FC for ; Tue, 30 May 2023 02:49:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4CC04F804FC 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=Va9avtUX ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OA7JPoloxe2tBwQdYKoIGscHiGWBJ2e5NdZ6YK2ok7vkzMuaArfNEwX/vLax5XNLehWCCbSnJcdJkjMcKeSSKclZIVlFKmnrZHhf/qMFq4T2TMQOKfk94+FxLGB8R0yXJbZEvnfllzFKdcOgcXfI1q9ZvTR7rcvRJD4ZzL2pIcwA4spkIF6Cl4rvlLPEJTbuJWMFhAN0EWqoV8rhAltn5DYhfTQaeD7wCpF/SW5xjBhYSUfviGRRb2uxwQmH6+Dpes8pw9UD37dZ5piTP665DgWMz1HqzqekaxJqpgNPjZXh0koAkUdeh7TmD28JmVIlOAfhEAGj4qHl2fQA0uwMRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=DcGT3aG4jCHW0zmifrgnFgdO6mu9JHx+TpmKcWKAM7A=; b=LrVm3VB2fUD6LKgY5dUv9k8WGzGS7HFOXIoav2ACcB6lwM3GopKHWawQqT+Ay2k7fehXLTuejxL5YZS1Jg8EbNFIMq4kLtB0JR3+v2mo+LQpip6e8mrMWyE9gwX65MxAiX6df2lgBPAw3mm5g0PSt745ITSyeIehH1ntMds5rYx+YOpRXlL/muEjRTFH20Hg0RYKOvD+a7M4qLSue/Xmow1yOXsKm3DzYrZ4kB/SeFKpbveTwbcKnkBpqJnPahJhcYOpdBMisGgnPZmqjUX3NZOAd+b0nFjCa3tH6XaVJ8BPcylsX34PIeQftQjGx35rLg4KpzrMyGQzEpl02QWVAg== 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=DcGT3aG4jCHW0zmifrgnFgdO6mu9JHx+TpmKcWKAM7A=; b=Va9avtUXlUGRYeOOai9TACdLadecpLLAuSC5wxeAKh6Tbk30ynEI0d8fx7+j7M86QPosfTmYj6LryfjSvrd3d11pOqj9opHhko5gWDWf3GfMvIzAF2dL0Fw2JDP6hFLenervsuweGHcfrs/fY4RZbUUZRdmn4tYC1Wjcm6lXUZ4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS7PR01MB11502.jpnprd01.prod.outlook.com (2603:1096:604:243::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Tue, 30 May 2023 00:49:43 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840%7]) with mapi id 15.20.6433.022; Tue, 30 May 2023 00:49:43 +0000 Message-ID: <87y1l6zlqx.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 1/5] ASoC: soc-pcm.c: indicate error if stream has no playback no capture User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87zg5mzlrc.wl-kuninori.morimoto.gx@renesas.com> References: <87zg5mzlrc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 30 May 2023 00:49:43 +0000 X-ClientProxiedBy: TYWP286CA0020.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:262::7) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS7PR01MB11502:EE_ X-MS-Office365-Filtering-Correlation-Id: 878797e1-f980-4701-9de8-08db60a7c1f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rfnjY1+rAbhYif2zQmybj8ltuL/33kZV/rrZXiGNWrFepqRgsIPzlgCXR5FQVu0ihPHQTKkJFRw7CCT2ZoXwEVHvgAdvhVuup948yKV/ufBeEwVYVmiSvyOaeEz001x6aJ3w3IrwDJqlElU3IiVfKj8DiDIh6YLGa6cPdQ6Qrw2ceZSc89BpKgDv0MAMgVzmm1ij/yPf/LAsp5KE8Q7Z8wbN0xePNxjvQwIf03jdQyglCYBKFmPNYlInqTwl6PBHu4hd6ni6zBgTiGKrv5nUCI4x52MOYVYLGefPRFFe75jJrwaPkG30Wfh9/Iaghv7gB4KMQ9FEh4xIniXTUWnf0OcKA6w1GmWhFY2MVOZ3y8VKUblz0oeIdqZaDp0JdbbBASorXPMOEyu7ues7G5dI/jLp0tUe6y2Dg7R1k6M19aCOOxSzqVA8/bA2xMjSbe/Zy76H6JjseKlip7d3knsg7sRHCmPUYyqI4P4V/nXQGavHRB326NhrY1pY3igV5FiAbtkSvquG/hc3SN2uR2BiPxWtyXRqv8RnAeE1jWGIOLXr06rPeGKXyK2getW5vLEZ2CUqeUu63w2rLyvigu1HQH6pGBRGOyKE+cRjx6a7xaCU0ikNNkvSmKxHVbRdqHtU X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(376002)(366004)(346002)(39860400002)(396003)(136003)(451199021)(186003)(2616005)(38350700002)(38100700002)(41300700001)(83380400001)(6506007)(26005)(6512007)(66574015)(6486002)(52116002)(478600001)(6916009)(4326008)(66476007)(66946007)(66556008)(316002)(5660300002)(8676002)(8936002)(2906002)(86362001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-2?q?g5C+y0FrT2D7EBrBSMPdGw+?= =?iso-8859-2?q?A8hzSwAD+TLrXdw0zqWn2Z/FLBW5nbDRkwL9/5RhZ44x0dM+J0dT9gQrNpl8?= =?iso-8859-2?q?QqlAOaTcKPXTN+aj0hfKAUQ9QfVS4kf/2lrl7nQlopF5UAP02HBmvAjHba83?= =?iso-8859-2?q?7zyPbMScQ1qKairXB/vNfPng8XqK0phcIhC65Nnppbjit7T6Lx6AQak59+gZ?= =?iso-8859-2?q?EmSiKlaOrsJes1qEBgRd7+c92N0V0rVDmViSIz6l0sjM82sC77Csz7ysbzHU?= =?iso-8859-2?q?RGf6jYbTv2xWP1leseuympD4aFfLCGl4Mm25393c+cHaYTtJ/3GR03u2liod?= =?iso-8859-2?q?+a7dZ4epIHTOCSzBmGI5vDxv0tj6S++dqpvBO9pdWBi8s2iD5uvSr3NklyA0?= =?iso-8859-2?q?zDQqtIOrUhkPynLBSfkud83PXgYkhpZEGuIdgOceZZosmwip+pASqSSgo2uH?= =?iso-8859-2?q?+cnvnDP11kHQOOHKB0Ak58I9BtXljY6SAdFIbwWjz/zpAuBqVxsKquqzo3Nv?= =?iso-8859-2?q?qfd215viQ2kdnZg59o2PZtCMDL//1S8L4qtbOaev5Rt5+vj0LFHIg47dQdT5?= =?iso-8859-2?q?fjcUgPXBGGX/nVU/p5gCY1ech3pWEfyBwGmuIJVBPrRNERMzuzoHwJaFR6nO?= =?iso-8859-2?q?vJR5QSjJSlj2lnCBkgJroXIAUq89in2yi8HFKf9auutKUGAHeZ/0p/8BnA1C?= =?iso-8859-2?q?FdHqe/1K5jJrU5Ayv766AvzCRJWBgolwbe5enV7PmNyUtWePv22SEi+vefDP?= =?iso-8859-2?q?jgfmW1Jrsyw17imWf7I2F5IzEBApzUh93xfEA2+mhLIMfISDUSjS6C5O5Cie?= =?iso-8859-2?q?RjtA9xhvU1odZ5gi06EmJBa9qyC9GChxwki3x7ljpqA4RlVFRhBJlZHfSR0W?= =?iso-8859-2?q?i8MVBwcRqtiootuX7pdWhOp06UMPNEesaBQQSm+Lg6yZJalrw2rCQlnxDGY0?= =?iso-8859-2?q?Awa3yjLnqQkzmYSTCFV7hHVGmUuH8vGDSw72gOj7FS6B5zdzadeeD2Ub+KSJ?= =?iso-8859-2?q?IasczOaEFuyrQtwD9T8Nr1y0GeONxpng4ywUb6VdWFPvNr4uU1WF0u/UUa0/?= =?iso-8859-2?q?2L38bt5lUE2DmRr6z+j+/7gVzNDmH64r34TFPbfvQm7iNNOuj6Dh9bywsWcw?= =?iso-8859-2?q?l5A641qeP9n9sdFIW2oEMJ2jYgLTaQeeqKbVixY4v19dm3fw+qUnjrjkyNB3?= =?iso-8859-2?q?K0qx9I6Q5tmhedzs29p6a6Aqb7ZM2Io3y4glEb9dfe2cpCL79I7NHyROXZla?= =?iso-8859-2?q?H1pZKFxUFxyguwQdpH5UImiFWbOT1SNfh99RRAJxfbk85wwk5Em6XFT1j24O?= =?iso-8859-2?q?qsAX1Appo50FI8OCqEY18JxKdjssyk0AKnVrW9FDmkoZy+CMIUHwVwfGt7/7?= =?iso-8859-2?q?2TfTRbH9cni2/hxMQNKzBBOurbNzvRaTV1U5ZflKkuNeLZsUcOa2K7GvkP34?= =?iso-8859-2?q?mBHNrze29AGdFYg25p6UNnsgvzyfi2c96zwU2qsQWl+sG539AP8qCVd+I5eF?= =?iso-8859-2?q?YFVhKT+UTAUnGMZ+ClWKfBQ59cDnXq4Bc3/ff6V04LGMf3JyxLDKXDdr5vWH?= =?iso-8859-2?q?lXCEaBr/sxTx/mxLkfckBLFYUpq9zVeIgsR+4JNl3U7dxgH3CMouXsJ6aEh8?= =?iso-8859-2?q?EJwl5Bcz0SLhWOcS2W/6pG4GZ+wJQwhzR3hAHeFf+9avKcqj7PDgyZsiFD0E?= =?iso-8859-2?q?=3D?= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 878797e1-f980-4701-9de8-08db60a7c1f5 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 00:49:43.8637 (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: XVL3arcO6c2g/lC+e2HCVU162sG9DM7LmTjkkauli391Xe/8NQJqVKhTsY9YKvV36ZDv+CWtDvJtpDvYZodabYzbI69H5zCKgiRdubjAW71iAsDTaKWhuaJc3G8b8hVS X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7PR01MB11502 Message-ID-Hash: GJTUPLBOCTZ4GA4SKQ2MH2N7RVTY4V7P X-Message-ID-Hash: GJTUPLBOCTZ4GA4SKQ2MH2N7RVTY4V7P 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.8 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: soc_get_playback_capture() (A) returns number of substreams for playback/capture (B). ASoC will probe the Sound Card and mapps CPU<->Codec pair. (A) static int soc_get_playback_capture(..., (B) int *playback, int *capture) { ... if (rtd->dai_link->playback_only) { *playback = 1; *capture = 0; } if (rtd->dai_link->capture_only) { *playback = 0; *capture = 1; } (C) return 0; } But it might be no playback no capture if it returns playback=0, capture=0. It is very difficult to notice about it. This patch indicates error at (C) then. Signed-off-by: Kuninori Morimoto Reviewed-by: Amadeusz Sławiński --- sound/soc/soc-pcm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 7247f44faa1c..fe65994485f8 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2815,6 +2815,13 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, *capture = 1; } + if (!*playback && !*capture) { + dev_err(rtd->dev, "substream %s has no playback, no capture\n", + rtd->dai_link->stream_name); + + return -EINVAL; + } + return 0; } From patchwork Tue May 30 00:49:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 686953 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 (alsa0.perex.cz [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 80763C7EE23 for ; Tue, 30 May 2023 00:51:36 +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 2B8BC3E8; Tue, 30 May 2023 02:50:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2B8BC3E8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1685407894; bh=TvTYotcr4ZOu144Ecmw/NtiyUw1IkWxrJ0GVFOaUoro=; 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=TSAMjarMPitOLiuWcJNHzyYeoSDHg0qAA+U5/PMOPs5t3dmDnY1KOcV4Lxt8TfuTS DX86JOX6nfaagLL+Ow3FZwfHNVPKE5ebQcOSQzR58BV5bAwKTsgKHDBeGF7MW4NAlQ efkEqtTN5dHCQo575/DM806F8d/1UEpWar8jkfxY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 412BDF8056F; Tue, 30 May 2023 02:50:18 +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 E47E7F8055C; Tue, 30 May 2023 02:50:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0C25CF80567; Tue, 30 May 2023 02:50:02 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20703.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::703]) (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 BABD0F80563 for ; Tue, 30 May 2023 02:49:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BABD0F80563 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=QC6rQII/ ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=obA35xwTAaQ18WDVVKSmF+wCoGpOUaUMHqg+IDunUhGGxh96DrltYM++FUu06ozLCxd+6HrZYDSSR1F2j+a31EEyKy9XpwoknVSIX7qF8w7bDmwfyx13J3+Pi3woTiffc++5R+4JlmA3sG5c3V2H0WGP5O3wDgC+Nh4LtXlBvkBIqZ5w9DxAr2stPulH+kUAYuAV7ta5+lcpeDNZ5ThJHjHrUKT0NLFH2eubo7UR2oT1FdyfFbflFLE45SLiMDN5WEJyl664PHdQ6870yFOUpMFR/+OQH128b5OoDj2a66XdNWgrvwYqGRzDyljzumpqHyQ16juK2LqQ9XZuWNqprg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=tbeDTQB35tZm8Y9PzzEs450v5znSklXmzYkAjOadlco=; b=UDZsMw2D2yzBBWkmm9vsB5fuG7FHBc6oCcEHVqAlojDWv//W8cHZkfic5yPn3fMuHP6WOgO5rf6MO0tFkhGCXbhnvaDgedjGc0XXCbs1dIvN6kvdvjNU7bLgZg3qM6I+Op5EDb65Qq3Vt+u6MDGqrGn40Hafen2WvoENJVFqF0gJPzgkt35TNvfgPmrTIg1x/+Im95LembCriBwVyTVymcJHo2rzQ5/GLxW9Z9avDQw38lwG5W1gFLUfYhqZ55Rbvs02Hib3QCh2PjveOWs9WgGgund77lwj5CpaZO0dsU4YukeE9MHYBq5+AaWxYI0StSDPP4i6QyAlBtrfxNr41A== 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=tbeDTQB35tZm8Y9PzzEs450v5znSklXmzYkAjOadlco=; b=QC6rQII/cLfTtLVAcOFBHi0JLTMUYSjXwrGDcTXmrrBtWmRzNhiUhHnY9te/JZjAXXnpFdbRbRrFinCYLvRyUcjpp20dppO1N2jMEKKtS8WZcUNGTXAURFQgBQHjTWBm5h1TwcMgylcqo+8GUiwzxnareGTe1Dqq8t9MKYJKHoU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS7PR01MB11502.jpnprd01.prod.outlook.com (2603:1096:604:243::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Tue, 30 May 2023 00:49:51 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840%7]) with mapi id 15.20.6433.022; Tue, 30 May 2023 00:49:51 +0000 Message-ID: <87wn0qzlqp.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/5] ASoC: soc-pcm.c: use dai_link on soc_get_playback_capture() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87zg5mzlrc.wl-kuninori.morimoto.gx@renesas.com> References: <87zg5mzlrc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 30 May 2023 00:49:50 +0000 X-ClientProxiedBy: TYXPR01CA0049.jpnprd01.prod.outlook.com (2603:1096:403:a::19) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS7PR01MB11502:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ba9e0d5-447f-451d-93fd-08db60a7c691 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5caEhtt7g57n/wnv03s8GbHgYsPJ5ogiWv6O4HgYkq6xUq3/7vB5HhEVTUEwc2CjLa7He/UhP/PxsCCa7hOXytTxO74akPQHZWI7N6OCdTQXX6deBq3n+XZE26IV1G0q2xT+GfqgqkI60OrHJ6oZA8B9FEILxnrHxLteHb/e0eNbo6kCcY5IhzauRZxeuo/hl0ejoSB0vNHSoG2lRR0vJxgqE/4lUIvtD668Jg5+14KjrwpZnip18X1YR1ucN/rqmxuuqZXXB4sxW1Jpt+Z1m8FOGlyn9Uy/v71JOO1Yh4Xge4H1kGlzQnaW6cgbDiERlK/9+K9jFL3UXDXRWWO5vuKDCYl3bsB6oQ0G82yVODjW9GIhrtwUQTFZbSSLoGox4dbX4Bba5nzKQzmWuRbPhTHaJMfWMYF72pytYazZG1pRFqczBT1dlg6QGIwaOv1M/7gATYOu/tpgUjsM0Gzuus2yb/mI8l4QUgtJk/Am6LhlvNFZB7g2G3OE6ZJc/vAu9+38Bv7Y1YgrRnRVU9ypEI6njM4AwmHd9XFC76Zr3ciZ7TRwvDv9k2sLkypTt6ySmkldVKxNbXmXkyTwO8qCOmEb2PTLt/MPBWS7x1GVVkKoQrbDV/7bN47infIP6JZHm8xD1ULD0XcjuPrsZH5ZlA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(376002)(366004)(346002)(39860400002)(396003)(136003)(451199021)(186003)(2616005)(38350700002)(38100700002)(41300700001)(83380400001)(6506007)(26005)(6512007)(6486002)(52116002)(478600001)(6916009)(4326008)(66476007)(66946007)(66556008)(316002)(5660300002)(8676002)(8936002)(2906002)(86362001)(36756003)(21314003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-2?q?ZFXi80dXdPXawq+Vj6XxbAe?= =?iso-8859-2?q?lBYfLQxyZH6bPb9V872AlJ2X3jnLRAtRdD5MyVqJf5goJTE2sCcD7WQKf3od?= =?iso-8859-2?q?C0R1VtXKUKl74D0IUyxP6voji5ZUI31Gqadl6CKwOoUMQCavk4XN2IVhYtW5?= =?iso-8859-2?q?ExOSJbQr5dJcmBIvzzAoQw8HPDZHoAy5kVgPkIirnVFl+et5H0JqMgT/uATR?= =?iso-8859-2?q?uLyyZJQb9PK5Nq//OP1xLUDB1ItmHCDT8IJ1Atd/ovICi2rXED3rzjf6D60Q?= =?iso-8859-2?q?fiQFzOhGw7g/DtFW52UxlJ58wLnwaqEI6ZEf6mKnzVAekbV6PoRr4gGskoYf?= =?iso-8859-2?q?cg83VBgmUHv19mag6ot1ggD8VAIpEfUoEP2HT9IAVwzfVRBSoA0yq9Pgc2w7?= =?iso-8859-2?q?apVK1+BcMGs7IYEr1uB09ldr3Dn3DJh4Hr2TovKrkUVs/CRe9m7ZXCxefPJd?= =?iso-8859-2?q?ESWZEYRi2sEjQSEgonahW9w7kSKjqHRw7FXUjFPox752lXGneDSo/VIBXaPk?= =?iso-8859-2?q?mMNIG1FHna0tpKzwbTKr0UGr46e3mwGWVBEIzLVIu+/lPu0s0Qg5c8UVmpx7?= =?iso-8859-2?q?iEemFvEmIXMdlIQ70G/QvMiQ6MFIK9+hy+Hlp2z2ICn2wYVm006YRmFndrnP?= =?iso-8859-2?q?GhLVgCr2/m/gUJhnpUXoGpWZ4iSVOuuDdT9Q3CVcibrzd3U+zE9bDShmsa1g?= =?iso-8859-2?q?dCoyKCdHOkkICBhDpoJ/fKFWtAVfcWzM/Ec+qz7R7LKA5N1hZDwxueuKyawb?= =?iso-8859-2?q?pumm3SkzU+truOu8GUnK7snWS8oBPXTLqVGK870LEHeqn5SG7j1rrCTbChCH?= =?iso-8859-2?q?AEwOImZNtFZWRbjihUildD/pf/vv4JrH14s4/asyB7AR//mpUHgzxzu7FiMV?= =?iso-8859-2?q?s1UUuUmBuJbI1m42G0KWksbsrpjySOSpaFpp+UmEvMlB2xkVo7YCIpebxFvJ?= =?iso-8859-2?q?qYJPrzyBysuL8X8Br+1mP/1Gggct3rAWPOQGBpVo9D84Q06hL0xsnOAVtiPP?= =?iso-8859-2?q?DxY6J9eAiMHNRL1Xvk3xNhX/h1hKP7F8wS8j1yrEb+p8zgCyPkRFaGmDOHer?= =?iso-8859-2?q?uGfxboqkOEDX36yFiSyTtkSoDdyEOSW9Q2sEbZ+6jGbP9goP2LqXRUKzULlI?= =?iso-8859-2?q?MsjIYOSEUIl7REEBq61sUUter2u1YhohfaRWxtSm0gkj94ybRi7PJRBE1x/l?= =?iso-8859-2?q?1p6m8SVDrCdvjJnwBtcuRoUEUatNbnxm7y7M+hJmkMmVtSeLHs0XSbapFYKY?= =?iso-8859-2?q?/NYbAEnH4EG0EPDWMi78wZFahPhRrjJOdnFKOQXnRrGbNinBTUZo0XP1dZHH?= =?iso-8859-2?q?6xyyTyOv6/ateit27uactPfmZK6cosSItf0uY6laLblqh4QR82FfXT0PSQnR?= =?iso-8859-2?q?llWXKoG3TkuuESHNuInyTfbEVASYnerKPX5cZLT4bDBtCwdJLz7cLFp2ucl6?= =?iso-8859-2?q?6rudcZ/nNxX5JWu/IjaYK4WCKNxVYICzOz9drxWqwfWXkQWitM9SVcKS+iI0?= =?iso-8859-2?q?xBuc1Z8G1/2X1utJMBRqdT4bnTRdgX2Hk/v2uHoO6Rq1cb8T/ws7ftdndhvA?= =?iso-8859-2?q?85RRUipenAEIgmKkJ3jfsV3G6DsFmaLZVaKZWXULVyLUwM/bRfWNO/y6iHEF?= =?iso-8859-2?q?uHnAKnkjmT1YE6TlCC0jDXTnQncDW40lfbLVOD7eBt64FrokzSVi2YBbWaLE?= =?iso-8859-2?q?=3D?= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ba9e0d5-447f-451d-93fd-08db60a7c691 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 00:49:51.1382 (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: SkTTyCXv6dSkT//4PizG8vk53tutJA65lGTI0aBax/gqARh/iWRu3tEP8dSquvunpN5pc9VHfpSyK2UA9Vq13CKBMDL/GJW+dPVRsWIAJweneM5rTZBvEk2/rR1SiRmy X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7PR01MB11502 Message-ID-Hash: ZOUVEADF47ZLYKF3KST4U525DT26SB6I X-Message-ID-Hash: ZOUVEADF47ZLYKF3KST4U525DT26SB6I 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.8 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: soc_get_playback_capture() (A) is using rtd->dai_link->xxx everywhere. Because of that, 1 line is unnecessarily long and not readable. (A) static int soc_get_playback_capture(...) { if (rtd->dai_link->dynamic ...) { ^^^^^^^^^^^^^ ... } else { int cpu_capture = rtd->dai_link->c2c_params ? ^^^^^^^^^^^^^ ... } if (rtd->dai_link->playback_only) { ^^^^^^^^^^^^^ ... } ... } This patch uses variable "dai_link" to be clear code. Nothing changes the meanings. Signed-off-by: Kuninori Morimoto Reviewed-by: Amadeusz Sławiński --- sound/soc/soc-pcm.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index fe65994485f8..db3fbe1af2ce 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2731,19 +2731,20 @@ static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream) static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, int *playback, int *capture) { + struct snd_soc_dai_link *dai_link = rtd->dai_link; struct snd_soc_dai *cpu_dai; int i; - if (rtd->dai_link->dynamic && rtd->dai_link->num_cpus > 1) { + if (dai_link->dynamic && dai_link->num_cpus > 1) { dev_err(rtd->dev, "DPCM doesn't support Multi CPU for Front-Ends yet\n"); return -EINVAL; } - if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) { + if (dai_link->dynamic || dai_link->no_pcm) { int stream; - if (rtd->dai_link->dpcm_playback) { + if (dai_link->dpcm_playback) { stream = SNDRV_PCM_STREAM_PLAYBACK; for_each_rtd_cpu_dais(rtd, i, cpu_dai) { @@ -2755,11 +2756,11 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, if (!*playback) { dev_err(rtd->card->dev, "No CPU DAIs support playback for stream %s\n", - rtd->dai_link->stream_name); + dai_link->stream_name); return -EINVAL; } } - if (rtd->dai_link->dpcm_capture) { + if (dai_link->dpcm_capture) { stream = SNDRV_PCM_STREAM_CAPTURE; for_each_rtd_cpu_dais(rtd, i, cpu_dai) { @@ -2772,7 +2773,7 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, if (!*capture) { dev_err(rtd->card->dev, "No CPU DAIs support capture for stream %s\n", - rtd->dai_link->stream_name); + dai_link->stream_name); return -EINVAL; } } @@ -2780,15 +2781,15 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *codec_dai; /* Adapt stream for codec2codec links */ - int cpu_capture = rtd->dai_link->c2c_params ? + int cpu_capture = dai_link->c2c_params ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; - int cpu_playback = rtd->dai_link->c2c_params ? + int cpu_playback = dai_link->c2c_params ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; for_each_rtd_codec_dais(rtd, i, codec_dai) { - if (rtd->dai_link->num_cpus == 1) { + if (dai_link->num_cpus == 1) { cpu_dai = asoc_rtd_to_cpu(rtd, 0); - } else if (rtd->dai_link->num_cpus == rtd->dai_link->num_codecs) { + } else if (dai_link->num_cpus == dai_link->num_codecs) { cpu_dai = asoc_rtd_to_cpu(rtd, i); } else { dev_err(rtd->card->dev, @@ -2805,19 +2806,19 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, } } - if (rtd->dai_link->playback_only) { + if (dai_link->playback_only) { *playback = 1; *capture = 0; } - if (rtd->dai_link->capture_only) { + if (dai_link->capture_only) { *playback = 0; *capture = 1; } if (!*playback && !*capture) { dev_err(rtd->dev, "substream %s has no playback, no capture\n", - rtd->dai_link->stream_name); + dai_link->stream_name); return -EINVAL; } From patchwork Tue May 30 00:49:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 688302 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 (alsa0.perex.cz [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 93499C77B7A for ; Tue, 30 May 2023 00:51:53 +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 64B3484A; Tue, 30 May 2023 02:51:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 64B3484A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1685407911; bh=jVO+YGsbwRnAzy9jREUYpNMZuswwebg6ihl8fGfpDtQ=; 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=gNpHD0OQiXtVZ1eSYKVK6WZHeefBpJSAYBoJqhPojV4qTo1+sGMZj8ZHvIsM7JeTg NtRJenjTYUhGByjMT+eydB7WtOyuEJCZDiaqwQ7tzHNN853KPz7jolB6QD1pTIeAkB PdSVc2imGyjg2jq/2RlgqVpy00NvdQc2MsNIahX0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E1547F8057D; Tue, 30 May 2023 02:50:24 +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 4C8A7F80571; Tue, 30 May 2023 02:50:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4E35FF80564; Tue, 30 May 2023 02:50:06 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20703.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::703]) (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 61854F804FC for ; Tue, 30 May 2023 02:49:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 61854F804FC 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=QkvyvgDw ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=edWYGJkSHo+6XZgftKw9SFOlZ2Y0PWpT+/Kpd6Ay+fnu2bB5kj1x5feZxPGFY8jtmNBzLobKdWSdZLcezYo4rE3Sg29S0DqVXEAqnnyO2/ZiqcLVBSczIV+NFwac/zuLhOk1dX+vQcD/Cfg4K9eayFIJvxahPZVcS5CiUDMQnjIphRc95ZnTeVeWHBOylCry8T8WkLu2iYlAgmak8/s4rMu/sb1y0Hve9DiPmukPJOMyKlv+QQsZZwd78qrQD9WMZOBctq6bV8YKd8CX3CUkxbRU6WnOD3PB7HpJ6j8Iz0fdyJGu74DuBiZDItz7jSHC6ppqyY1aXeB5//6/7BHMHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=kmQ6mb3JrwoxbGRKGzZ43ikrzMM7iiARHn29Pvf66OE=; b=ROnke0K+C3D4w1/JubTrpIVWzg7T3C/b+/lJ7Xh/ob5rJYHlvzqIGm66XGdOagLRJvkYK3/FmNXOaSzKG9Vu+LpUyzJ2dwBTyjmn5sInzJiGZS9ukX5/7DDd4dogjVPbjfVbfuR+eF1vN1EMkaQXWmyKIOQnqFMBb5iJmfpDX8RB29lyj8SJc7T5XT1+fVs71yiT5z17cnHX1HA7qmAdWpC1LW21z/fmplyR5QRbPvRSK32G/5X2un3D0CnJsi/YCmcmRIguLwOzvtSlymf8lnVuFRIfBA/OPCNAs30dU9ZQ14MCZRbhQl1dhQHaQ9V9jwUXZTBf1FM0TRpYogWR/Q== 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=kmQ6mb3JrwoxbGRKGzZ43ikrzMM7iiARHn29Pvf66OE=; b=QkvyvgDwfoQ5oYtg9e57ZbL/PhY3W2VxKsa1GMQEzYhU8w0e2yo52DRYYnGA5vtCaNbJgl5Z6NzpSNzb4lHNTK2HCLiNcpwuNY7ISgsypGNp+p2zmw9E7veyjX8FK/MSnctuNi54cUBBERFvp4Wse+AbKTY+s7XYqvhPuSASBtE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS7PR01MB11502.jpnprd01.prod.outlook.com (2603:1096:604:243::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Tue, 30 May 2023 00:49:56 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840%7]) with mapi id 15.20.6433.022; Tue, 30 May 2023 00:49:56 +0000 Message-ID: <87v8gazlqk.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/5] ASoC: soc-pcm.c: cleanup soc_get_playback_capture() error User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87zg5mzlrc.wl-kuninori.morimoto.gx@renesas.com> References: <87zg5mzlrc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 30 May 2023 00:49:56 +0000 X-ClientProxiedBy: TYCP301CA0037.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:380::9) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS7PR01MB11502:EE_ X-MS-Office365-Filtering-Correlation-Id: 48c592c3-580c-4686-ac22-08db60a7c9b9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0Iw/CtopfgrlXq5Vrk22Zh4iXC7tH3UjGMS5V7tazQBy9XMT4Pe6sCcWciVrQMIBZrUA5kw0otr8OeAIAU3C0NKYKtX5uafUjsCxxvulyqEX6F8dQxiY+OprXXuUEP/gv84qXyvmjYH15ope66hsliHU3/IgNdNZeONzH6QHDpX2TKCiltIb3caIgZo8okrbR7upADkU5bc8C1QDC/8tG0W3+gW5a767W6nxDAFolPPcWnvbaerMngU6WW1QEqzxU2Lk+2N8DUk0Evdu62WtemwRIA5tNStTeubhXieA4zrI+YVwxyOTz/aa3vG/wxiyF5tARSsSaf0mosUo6kU1wmiWU4o94HzTjUREovf4iLrC8dQuiK3IxmkOr0LnaEsJyy99/8CUl4oVrNP8z4hFNzRXXPdXwkq8ImcYBhV+jhUnCwZ0RRKrBdLIeVf54u6v9+ZsMVLDXiIDPDIbYtogSy+szRY2M2ZDo/F9YlBwdzJDTINt1dzdJs/JtpZ2M9csF1m8MCJbFFtt6bYbFJNQTYLq3CxjUoaYwJxj6HP7/l5fKmDzhT0WHhwXAUvYpWV25gNH39C987vG+O6ioTA6otFnjZ25dBqXXTgWW/zRxtqQ4b/3fcBCIzE+vKobzsI9 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(376002)(366004)(346002)(39860400002)(396003)(136003)(451199021)(186003)(2616005)(38350700002)(38100700002)(41300700001)(83380400001)(6506007)(26005)(6512007)(6486002)(52116002)(478600001)(6916009)(4326008)(66476007)(66946007)(66556008)(316002)(5660300002)(8676002)(8936002)(2906002)(86362001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-2?q?e8Cy90ZrFzuX83G2vlDADCj?= =?iso-8859-2?q?bLq431Ztv1SOADAFHfvgw45QrHc4ospeZ8bEISKnPzkyDCf+eUMRxZieMI4z?= =?iso-8859-2?q?QUexwVSy4He0zB2mzcVOSbQ9iRTK1qS1hUbV5JLaR/DFTM7cGmxiJJ/Z7QkG?= =?iso-8859-2?q?zmqSDOv2uk1Xy+iTznIyeUq4eZIBMIC0D6WGwBue4VvExIqYced5Z1R2SI/Z?= =?iso-8859-2?q?ugfa0zzJXY0Gs8JKAXyQrSXXvFdWcI7va1UcoQ+7akIuZ1I439W+58+XOCel?= =?iso-8859-2?q?fOpIynk+/ZvE3Aw+C5p8fKNFni13bBYQYrKdBi96NMgcINqm/U1CB/xWlgGb?= =?iso-8859-2?q?j/HpO7Z1O+JrG8jmmtQe4A/w2M0FwffAY7hhf9UHz96kQL0oooldH2K9zBXm?= =?iso-8859-2?q?KLhdvUj6YE9gKbQRoveDBWZ7ofQrrrNTUHn8ZaH8UeBmWc/grfS9tcK8KM/A?= =?iso-8859-2?q?7UrZkJSuyLCHBH+6ABLmfbiiC4l9Bl6I6HySqxN8wwt6wRatZwrJ0pNGWtVD?= =?iso-8859-2?q?uh02RN+68mQ4YvhwXcCHt6IafGgwcPe65XCs+8Qk7dFapWiYNYyAYD7n3Xnw?= =?iso-8859-2?q?0Vnly/LYLr9LkIb7kt1QZKGZQ4iN3aW8TDyu7iXOao7ytbwX3I3O3aKqH85v?= =?iso-8859-2?q?UewYmS0UyqjbUtrnh3gxvLmduuTGGB6whZSzESghG2PW0iKrl6KhmMcew/jB?= =?iso-8859-2?q?jTE8U0v4NvejYVUdRvES8EoZteal7A7nWri6tWRHfEj1Bs4Z5bNQCzdUVQnV?= =?iso-8859-2?q?vQpxLfhsWVH0PhTrD7OZVSmbhWKx6maNXqEEEtgbZYA53cmYjTL+C9bNQkxc?= =?iso-8859-2?q?EwrKtekZ2fF5/c3LWgkIXX8br5gol/ZkGSt4C6/l5fuLE9inic5czqEkuoMm?= =?iso-8859-2?q?ckddBUGD8cvAx4qrCBRrUPqvB7RxyA6v54ip/QfAYqT4KDIOzCO/qW6GWXJk?= =?iso-8859-2?q?nIniynnmkVLXLBamXYp9VaBkhUyqH3O/F7QAWFiKKK7GwNlQNcgToxw+2IaJ?= =?iso-8859-2?q?WJ9npihllrHkQCW7zegIRB4yFAU56w4NicxAKE9JL1WcF5fIdyw7k0loiUOS?= =?iso-8859-2?q?Z+TB5mCCNbsdMgPuxXcsmTqZxnPCSrZ7O3zKW3yLD7PCPc2M+wt2kKh8PMVU?= =?iso-8859-2?q?ct1kVTtH0KevhG66GXl6ZGq69Y9pwRwA8fN+pUmfyj0Ilrwzfg9X24fvXR+2?= =?iso-8859-2?q?MPUzA/XWDYWhwdtq2BWTqXF8OolNBkmt4GNpV5EFXBQiNrnxc+FyDJcok+ze?= =?iso-8859-2?q?9qybokgtmmDcz1UnmJMenIMuHRBin/NTlSxYMRcBv+MSDw0GaOM9mqENmDgK?= =?iso-8859-2?q?IwAqmQDEroy//C+ekegQ+q0pDmR3cM4aGHiAV0stbOKw86P8bklRRai9nWxF?= =?iso-8859-2?q?T65g8RYWz79/uDzqCwUDzre72vWB+SmhSRRTIE7mEWD4SPEr03ZJO6Yib+YV?= =?iso-8859-2?q?sQRor4hLfoAA/Iq5BIkRfrP72/sHfI7N9NGOlcsTh48lLLbkynqBOrW/V3Sp?= =?iso-8859-2?q?ioyHMaEnXk+WVDFzTNthHRk6lgwmSaFh/A0rXzKTgliGSGqETUqznNgY+6zU?= =?iso-8859-2?q?ugSsRejagtJ/n24ex8RxA7FThhvjBQV8VaO+T9O6opsGE7Qf+T5PBP1z19cx?= =?iso-8859-2?q?kwPxEPgQeld9JxkiYzpeZsCEQ9ILkffMzVyaztmnHg5fhvKY/WQk1khLBs0I?= =?iso-8859-2?q?=3D?= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48c592c3-580c-4686-ac22-08db60a7c9b9 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 00:49:56.4551 (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: fX7K7DNOzr1ORmCAhwj8yS8aUENI75JCjBBrbiGEw10fVNStfhS7okFttxFMLNPnksrIYsiMQp4q4mAvC/JbdpwzBWAcQAGgyq860RjlwoMhhdRfGJppV9+dx+lB6XIl X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7PR01MB11502 Message-ID-Hash: 5BGHVZUPI3NRNDRU3YZOWJOBTUGM5SXS X-Message-ID-Hash: 5BGHVZUPI3NRNDRU3YZOWJOBTUGM5SXS 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.8 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: soc_get_playback_capture() (A) checks dai_link status, and indicate error if it was not matching (B). (A) static int soc_get_playback_capture(...) { ... ^ if (dai_link->dynamic && dai_link->num_cpus > 1) { | dev_err(rtd->dev, (B) "DPCM doesn't support Multi CPU for Front-Ends yet\n"); | return -EINVAL; v } ... } We can use 100 char for 1 line today. This patch cleanup error code line. Signed-off-by: Kuninori Morimoto Reviewed-by: Amadeusz Sławiński --- sound/soc/soc-pcm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index db3fbe1af2ce..47da3be0ff46 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2736,8 +2736,7 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, int i; if (dai_link->dynamic && dai_link->num_cpus > 1) { - dev_err(rtd->dev, - "DPCM doesn't support Multi CPU for Front-Ends yet\n"); + dev_err(rtd->dev, "DPCM doesn't support Multi CPU for Front-Ends yet\n"); return -EINVAL; } From patchwork Tue May 30 00:50:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 686952 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 (alsa0.perex.cz [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 D53D4C7EE29 for ; Tue, 30 May 2023 00:52:05 +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 E011C83A; Tue, 30 May 2023 02:51:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E011C83A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1685407924; bh=ZuNMos54AIJNlqmD0jq22TXyOPV/7yJ53PYTpNN2gro=; 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=l4RyHmBvD0T/xqI1dyn6p8/MW6onaCIcLBpJgkyRG2mCJ6mLooDeMEDh77TjMW6SK j82R5XgTt9YqeBMrcKrGTGiaMaQlRKBRSRRUsmTAOcCM4DzRBz9q+igCU7gyUnA8Vj 0TNnGxvJ1a2TvalWgKy0zVcZYO3S/1LxY1FMDqEM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2F184F80571; Tue, 30 May 2023 02:50:27 +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 AFAEAF800DF; Tue, 30 May 2023 02:50:26 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 97DAFF80564; Tue, 30 May 2023 02:50:09 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2071a.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::71a]) (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 8E03BF804FC for ; Tue, 30 May 2023 02:50:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8E03BF804FC 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=KXbJ/HJf ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HtVIA80OS9tzCKuaFsTUgl2336PjitDFvFTGOzdwIVYxFxD3RtN8lQtL6fu+Kby9B5vh8BIQPQY7fhI5Nf6MvzcZ1VhjLKckd+qMu7HP3otA59JR1Z1VLhDyGf667ureb2+ZDZmSWHG13I9SArllHTVwbEV4cyoF0fzjTiYnwBbL8RcF1zZbjFj5ZAVIo71g1zp4qu2eFNPjWcZlRBHqn5m4Q7LJDkda955fswtRSTy3UiGas2DMGQKl8nR1XxmuGJu1bridlKOKG9uKISaiVyJTFU8CGI0+z5ChyHyvvMAoQ4RMUcryXqwksHZPHABhc7oBM2leImLg0GObG1n2Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=+oOkqhKbkTL/3SiEEeyds8HkZVDM28kI07WMjcz5kLc=; b=ExxOiRF2gbilSgSnOYUbiXhkjjpT8NDfjcljtgYpPbBK3q5A894HwM4WeipFSymJhayYBxIwSep52bVGOj0MZsMblh6gaBBLTLWzMQlfV/X2JhIKTwFHlsf4whNdgzVXoiGqMetIfxylvg+iJE2QfwNkDGDNCZERvQ7kGk+Us3foXxsv2eWW0vthOdmyixrE4gwPXX+VoGLOzI6jSP4BgQMk/l2VNLLAt0Wb9vadSPy4L+5gv2Baq7mAXASTxweVlwR6A/cx6iMPZJxr5ynkOhpuUoyK+az0QuVTnO7d5ePCtO3T0HRMUn94UL2zOp3Tknxq3EMbWR98AkHA1V7ZcQ== 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=+oOkqhKbkTL/3SiEEeyds8HkZVDM28kI07WMjcz5kLc=; b=KXbJ/HJfkzGqsR1Q87jemRjP/XatUE4pP0jk5uGrtpFoXueHGhc/fd9YL76Rs5pzdAroJwLOteZ17WQ/EUpkMBhJFviT4tHezj7Wa85gB55CeZxsUuVVh6Pz8sYqbbrf6jA417wD1XtTWwEe8T2/vtn1gwE/j9ipBpoCv0xX+2U= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS7PR01MB11502.jpnprd01.prod.outlook.com (2603:1096:604:243::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Tue, 30 May 2023 00:50:01 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840%7]) with mapi id 15.20.6433.022; Tue, 30 May 2023 00:50:01 +0000 Message-ID: <87ttvuzlqe.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 4/5] ASoC: soc-pcm.c: use temporary variable at soc_get_playback_capture() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87zg5mzlrc.wl-kuninori.morimoto.gx@renesas.com> References: <87zg5mzlrc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 30 May 2023 00:50:01 +0000 X-ClientProxiedBy: TYCP301CA0044.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:380::6) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS7PR01MB11502:EE_ X-MS-Office365-Filtering-Correlation-Id: eac4f4f4-8412-488d-c16d-08db60a7cd00 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cgcrEI3hxa1nzCBu7pzQ+y91qxLkV5mtuctON11E8XPqXHVlYQru2EPGtWB6PR9aoYpU7BH5YamwdYo9TFN2iItpE0qcGQMeITSJFQiDb90If/Lddbdbs3WynhNDHeNXFs+oOhI+uZ3IDwXekiaBmIIOdVES1nkgFEZ8vSaosL+ex2M5JSeGiAaIGiPrnhwNXKljQkmWIUq4g7LTyykGzZrd6DRP1i1qMv7f3TvZCBmUadDutAFHCcUaXhQeVlJ0GoIQ9QBH0cBlLHwhjiq69uW6TABwvFCq0fvqXJd20pgRXqYFCaraKtVFtvJt0fAX80yQz+4AjaSLMuuEJMFmb1UY/iywERcJCrmm1IzDboLaSRJTa5JYNFa3CA0Qcf/l1ulRFGAAUWzA9LKQr2vLhyQEqQbq8dDCXaM4IBAP7/Mr7uov1XJ8rmAjaXvn0V5yZcRvfAEeMpy3MC2jtrRI12/QGvlccqGjFdJZGTecRrL0/nGUd/c291npVANaelhvCmM3eHNWyzfHCYIGUd/ll/rrKq8MH7c0Vvzo/jBXvqu6YukOtyhhsgvi4FOEijTcMR7/swU0sxRdu9B6Qh07ysqqKmNEW+mHvIdENdHgSte95kNnt+akW9jimkN08NpyGg8aTz7g6cM79zz7aBUXFw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(376002)(366004)(346002)(39860400002)(396003)(136003)(451199021)(186003)(2616005)(38350700002)(38100700002)(41300700001)(83380400001)(6506007)(26005)(6512007)(6486002)(52116002)(478600001)(6916009)(4326008)(66476007)(66946007)(66556008)(316002)(5660300002)(8676002)(8936002)(2906002)(86362001)(36756003)(21314003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sNHibJRFQq66e3FuGJ0Qk7AKW7dvGHVqR6+pFZuSLhar/MUqOat2RotjKuE06yZ9o7+txTGZPS6m5OnL7/5R3thRjxnRw5cNrfCtRZaPmEtf3AHEpjL+fFTyCHWhpuekQDxRcEMep3KzYhpHRupho3plIgWWqDCEKnZ/SKRj9AvhS2/37a1eYBIQhpsYhfKgVOC12TZ8eWylnM2yLmbvgQl6XAptNQnzbd5NKUTLjjwxGbH4ZgJuYFn0UPgJRiQsy1P99JVrNovss1Lt+bwUm2X9tTcSvDRmGiOPOcdfhtu3bz+0nzLs46DaJtmlt6cOYEvu5koWBGrjEivkSXSKZHJWu2ZfRmylrsTXIJRIq3g99pX2ORS6BwuK/aX4A4U/44K/gEGm8SHRij3C3sEhg0VS1qQKzOdgRT/J1r12xZoKlq7kc3ql6cudKA2AErolKCPGS6VJZXJ5Qgn1Wjv3s5RmAJ1eX+3YBXj8hhCzOl+c+qD8epw53H/e1LENdN50w2SIFPPOB+wz25PJzP5mugnaRvoRSAsnPjy6VfFSzPPJZKktp07DjjEXnSsU6k/b/zTchGjxCZEGtcrns6piaf9JQjsK0uIu4oVStMUTdoHWJUdOfNeFLpCzRSrCsTcls2Cl+p0YKFVTwwyLbyi5czVJdKQwQ79vbuvuVS+lY8LZr0s0S6v4m1prDTeTgEvjhsAe2RaAV0iKdid4+w39o4aiBtNtX3j4Rq7XXW8bNsIXkllCfmycWUOxAZHWXGV7cKNvMqs9VuiIaStREUZ+BAL/+1S1gDm2HrYxDbYnYE9g87vev8wk9/nMbZUv75s/ay4BLFCbdSYtsS6ubusmFtpo156QkduZZkokMyIH4Z8M+fjS9VFXMCfQMvC62AJ26SAa6E3RAdPDbrdz3E3rQZHRxaILdAO7eiu+ISwkpw/zpTvxwJBT8uH3eMbhxJIH9dfQWGFGa81E8po9tmyPWeUselkwwXTeslAkBChaUALAausItq4x2ylCA/2UjLmTgQGtFghBGq6QFc2ojIFeL51zDBZeBmURhKnWgJkD7Nv+vVMOCeK7FSA5N3MUj+8Ev151uLh9rHglG9GUuRTQFORnppGyGQ4Lzom4Qg5RYycQEtkev1Coyd8UhK3/mdSskYxw6gNUvdj88NRn1FN+baC6VP2Jn2L7xY0rk/2oellIB06eNU2OH+NQ5E+h3JqQQrVoTeFJe8jt2Qtj0iCFZKhdSa5H9HayGryYCgmIdQb2JpoIt9r4CCUDD+wHEI3tK4c0tRRejTwfnjJmguZj6yd1ma45+BKzCtEit9mJ+X1Ea7icv83QaVPgiMFJUz5JHL47RJc568np8gJ0IdOaRtW7gAyMAEr5IEdWawF8PVR1degqNjmgm5JLrs560xHwO2IRr3dxkCmuCo31OYrCnll8uepcAaA3R0DJAFJjJ3PBrex6bJ+BrvJifUaAoEKwTvgS/q5Qr/12hfvWbaKQOkwtXvxJFLOgIUCs9tPgP5RvrrL45loQeLQ89WFlU6MlI1+APiIbRCiwsxb2qj9HCGSfGlIUPdyuaOUT2trGNTxkTJqk58z2JVB7lyICniJiRS9vuWnZC25ksQPeQYgBsDzRWlAEgqOwFzibcOkdFhI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: eac4f4f4-8412-488d-c16d-08db60a7cd00 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 00:50:01.9160 (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: Xdn8d4CAXD3rrfQucPem1ESFwwijmitPgHGcj99nh1/fxPGn/kBzhUam5a2c98oS6jgsjBHDaunjfPpPj/Qi0QpILuA1lU/kYzSM9ni+6mYizeRH33dKSVQlBp0glJld X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7PR01MB11502 Message-ID-Hash: ODY2WIYPN5HUVIPMFOKYFLU27GRDZGVT X-Message-ID-Hash: ODY2WIYPN5HUVIPMFOKYFLU27GRDZGVT 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.8 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: soc_get_playback_capture() (A) returns number of substreams for playback/capture (B). (A) static int soc_get_playback_capture(..., (B) int *playback, int *capture) { ... for_each_xxx(...) { if (xxx) return -EINVAL; => *playback = 1; ... => *capture = 1; ... } ... } But, it is directly updating playback/capture which is the result of this function even though it might be error. It should be updated in case of succeed only. This patch updates it. Signed-off-by: Kuninori Morimoto --- sound/soc/soc-pcm.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 47da3be0ff46..b3d569e7ba61 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2733,6 +2733,8 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, { struct snd_soc_dai_link *dai_link = rtd->dai_link; struct snd_soc_dai *cpu_dai; + int has_playback = 0; + int has_capture = 0; int i; if (dai_link->dynamic && dai_link->num_cpus > 1) { @@ -2748,11 +2750,11 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, for_each_rtd_cpu_dais(rtd, i, cpu_dai) { if (snd_soc_dai_stream_valid(cpu_dai, stream)) { - *playback = 1; + has_playback = 1; break; } } - if (!*playback) { + if (!has_playback) { dev_err(rtd->card->dev, "No CPU DAIs support playback for stream %s\n", dai_link->stream_name); @@ -2764,12 +2766,12 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, for_each_rtd_cpu_dais(rtd, i, cpu_dai) { if (snd_soc_dai_stream_valid(cpu_dai, stream)) { - *capture = 1; + has_capture = 1; break; } } - if (!*capture) { + if (!has_capture) { dev_err(rtd->card->dev, "No CPU DAIs support capture for stream %s\n", dai_link->stream_name); @@ -2798,30 +2800,33 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_PLAYBACK) && snd_soc_dai_stream_valid(cpu_dai, cpu_playback)) - *playback = 1; + has_playback = 1; if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_CAPTURE) && snd_soc_dai_stream_valid(cpu_dai, cpu_capture)) - *capture = 1; + has_capture = 1; } } if (dai_link->playback_only) { - *playback = 1; - *capture = 0; + has_playback = 1; + has_capture = 0; } if (dai_link->capture_only) { - *playback = 0; - *capture = 1; + has_playback = 0; + has_capture = 1; } - if (!*playback && !*capture) { + if (!has_playback && !has_capture) { dev_err(rtd->dev, "substream %s has no playback, no capture\n", dai_link->stream_name); return -EINVAL; } + *playback = has_playback; + *capture = has_capture; + return 0; } From patchwork Tue May 30 00:50:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 688301 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 (alsa0.perex.cz [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 5D830C7EE23 for ; Tue, 30 May 2023 00:52:22 +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 4C10E3E7; Tue, 30 May 2023 02:51:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4C10E3E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1685407940; bh=eXkDvqezi7ERAGj77f83+BFDRaBmKx1vpn1imIQSQqc=; 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=Dsb5bc0tXvthfwDwlu+M99LrajmqVAYvpZX2x7fUn3ptUOXN6JTAjKrV5+Z+GU7QJ Q/vHTWrBt2szEzfwuBjBPl/5Wa3UpyrGm6nldJbl0zsiW0YWO+B2RtHwnls9SmdHqr 3WrvGwThow2BK1d0G5D41cj99/3fMWC8eAw74aGc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A9858F805AB; Tue, 30 May 2023 02:50:28 +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 14F56F805AA; Tue, 30 May 2023 02:50:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C707DF80564; Tue, 30 May 2023 02:50:13 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20727.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::727]) (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 704DCF8055C for ; Tue, 30 May 2023 02:50:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 704DCF8055C 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=UVZ27NEv ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JbO3rTHKtFAJqQIiOKpU6PqW4o0GKgXrMT69eW6u/Qo2rQ9jztuyE1mD2VJW89fpWfOKTj4cNlKZ894kGiPXOCSTZ9omuXTFbrDWE3myBu8muWwE5IWm2Uzhm7k4mRfpC5HJ1LpDBN3RirOsLmy7LNBuRpTmheX6sPvR8A/KpDW/lRASQEqSbpJsn1gJLJw3vdW3+giOliVNEjNlwAasOaSbpGBOq1zSJ07/o2TwSEm/cFPHd4yudT/qUsvi4NZVyS7R4DXjtoZp+4vpMg2EKoEQFIte9IuuPv1vZqZWwTfOetR4a1clccqj5J92ggaG4EaE2Oxf+dmlD/bi5ZNnBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=URYLGPDTAxi+1oEIac+j4tw5WMwXWhid+7elBPBpCKA=; b=hPOZ7qqEWYQpVNSZTrtajIJfid3SqBGn8TlC4kzzxKUI2vr1AILIG4ET9qJBd2g0NtPpsOX7q7+wNm0CYZ0VEbkg9axv41yOWELKluJGQHZ4AENmDz0hvPIkRcdwPjyY3PpUNFigd+KkSsfsTkYIAVYduDYHZUgQpdEcJ47Llk3M9jPKLVSqcpqHXo7VNYfjcZNySHTsrEvf6iJTOdpiwPhF1TBpusz22gr1YUCJIQv6UHywU/zgLyXDUiWEnVcDYnXAwCyU1IuYoAOEwfjagCoUZP/uM8zgvk0Dpwa1JpshZ9ePe9u/tporUZ0E8oOPzJQOEFPVmQoh61pjKDjLZw== 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=URYLGPDTAxi+1oEIac+j4tw5WMwXWhid+7elBPBpCKA=; b=UVZ27NEvFHFJh+H5UY+n0Y7pFfp0JRxrAdK5OZ7/xydGlZ6/m7KIZo2s1FMTE3K9s0iTckFnbdpSj4owe5fj9rI1Kk2wbrXT2HYguyCpRF0fsgyRa4HXzIUuXRQO8g+dbQyGhFNBvGeCljpnxCdVPrj5yxgfE8ODu4GKy9RKEJs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS7PR01MB11502.jpnprd01.prod.outlook.com (2603:1096:604:243::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Tue, 30 May 2023 00:50:08 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840%7]) with mapi id 15.20.6433.022; Tue, 30 May 2023 00:50:08 +0000 Message-ID: <87sfbezlq8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 5/5] ASoC: soc-pcm.c: tidyup playback/capture_only at soc_get_playback_capture() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87zg5mzlrc.wl-kuninori.morimoto.gx@renesas.com> References: <87zg5mzlrc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 30 May 2023 00:50:08 +0000 X-ClientProxiedBy: TYCPR01CA0169.jpnprd01.prod.outlook.com (2603:1096:400:2b2::12) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS7PR01MB11502:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e26ed81-5b9c-4073-6622-08db60a7d0e0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0pnogVFUgUihx3w1SAffmMvfchwg7fpPPuS97wnxhruWtl9qHDHtfjs/GOvYrN3grac5v2rBoAvIp+vFp5nmLE5k9gMslUNISewthmrm4kA1Ag3x7emZmJg89Bv6r+4/7wiAlxDeQIokJBliPbT+SBUq+qXT0dDpqh+jMQmaYRfF3l0XBnvD8sHW2AMDQ8y+oMoQ/SFnuMT+Bm2qu7SLC4tfchxe9wuCjSnFa+znGCKrhkdZWaBCzxetxhxWi1HAV20AftbWJqRl31z725d7T0wxBN/Ewcest6ghevqREpx8cVbWvzv7QJoDHFZ6ijLIgwAoWPts2J/Q1dr+1NkJAEQVTlcaIjaGH1ww5YVnFb5xdZ/AtC2NAEpwOA8qOhZdXhUtJnW87kGt5M2TNisK3JOsSfpD6wNWad2XrNIK24Ru4F8wYBMg/p3rKcisEJNUA+G29LV+I7qnwYZT+42IjEotQE68MQtnnC2lcLYdQ88KYLy/oMecRQiMRHAURwJOixUwGYYwtIYR2xEChKxtc4rB8CrULJU87apTLywxI4dyZcsloNNMlKRTwTdlZDvjeO0zKVEjnvBEoD2F+5OMzjPlfOkginIsKSZex+IG9f7HMLmi1gmwpqJSeaZw0/ZE X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(376002)(366004)(346002)(39860400002)(396003)(136003)(451199021)(186003)(2616005)(38350700002)(38100700002)(41300700001)(83380400001)(6506007)(26005)(6512007)(6486002)(52116002)(478600001)(6916009)(4326008)(66476007)(66946007)(66556008)(316002)(5660300002)(8676002)(8936002)(2906002)(86362001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-2?q?QbD/0E97QUkkXo8ImAXTU1Z?= =?iso-8859-2?q?0T6Kxg2yhs1hdVjUoO1CEucehMmnkRJwuNCMW4J6LCQKabC5DlXKg2lihZQE?= =?iso-8859-2?q?wQTYkrH1P+LlWuQkIsmqtR6N/FHEzQdXwcENj2b0/gF+yUh9PbL1XQDaLVDd?= =?iso-8859-2?q?omRX+OAxLaBP0gaqnDtnHSfz7UrPIaiGLlGr5Lsojh+pWsUjgWx8/dusXZOc?= =?iso-8859-2?q?ufrdGvn5/eJm1ojGesSzW0DBkQh3rrL6ydaL4wuqk//3FuP2WSBNNL1CugAs?= =?iso-8859-2?q?QJ6i1znKIQG/tGisYbt3DMVJ08PApcURNFzrnZ96gNmqfwxHNfQY5P/i2izL?= =?iso-8859-2?q?YDFoQobZDAGyo4z/Rm3p+BASh3neMEmf+/ShHdLNQE+9585mDp3H0KF6q8VX?= =?iso-8859-2?q?t1WdxeHphFz4x7w9gl7iREhH3RxyGKTjfv9drNYFAizUMxewiSf854fPtUrc?= =?iso-8859-2?q?JTGJ2ETOUCwB6v1Sl6vYfTcHOg37pyxVPo1YJF3sPIeSNjZ6fQLkoWKUFjpt?= =?iso-8859-2?q?Ya3xfJLpQVpBJfUrCpmQTHWouNLEXmiHz2358F/bWW32gcrObe217k8XF1DS?= =?iso-8859-2?q?6sWMleYMr2aXY61ZBv4f9pzDiicvK6c9ZMyW2Ffz7wtlQqRcmCKeE1yYjqFQ?= =?iso-8859-2?q?Bfq+x9x8EmsQlMPT5NvjBH7jz+DpA1HgtACFyJnPkMl9hgjv76H/mqdRNkVV?= =?iso-8859-2?q?0ytuTvuZq7S7H+wmAmV8HQw8M5/s/MNp+/ITCffzWDPvMC4i7B+z1Ro47AIZ?= =?iso-8859-2?q?23ryOc0S6I2gij1vPM5l0x+GIn3ynySkz5XYIR+7qrI5OLB3An6qnO6xthT0?= =?iso-8859-2?q?aKQVF6J6kBeMsM22X3eNkTkOwhy3VzMFHlSnGqpu5AMdSxXiedVYvwiZbTZk?= =?iso-8859-2?q?BJOWzC7gIl4XPnrk4HShBchpupI0yw2C3JWi7G4ZDEmM5pNUeWXVue+eqrX5?= =?iso-8859-2?q?ky+rhmaUxe9Oz234mFgBnlfRZzi6LQ41gTHvcxDZx+wa1GlZJZ322wZk5DIs?= =?iso-8859-2?q?POXYNMg8VG7v4HtW0g8HVpFT6+UBkwvXo8XupP5k95vaTTfqmhIV8XV7Fon3?= =?iso-8859-2?q?qu+0MUXLR03t+u87D1hXi3DPi8xAytLk9hUw5hTNUhDT59xxWBNIV3dZhUvR?= =?iso-8859-2?q?jEz97JZVF9iBwZ7eDx3fEZFS6ReBvHTnk+DFeI6Gqo3AlXe7qBovo0yggzAy?= =?iso-8859-2?q?Zy5ad7ud8w9gMiquCXuzvLykpUmPy1p+hVoh9qP3Knjlkz5jlpozQvferqvA?= =?iso-8859-2?q?y+7r2bQpaHlNwbR5Uc8Qq6fJTTjEDJdfFB5D+RIvXpaNtDvo6Uz1zXNl1wZs?= =?iso-8859-2?q?taacDQrrkm57zm07RXM5W+a0HG1i/sfXov9Y1t0OUweiwOqIvz4OQn0GlGmK?= =?iso-8859-2?q?KRWBapPN5sN4Vp213u4gtpbHeu+f9KMX84fhxwnygZ4VoLGD3JTEnEfO2hux?= =?iso-8859-2?q?Xp66SYdjFF70P37BbOhY7jhKaXEMcDbhFnBRC14Sx+BSS9oSeaa8KjnPHDvR?= =?iso-8859-2?q?O93QkCkdkWAT56qpZsIwObN1lBInylDxwpK+OCwnFjasSxugLf/KSqM2/phc?= =?iso-8859-2?q?bSvCVsS+W+WMHuW/jzjXEHS4WWEExw4yrFUnQ5gT9be/TOhUxBGc5UphjwHq?= =?iso-8859-2?q?m9X7ZRc3IdJJykkiyR40MqPMCc081QT73lmkRcUGfu+jhOlQRiXxB/zRLcus?= =?iso-8859-2?q?=3D?= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e26ed81-5b9c-4073-6622-08db60a7d0e0 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 00:50:08.4357 (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: ykkZgKzFS5DV43C7AWSlXKd9iax8UIjxL/RpFa4C28WGqNMDFNg9WKMCcW5svjtdgsLG508ANDRsTkkP00kcmvLwEpCAS7otj0Q2bA4JGMRVgUWQC1xqbj5KEZAz673J X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7PR01MB11502 Message-ID-Hash: FA566JKZIF3H2GQPXSFFSYMBFVDIPXBA X-Message-ID-Hash: FA566JKZIF3H2GQPXSFFSYMBFVDIPXBA 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.8 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: soc_get_playback_capture() (A) returns number of substreams for playback/capture, and then, we can use playback/capture_only flag (X)(Y). (A) static int soc_get_playback_capture(...) { ... (X) if (dai_link->playback_only) { (*) *playback = 1; *capture = 0; } (Y) if (dai_link->capture_only) { *playback = 0; (*) *capture = 1; } ... } But this flag should not have effect to opposite side stream (*). This patch tidyup it. Signed-off-by: Kuninori Morimoto Reviewed-by: Amadeusz Sławiński --- sound/soc/soc-pcm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index b3d569e7ba61..159670612de3 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2807,15 +2807,11 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, } } - if (dai_link->playback_only) { - has_playback = 1; + if (dai_link->playback_only) has_capture = 0; - } - if (dai_link->capture_only) { + if (dai_link->capture_only) has_playback = 0; - has_capture = 1; - } if (!has_playback && !has_capture) { dev_err(rtd->dev, "substream %s has no playback, no capture\n",