From patchwork Tue Oct 8 05:20:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?KO2VmeyDnSkg7J6l7J246recICjsu7Ttk6jthLDqs7XtlZnqs7wp?= X-Patchwork-Id: 13825645 Received: from SE2P216CU007.outbound.protection.outlook.com (mail-koreacentralazon11021075.outbound.protection.outlook.com [40.107.42.75]) (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 AD4811DA5F; Tue, 8 Oct 2024 05:20:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.42.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728364836; cv=fail; b=kES75Favg91E00JEBZ3ZshCQOmsfi4KryoltCVw+dUjMvGVswwGfx+oicCLhvuA9LfpmCS+4y87XdV0g5S7+MrDgHppIzvc5bGt1sP7CK8GyonAbxjVpba0+LW2WWpyEvBzg1Wd/tyYTD3F7vfvcgEzISpUHoeCC2LQ9CZOJRBM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728364836; c=relaxed/simple; bh=+wW+gq4ebro47WCLbSRYU0yTWakq0pw4JUzJ0M5u4wI=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=PousQYAhLMwc/DZzduVK4sdqOwas11xotGwuwbPMfIPKu4/HE7LKMpbdwQ7EArnfs3XzDwR0Pd3XtNfoFatw/a80YvYrE4rQaGeMImKdICA/gfzQas83/dTcGMu+V/Z7xwTMLnLp3OxYDuPELOudaGgQ7KwRp4TTsuEPLxZJlZY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=unist.ac.kr; spf=pass smtp.mailfrom=unist.ac.kr; dkim=pass (1024-bit key) header.d=unist.ac.kr header.i=@unist.ac.kr header.b=IPcGI5/2; arc=fail smtp.client-ip=40.107.42.75 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=unist.ac.kr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unist.ac.kr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=unist.ac.kr header.i=@unist.ac.kr header.b="IPcGI5/2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gnvQPcE7XGt8NROFhwhhQn7zkATciAKfr5oZQ7KevgJoHSFQTxKYYKaHNeYony1czGDgA7i3V3yORz8FBNy6A8JyCEh6knyzHMkHXmOVE63QGQWXc/Hq6oNUARo0ypOeEOwovHYj7nU6TuBYQ3KIhdAMJLXoF0LjQebTQ4OgbxbaKsfljYF8qgWffmka9UTsQ00MbSwvJUOEIutSB7So605PmzrJJZQgQv+Pbu/DYDMoOUHVt1+bTCzUfaSZruXuS774fv/uBa6DFwzD2jMAAOHFOfLCdIFRBocUFBSlnufgugj2xYrfd2urpFMs/WyyoXUNnmKuyeXoei36yI+hog== 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=+wW+gq4ebro47WCLbSRYU0yTWakq0pw4JUzJ0M5u4wI=; b=ptflh1FFvR0gaA2qgSyDcZQ4MkK/ylny9YAChJHcU4hhie75pFK607b2n0pNeNnknS9lB5AbeXa461anxJPLx+FdqukZe1z2x4arezPtsnqYVq0AXNR+3NW2Z8k2SNdEt9b5Te6c5++xVT206AEqOi6HP2LAkV1KxlQyIFaoksNjyoNTZ8f4AY5MNHY+5YTeCpPY/j8jYRFjhsr4yvpfllWjSbGgzNrytYSTy1sDFC8TuFIcH2im2TUBL0odG3XHQKWWkPG/h38+u30ITAKFPzUyVY2J9sMYZQsk5ra2M3u8S6l3gz7aYQUDX8nrokt0IgYtgYHphEdpFTm0e4htpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=unist.ac.kr; dmarc=pass action=none header.from=unist.ac.kr; dkim=pass header.d=unist.ac.kr; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unist.ac.kr; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+wW+gq4ebro47WCLbSRYU0yTWakq0pw4JUzJ0M5u4wI=; b=IPcGI5/2p41KBoJ4S5GfP3PkpImNrd5o7Z79JeaMihD26ZzcbUinFXyZ+EiOwY7KJYCOfSPo5K/pLZH+nZCVwU4Xx7ijldaMY2Dw7Ddrz/UimZKlxnhOgsfxougTzZ69MX3Uwgy9vZvZgoo50pHbBIL2bshLIK8mxEFsnNGFcVA= Received: from SE1P216MB2287.KORP216.PROD.OUTLOOK.COM (2603:1096:101:15d::5) by SEWP216MB3074.KORP216.PROD.OUTLOOK.COM (2603:1096:101:297::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Tue, 8 Oct 2024 05:20:30 +0000 Received: from SE1P216MB2287.KORP216.PROD.OUTLOOK.COM ([fe80::abfa:51df:7a24:2f06]) by SE1P216MB2287.KORP216.PROD.OUTLOOK.COM ([fe80::abfa:51df:7a24:2f06%5]) with mapi id 15.20.8026.020; Tue, 8 Oct 2024 05:20:30 +0000 From: =?ks_c_5601-1987?b?KMfQu/0pIMDlwM6x1CAoxMTHu8XNsPjH0LD6KQ==?= To: "perex@perex.cz" , "tiwai@suse.com" , "hayashi.kunihiko@socionext.com" , "mhiramat@kernel.org" CC: "lgirdwood@gmail.com" , "broonie@kernel.org" , "linux-sound@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] ASoc: uniphier: Handle regmap_write errors in aio_iecout_set_enable() Thread-Topic: [PATCH] ASoc: uniphier: Handle regmap_write errors in aio_iecout_set_enable() Thread-Index: AdsZQbQXQbGLNJdMTXOtViVq1iaTHQ== Date: Tue, 8 Oct 2024 05:20:30 +0000 Message-ID: Accept-Language: ko-KR, en-US Content-Language: ko-KR X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=unist.ac.kr; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SE1P216MB2287:EE_|SEWP216MB3074:EE_ x-ms-office365-filtering-correlation-id: 70bf8c1d-31fc-433c-6fe2-08dce758ed58 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|366016|41320700013|1800799024|38070700018; x-microsoft-antispam-message-info: =?ks_c_5601-1987?q?EaoOJNo2UYB2BuPmbhiIJ5?= =?ks_c_5601-1987?q?sKCGCGD8zQSklxYUwvZng/r136bL5Jq8Rq9IICRJm7hyE7xM1/6ATgOK?= =?ks_c_5601-1987?q?hS+VvMsv2uG3KiYJIFHTj5HYAtVeE90qU7bIR6Ns3oKL5JGYDQojn1p6?= =?ks_c_5601-1987?q?2Wg6VyFXiCKV5MpuB5Gz6j1GHYpisOperUaNuPKlIyygWqpabWPnnQ54?= =?ks_c_5601-1987?q?AC1oXzbnJd4umSy3bdY++2jfnuLsKTLRdaMXHCbAXottP7SqkkhZW6SG?= =?ks_c_5601-1987?q?1/gsnLs3+PEi/YAHelBvyMNhs3y8In8j038S5dO72ibgXlh+KJiuRuc1?= =?ks_c_5601-1987?q?X4aicqqljPoz6pKAvQGn7yZhkNZciyX9lM5roAcG+z2E77kBbAsIXxz1?= =?ks_c_5601-1987?q?yBOgeiQhX01ccRBk3jo6Dy8KvcF9JmG26ZcyAH8yZiVLdkc1K/7EPop4?= =?ks_c_5601-1987?q?dTgjDuGMzuVzLd3cpB1Vy1b2zdZZixPSNHKgdPXZYEc8MrXYiSP8QGbE?= =?ks_c_5601-1987?q?OOPykpHDvt+4VwiCVrEVOQmlq5nByWTvxtEhwdn0+WIfiKmxnvKYCISp?= =?ks_c_5601-1987?q?im+7k0Hzi6s6BolpMZalMSeiSwHhoAG2gHCbr6/ILi9K79KtLl7FCsQ7?= =?ks_c_5601-1987?q?ohKGK5hC7PhS+X0EeLWtgoGBaKc07LP9GaM4exGohM8vbAi6G1XUXCHA?= =?ks_c_5601-1987?q?+ARMdpyjMxR7aa7FnQTDRlJsB8+CRGLpCODXq+djNJli0+wnODUUVWzT?= =?ks_c_5601-1987?q?xx04YOlENqrslNWqOC4RRZCnleKr7qRT3xvWWUbbUMExkud8LPqIX6k1?= =?ks_c_5601-1987?q?tcGKbRSerhRMMlXXEhaDQGbAekHFttaWbP6HiZDASGwqPEtGXZYRMl7v?= =?ks_c_5601-1987?q?lekObbtQwcuuLkfPQJKbGQx7db0tCo5i2/fixJpuf4B8tU6jG2Korhxb?= =?ks_c_5601-1987?q?IiFodx+9atlpZ0yuNNxRtJETNLodd1LnhoHkh8NnnRncNZBJXJCk4NUv?= =?ks_c_5601-1987?q?cKDimMMXBJ0KGg+W3wh0SoNyJwWsBpY23j2KzBfhtMKV7+S7eaEFip5Z?= =?ks_c_5601-1987?q?Y6NGYUMqG4B4ynW+xDc+nJ9wqU+af/Ixh4WTWt8lfGiH3RlUMO29Jsv4?= =?ks_c_5601-1987?q?FJOfvAYN1wDmipSeHU406gRpe5tAK2lyu8xwpSEfYTgWIVlSCJ5xIpW9?= =?ks_c_5601-1987?q?pXhBbW7ndpIzfPDoctbNJAmir6jXu8lhb+eKn9XM4Fr9E96r3NCt29zc?= =?ks_c_5601-1987?q?KoH4Ubzti/CZtYTCTdbnEUJaoYzc85Jg44PSal512uvSGRuvv/pavyep?= =?ks_c_5601-1987?q?fRvCrSb4jqOCpwCUb3TqAkjfPhTbeynHXc2J07ImNEpCzPBtKaR1jytU?= =?ks_c_5601-1987?q?qUYKv1uXb7kY8ZX2QPsDWAkG1gevp+vJ/lWw4hvpKFLrP6XFIBb3BdWr?= =?ks_c_5601-1987?q?GP3BRIH0jYTxB2vL4vS9WGd6+Bpp4RUWfDlkkk9G+VybZt8K+SV7mqiQ?= =?ks_c_5601-1987?q?=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:ko;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SE1P216MB2287.KORP216.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(41320700013)(1800799024)(38070700018);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?ks_c_5601-1987?q?xUddLbLpRmzLg7ZAICF?= =?ks_c_5601-1987?q?yd3cSM8ukej/6tBZyvGsRxmXYLUMeJNDR2RAusT4U48KY8che4fTAaqo?= =?ks_c_5601-1987?q?7hvrAExkfUSRk/ETYkfLY/pg1SzcRHFgs5w3cUXoud08xPXXkMJm+Mj1?= =?ks_c_5601-1987?q?5aaCY25pHvIIiBwF9jwR6s1IPFntNuA288KofxNcoLIieCS8WlznBh6N?= =?ks_c_5601-1987?q?n6EI+iWBYEfN70+hFRnQN9EU1VWruNaUafq1hQWcPjmjnXemiHYehRIg?= =?ks_c_5601-1987?q?W/VpV6GSwRcjWo/LLn8LliTBD+cYNaG+RUTrWU7QODcA4vKY/7hvxi7m?= =?ks_c_5601-1987?q?/bJW6bJqfUlOjldRCaI0DgfIj/oOqzzmUpKwr14H+alL96jpWp/PJ+gW?= =?ks_c_5601-1987?q?FY7vcJmD6VaIKhjaPGnpTbX/7jbQV/jKQk6BAL37yLNEbaPkkG+pOm0J?= =?ks_c_5601-1987?q?k8nYd0ntwkQKQ+qZpOsKFVg4SKQ8ndFrQjjQ7Ui4iUwH3t3E2jxe7gen?= =?ks_c_5601-1987?q?W7NtfbMQK71NYozhMeMeAmtoq8Ja7srHTBBer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-1987?q?1Vzlkx6VykDMHKhpH/sutAooVtUXjeRulTdRlCoQUNaJ2YpqPA7jtVT+?= =?ks_c_5601-1987?q?6DfQYrXPGOIVcE4OalhECO/SH70OM01zMVJJreGlFcdL8TBGg1Kd+lpu?= =?ks_c_5601-1987?q?r48gDuvJUjXR1TIP5d7KsaVl00y6w97KBFxJ0OStAwbk54Sg5oqYxLVD?= =?ks_c_5601-1987?q?BKBV15dPW+5BO7uTaBbgdE9uZjP6RD08+KTDxCMJei/mC3SmDQUL+/MG?= =?ks_c_5601-1987?q?NqO0fWmCbdk0/ZZ3i4V1+mLdNooh4Xys6eSyDqVTvDOoPjCkT/80CE/q?= =?ks_c_5601-1987?q?POmly2vdY+H20?= Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: unist.ac.kr X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SE1P216MB2287.KORP216.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 70bf8c1d-31fc-433c-6fe2-08dce758ed58 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2024 05:20:30.4706 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: e8715ec0-6179-432a-a864-54ea4008adc2 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: YlLJKIg/o1rjEWMNNS5gqQiF7Wi1i71g4dr1D/g7vq/LeBudGMGkx1p5PRWdUSRTt52INevQNcsTmKtDweiiJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEWP216MB3074 From ae50796beac447467e6ecfa09bf40ac02b914e40 Mon Sep 17 00:00:00 2001 From: Ingyu Jang Date: Tue, 8 Oct 2024 14:11:11 +0900 Subject: [PATCH] ASoc: uniphier: Handle regmap_write errors in aio_iecout_set_enable() The aio_oport_set_stream_type() function did not previously check the return values of regmap_write(). If these functions fail, it could lead to silent failures when configuring the audio playback port, causing improper behavior in audio stream output via S/PDIF without any indication of an error. This patch modifies aio_oport_set_stream_type() to check the return values of regmap_write(). If regmap_write() fails, the error code is propagated back to the caller to ensure proper error handling. Signed-off-by: Ingyu Jang --- sound/soc/uniphier/aio-core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sound/soc/uniphier/aio-core.c b/sound/soc/uniphier/aio-core.c index 0eba60758134..d334a5a08271 100644 --- a/sound/soc/uniphier/aio-core.c +++ b/sound/soc/uniphier/aio-core.c @@ -838,6 +838,7 @@ int aio_oport_set_stream_type(struct uniphier_aio_sub *sub, { struct regmap *r = sub->aio->chip->regmap; u32 repet = 0, pause = OPORTMXPAUDAT_PAUSEPC_CMN; + int ret; switch (pc) { case IEC61937_PC_AC3: @@ -880,8 +881,13 @@ int aio_oport_set_stream_type(struct uniphier_aio_sub *sub, break; } - regmap_write(r, OPORTMXREPET(sub->swm->oport.map), repet); - regmap_write(r, OPORTMXPAUDAT(sub->swm->oport.map), pause); + ret = regmap_write(r, OPORTMXREPET(sub->swm->oport.map), repet); + if (ret) + return ret; + + ret = regmap_write(r, OPORTMXPAUDAT(sub->swm->oport.map), pause); + if (ret) + return ret; return 0; }