From patchwork Wed Mar 15 15:06:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13176085 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D55D1C61DA4 for ; Wed, 15 Mar 2023 15:14:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mGIeZpAuac1sqQS/lY43vdBtxXFv18Izxal1ZxMTLaA=; b=hHwyOssuo4F0WkYPbAfCmAjefn uXbW07RHw6DlQGD/kiUn+LdxzaRpvxEqxSzOy2drLRdiiJO//xwIbPTqP+C7NcwbDBeL/Nns5K+5H H0ZM4ZI54T9tYzxfJcY/i1fgs5+Y64m3gYDEuy1Zq0dhQ61CltIq3hJxijDjdjw1B4q92dQnQhSig W4tynb7ByuvvQJhFDMPredFDGla2gUSrr8RmMYmjoNOsHFPG6nFO+G40adooXhXSVwOC+dZeAgyKA l3ukBcqTGLBolPIGb3dmhAtQNoWculexAktxZAASulMpfkhNMabGSM1HJ4gui+VZfNG+GXcx6CPh8 izOSeFbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcSq2-00Dp64-0v; Wed, 15 Mar 2023 15:14:50 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSkU-00DkHQ-2M for linux-mediatek@bombadil.infradead.org; Wed, 15 Mar 2023 15:09:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=mGIeZpAuac1sqQS/lY43vdBtxXFv18Izxal1ZxMTLaA=; b=D7gdVFjkJp+I5y/MZmkmS/0upD npkGnGpfWTK2rmW07lSRjMh42hD6nJ8WBFQjRp4kb/GF9Sx8dYVe/2SFWZz6N2RY7knBmLOj1xeDU Fm0rzm4/e9DJaZ/QXP91F75Y/7X14e9ZxlY95Irs0XqMtnqrYVQqYL/Gf4IZFe06Z+JaiZEgBCAHD ioI6zGLkPZyQdNeUzOJBHkQI1+aH8JZFiWos1dkV7JBPHzyxvHz7149lMVZdm84WAoOuNV9fleBdA 2mK51kjicdCvyv4l1/1xmHVMsbtC/7kcphne9qSxWbUSFkw3dSQYJ4I+cTKP38LN+R4u+Q2iaQXDA Av4TMqpg==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSk3-0028ee-2Z for linux-mediatek@lists.infradead.org; Wed, 15 Mar 2023 15:09:05 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcSjo-0008N4-DX; Wed, 15 Mar 2023 16:08:24 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pcSjk-004Kbo-Ul; Wed, 15 Mar 2023 16:08:20 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pcSjk-0057id-2a; Wed, 15 Mar 2023 16:08:20 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , Jiasheng Jiang Cc: AngeloGioacchino Del Regno , alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 106/173] ASoC: mediatek: mtk-btcvsd: Convert to platform remove callback returning void Date: Wed, 15 Mar 2023 16:06:38 +0100 Message-Id: <20230315150745.67084-107-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> References: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1747; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ahl9KygTwblq68kPHzDYsCEqiARfMFVXvf8GAD2RDMg=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkEd5rdLn2/QrNzz4s3XIAZIoZBbbcn3NAB5SYf Pxf3yJ0MV2JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZBHeawAKCRDB/BR4rcrs CQ6pCACY1l5JzzFwlvblloFP5e2I/4MbxP1QaVkmoDqg50Sx0sgrREEZzRHuGZO5gqOp5zYXso+ aBrPJRmH4juyzHtrT0AVChmffwf13AJZz1eT6gVgKXYp4mTHpMUN4oArqDPrUirnnWXRAo/N6sN VZGND1DfZo+hoSyiqBLolJlCDrkeoj1k77bhj37X/zlzUTsgWwjoTRSiMRm5UJUG2MwAoH+/UMC G3BmOKbVl/clkIu/PhEcrxpJ9NoQ3MvfhMcbktr0/Tdienya0ezfbi8Hxk7C5iOKNYKWmNwBiG5 NK4l5T6mlT+JXFdiEBaqPfV40WsbzCHHvUMa0pvyfNnc0WpJ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230315_150903_576131_B1342FED X-CRM114-Status: GOOD ( 16.59 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/common/mtk-btcvsd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/mediatek/common/mtk-btcvsd.c b/sound/soc/mediatek/common/mtk-btcvsd.c index 1c28b41e4311..1ba0633e542f 100644 --- a/sound/soc/mediatek/common/mtk-btcvsd.c +++ b/sound/soc/mediatek/common/mtk-btcvsd.c @@ -1387,13 +1387,12 @@ static int mtk_btcvsd_snd_probe(struct platform_device *pdev) return ret; } -static int mtk_btcvsd_snd_remove(struct platform_device *pdev) +static void mtk_btcvsd_snd_remove(struct platform_device *pdev) { struct mtk_btcvsd_snd *btcvsd = dev_get_drvdata(&pdev->dev); iounmap(btcvsd->bt_pkv_base); iounmap(btcvsd->bt_sram_bank2_base); - return 0; } static const struct of_device_id mtk_btcvsd_snd_dt_match[] = { @@ -1408,7 +1407,7 @@ static struct platform_driver mtk_btcvsd_snd_driver = { .of_match_table = mtk_btcvsd_snd_dt_match, }, .probe = mtk_btcvsd_snd_probe, - .remove = mtk_btcvsd_snd_remove, + .remove_new = mtk_btcvsd_snd_remove, }; module_platform_driver(mtk_btcvsd_snd_driver); From patchwork Wed Mar 15 15:06:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13176026 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 80C18C6FD1D for ; Wed, 15 Mar 2023 15:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nJa7tQETX/89P8Y45rgB6tafI8F10YMOIdR9tUUpwY8=; b=Nel4bx6+uCLWks0DnapV7eT0dy RUDtD5n+WB+DQvtFi48DMxQR47StArcTigumqSObtMoFDUq7CGypNHqZwR2KV3lZJhug0bec2+rQn ojYWTmIokRWI3fopgpkrLj/YUfPSadyVoT2pxyhn7gJ7ekMoyNfZhlTQle6Y7n72z5UG7bIB54GpH PXLJwkTIef31UaX509OVUQsdxZ9v6SycsOBHiAz8FLGg9ThxJ5h2Ifpi+KSHhkrQIRo4C3N2pNWYD qgKj+rn8cjR5HMpiHV3TT/NeJIWw6R5AOSRBWPp43QNTrrWZJ/zKliX9njqWbVnygMId7/zmdDQJD mTZq+MOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcSlK-00DkwT-2e; Wed, 15 Mar 2023 15:09:58 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSk6-00Djze-22 for linux-mediatek@bombadil.infradead.org; Wed, 15 Mar 2023 15:08:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=nJa7tQETX/89P8Y45rgB6tafI8F10YMOIdR9tUUpwY8=; b=Rasjzy88JKs08JjxaT2L6KeIug UoaDvyp/Tx/xKX9p/2JSF0gsl9x3jvJdYmXZNznq9R8sgvpl/zBVXgsnxxaEPRE/b+SNb8SxwLU7n oQv6dRkyyBX8cL/Dyd8a6+YkhDbH/+69l2z4BLrC+hf4uewmksz60M44MjG/aJWfLsUpeHP2dY+SI Yh5JzTfTMT2ZonvyhYCPDKvkYUGTYV17S9PTaRTc8+Ee55Otk+i5i3ieHyL86tpPOd9QxlfdBxNhC 8Mc1T0MElH34zbosT/LtjtfafdmXJR0wE3C1gSEpA/svVFK0viG/B6gZoilXLQN97sW8difAthFHi iokaqpEQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSk0-0028cy-0y for linux-mediatek@lists.infradead.org; Wed, 15 Mar 2023 15:08:41 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcSjp-0008RI-Vr; Wed, 15 Mar 2023 16:08:26 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pcSjm-004Kc5-5w; Wed, 15 Mar 2023 16:08:22 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pcSjk-0057ih-9n; Wed, 15 Mar 2023 16:08:20 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger Cc: AngeloGioacchino Del Regno , alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 107/173] ASoC: mediatek: mt2701-afe-pcm: Convert to platform remove callback returning void Date: Wed, 15 Mar 2023 16:06:39 +0100 Message-Id: <20230315150745.67084-108-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> References: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1800; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=koWfqNykvz7tdkgZlN4qWKDgHoQvfRsTgvMjWDwhmWo=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkEd5ucK4eJxav+CKwEsT01ChAzCaqlzIv8d6dH VVRe7CFjDaJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZBHebgAKCRDB/BR4rcrs CbZgB/9IiPRZCQsk2TcCq8DpBsxbaKQzOJPMb6WfwGKP8e0UNyi6D0TcOWODUdHan56YY07E6Jf WRXUEJR2VvMvmX03OsBOOP/O1YNl0dm6Cnl9YZisPAb89yBxPncJoypGeiK8Ov0Jmea3+ylSBpy SO9AfgDQnkCfot1KYwYFwBV9DOrid9PcYhZsCrDnfa0jV7w3q+wXTcPAs6N6wHc5R+y7phFwPed Sf/s0WmaqN8gcTF0eVHC1IL8S4WpcHiTJcasvbNvFhG9iC6+sOI5IoHII6m8MTf8mA5FWdHQd9t EhBw6LplS8ZgwS7iEaxsI1hp/4eZELOXh9JP2XREj9qavttQ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230315_150837_727520_C5BD6DC9 X-CRM114-Status: GOOD ( 15.90 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c index 0f178de92a0f..c9d4420e9b4c 100644 --- a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c +++ b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c @@ -1439,14 +1439,12 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev) return ret; } -static int mt2701_afe_pcm_dev_remove(struct platform_device *pdev) +static void mt2701_afe_pcm_dev_remove(struct platform_device *pdev) { pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) mt2701_afe_runtime_suspend(&pdev->dev); - - return 0; } static const struct mt2701_soc_variants mt2701_soc_v1 = { @@ -1477,7 +1475,7 @@ static struct platform_driver mt2701_afe_pcm_driver = { .pm = &mt2701_afe_pm_ops, }, .probe = mt2701_afe_pcm_dev_probe, - .remove = mt2701_afe_pcm_dev_remove, + .remove_new = mt2701_afe_pcm_dev_remove, }; module_platform_driver(mt2701_afe_pcm_driver); From patchwork Wed Mar 15 15:06:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13176024 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 6F177C61DA4 for ; Wed, 15 Mar 2023 15:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pf1f6/tO0mNLKEokYZiZwhqjX9xURtp89z59r8RvStI=; b=z/r8pRvdrovQ+4CsM0Ybm34ARL vRC4hQlVy/RPs0Jk64CJID7wo8Bx/wY8LWf1mdjf2LYxCISKAuYOD6IF/j2A5vOmJ82OaQS4eousz A/cYFsv0iJiI/35suDiDR330C8J2X/NIBZnIxhbyTLgfN/6VR2NYhKjUjKiYZjqWxTfnN0zknvjb7 knN5PsQ33yqoXthXA0wEGscJ/6Tn5drCGYogAjqeiPCly5LY2nNf1+Ugm4HK0/8kt7lhQyCeGJApH zqBJ3Eyg7ZhfDrFoOOK3e7XaatsNK64Vqo8ti/+LjfiDD6P62w9B5qmUH95iw7AG9FDDQ5J3m+J8Y PW4U6Arw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcSkr-00DkYq-1w; Wed, 15 Mar 2023 15:09:29 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSk3-00DjxR-05 for linux-mediatek@bombadil.infradead.org; Wed, 15 Mar 2023 15:08:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=pf1f6/tO0mNLKEokYZiZwhqjX9xURtp89z59r8RvStI=; b=l9h4jT2v8UgdJ8aPVhMmlU2m6M /rgPAUV4ZQnmej1ZU52mGESc/HKkIpkCk8J0iquwayBJDyda+irRonU1iuSnsZ+JZgzdfUuyWQ3eU HjnGiZwTgT8+rgXqScAPCG9VnaIUOtlQXvacTRBXQd3Lf2qGtkr27fruVdOH6ZP1aMWuQhr+YIuMs ASpLXFyD/UOU2IWu6ssfpNqIT1nIBL8jONMuUJ19rNyr/fv+EFfz2VASgV0t4pRUWBnMBD1kqH/Um Nl9olzxnnLqkrVI3e0xc3oEyEtF5+Bdy2TeqM6ng2WCHTkTO6WShJNul8fobiAUc7aJyKO2+enbK2 X3zVfu0g==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSjy-0028cC-37 for linux-mediatek@lists.infradead.org; Wed, 15 Mar 2023 15:08:37 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcSjo-0008OO-PE; Wed, 15 Mar 2023 16:08:24 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pcSjl-004Kbs-8F; Wed, 15 Mar 2023 16:08:21 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pcSjk-0057im-Iq; Wed, 15 Mar 2023 16:08:20 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger Cc: AngeloGioacchino Del Regno , alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 108/173] ASoC: mediatek: mt6797-afe-pcm: Convert to platform remove callback returning void Date: Wed, 15 Mar 2023 16:06:40 +0100 Message-Id: <20230315150745.67084-109-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> References: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1801; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=CcBYQ5pQ+b1R38q6a0nA+xt8V3GqdSrNzwGaMGzN1GQ=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkEd5yAeixOHswBtO0H+V7OyHXBqnKrU/grjWsv qkVDwGnJQuJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZBHecgAKCRDB/BR4rcrs CcBVCAChU0f86GTKfll67nh1XsJDDBemWChBAlE0j+6eUqdTFDFKJwHznlAYmaD0vc7ERrmfhej o+86jOK2Cj5lmaAgxprFRLYZfrkm/LLlZ6xbuKL0+ssgtVJbKpFSMV4vq5fM1JJiYWdmhoCA9Th GejMxo+Lfm0lPHhwG4PdgwUUUJHW1Bb0/pfRq0vTO+hTZyj0IYUPlNRHSCi+jaM5kDzPdxQAuZx MbVW3IBP6jmcMdZkZHDZzbKyxNgJ8J4uFZWNNI3kA1nXQCKYSFWFqiDuLfLgDff3p851LKWduyL xly2Hz0+oAYj14BkhbM3uSG1b5U3RoyhyJmFVKM8nrvMv3a9 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230315_150835_079687_E379D14B X-CRM114-Status: GOOD ( 16.01 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt6797/mt6797-afe-pcm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/mediatek/mt6797/mt6797-afe-pcm.c b/sound/soc/mediatek/mt6797/mt6797-afe-pcm.c index fb4abec9aa5f..43038444c43d 100644 --- a/sound/soc/mediatek/mt6797/mt6797-afe-pcm.c +++ b/sound/soc/mediatek/mt6797/mt6797-afe-pcm.c @@ -876,14 +876,12 @@ static int mt6797_afe_pcm_dev_probe(struct platform_device *pdev) return ret; } -static int mt6797_afe_pcm_dev_remove(struct platform_device *pdev) +static void mt6797_afe_pcm_dev_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) mt6797_afe_runtime_suspend(&pdev->dev); pm_runtime_put_sync(&pdev->dev); - - return 0; } static const struct of_device_id mt6797_afe_pcm_dt_match[] = { @@ -904,7 +902,7 @@ static struct platform_driver mt6797_afe_pcm_driver = { .pm = &mt6797_afe_pm_ops, }, .probe = mt6797_afe_pcm_dev_probe, - .remove = mt6797_afe_pcm_dev_remove, + .remove_new = mt6797_afe_pcm_dev_remove, }; module_platform_driver(mt6797_afe_pcm_driver); From patchwork Wed Mar 15 15:06:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13176083 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 DC059C7618B for ; Wed, 15 Mar 2023 15:13:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Esw5hhTU9GDJR+OGAqlBKxrMHCIu3fhUtPy6sZjR8PU=; b=E9Deqxtw/tF/V+TIZnoQ+VjjFC jP//atprXeGMsjHGLjgGg/SMUPXqIZuGzFhXGiJcib768l9wSxYfOkMU63pcRe9KqHzPJPDDsX4+Y sg8mAi42+r/z8xbHsSENNJ2Kbv7HHcPpNnPwvfGSetRub7dFYIjfM7ICgXtupGY0Ffj6YRPi4TJn3 uqEkGBK3eD6YihwWrvraRmvgFCB/0vE/iXck2yPooxhjlNnhkyKw6q1nzJPmbN4MKZXpJQWHkH2Jj WPpMGtUYtLeZWxEb1Vh+1VhCZMkF+Rab+3qwufORWxK8aFgsdja5ebzBOCvk+TqnqM4bWe6AAU6Gb A/XkTB2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcSoq-00Dnvr-1A; Wed, 15 Mar 2023 15:13:36 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSkM-00DkAI-27 for linux-mediatek@bombadil.infradead.org; Wed, 15 Mar 2023 15:08:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=Esw5hhTU9GDJR+OGAqlBKxrMHCIu3fhUtPy6sZjR8PU=; b=YbWeyAH4k8U7MRTWuLFXWqXyry kwZ/4AVv0ZvHjwUy1Vtrs+hXLpaLqtqjTRe0NF8RyIvW7cyjS+PRRxSdvehwQA/u0Wydjo+j4xAtA pgYvJ5rVyPcIyEcPeauY+XwKpQ4AeuotNX56NcIWpnEKMCcLgykdBKcOEhoDQQG6MIJzCkLzbGLav b0eSyOPK0SnoaQk0D1nKkOaxQjYgELg1dvLxOveNvOZfX0LAfvfY26LOz70Tv19DjjFwEYo4sjYQU a8HZrhe/NqEVtjOLG8Q6bBhtr6JxOdNV0tQRgAnFhLJgWX9g6YVYGzu19l7x8D9m7ExkNoDJPv3or kukGfKsg==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pcSkC-00Dw1I-Dj for linux-mediatek@lists.infradead.org; Wed, 15 Mar 2023 15:08:57 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcSjq-0008Qn-1v; Wed, 15 Mar 2023 16:08:26 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pcSjl-004Kc1-Vu; Wed, 15 Mar 2023 16:08:21 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pcSjk-0057ir-Sk; Wed, 15 Mar 2023 16:08:20 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , Ricardo Ribalda , Minghao Chi Cc: AngeloGioacchino Del Regno , alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 109/173] ASoC: mediatek: mt8173-afe-pcm: Convert to platform remove callback returning void Date: Wed, 15 Mar 2023 16:06:41 +0100 Message-Id: <20230315150745.67084-110-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> References: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1813; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=WZRfua/0LMXioanbvKICWoWXRffy5HNp9GLEsVv6j1s=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkEd52X0tz+W+r4kAb1tBB28FBdgdferrxE0kwp dT98nc6twyJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZBHedgAKCRDB/BR4rcrs CdGPCACIWmH9Zm7gYX3u9Bay0G3aIjUKWFSjwi5RkDEeVKf4ltfEQTNqlFpDOSSs473x/ZiqyOH SHXqh0A6QO733cT95HhzVvSsiO9V1fAUk+rr8VHvPrw19TTKBzMuqY04Z6ZGLtRiMK7MeD5W1P8 9vcqD3sdtzf2lfpWsUanBb+MRNJ9pC0GR1FS7yfggAkrhHu7dkR5cBlT5yjhqjAVdRL+3o9FQ8S 9VexIb2cbPgF4oMLxO+GmP/+0AA+k2SvogDSm2D4AeTFxiYfHEvy9cRKFuzUO25iJIRb6lT2fvY iQhwvuWPtOnXAWu2pNN+ExRRke/ysd/3IZNz6sNkgHt+xAaI X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230315_150849_001614_DD50954E X-CRM114-Status: GOOD ( 12.19 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c index bc155dd937e0..f93c2ec8beb7 100644 --- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c +++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c @@ -1195,14 +1195,13 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev) return ret; } -static int mt8173_afe_pcm_dev_remove(struct platform_device *pdev) +static void mt8173_afe_pcm_dev_remove(struct platform_device *pdev) { snd_soc_unregister_component(&pdev->dev); pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) mt8173_afe_runtime_suspend(&pdev->dev); - return 0; } static const struct of_device_id mt8173_afe_pcm_dt_match[] = { @@ -1223,7 +1222,7 @@ static struct platform_driver mt8173_afe_pcm_driver = { .pm = &mt8173_afe_pm_ops, }, .probe = mt8173_afe_pcm_dev_probe, - .remove = mt8173_afe_pcm_dev_remove, + .remove_new = mt8173_afe_pcm_dev_remove, }; module_platform_driver(mt8173_afe_pcm_driver); From patchwork Wed Mar 15 15:06:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13176025 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E48B6C76195 for ; Wed, 15 Mar 2023 15:10:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cdBxrn4P2ciPFKvs44XmIuoaugwNVtJmk8UA34VSGd0=; b=N0NxuK6iTIznFmGstle6QzsiuU MbHOMofGmI7Rx3nJUyMCO7HwpKJ/9Fok6VDPnNKSPRLKAKdgPZ2/gUeHcIj49/jF0mD1EiHZk0YuS GfKLIYG3QmD0UP9mhxLQfBA7YAUmKZcI+UzMAOBzk7uP0J96dkZ+i818lFv4ySWzZJA94OOEkO3ZZ pWCGd33PYHqYAo1ZoNm6QO26vbPeQArZl8vi12uJkuJflVgkVYJUOX3I1ptSy6Npcd58CRqAkhb7h 3bYuNtPB4qOu6BZkECENmspRApivspt+LWE9t9/OIAEadyBUm+STiijUmmV4e6rCPhBDjFY7vDGwC oRRoSSgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcSlJ-00DkvH-0O; Wed, 15 Mar 2023 15:09:57 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSk5-00Djz3-1C for linux-mediatek@bombadil.infradead.org; Wed, 15 Mar 2023 15:08:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=cdBxrn4P2ciPFKvs44XmIuoaugwNVtJmk8UA34VSGd0=; b=NsLDkc/267wIBhFRc5O98erQrg OWjD63AbIOujUR/ZwUoMZnB11bJEQ1hhh9Et0g8jeAVXUALb/K3syQQ6rWvsPIFZd/nkCDlnwUt0F W3vJbe95TVtlgINxhnzS3xuiZEow8WSeyvmtD6A2cEu7wOLvy/8baa4yaxafzSVrr3CmPIaacsiMt 1Kn0P03kQlmIowplDR0xXLV3nUpEDaJHVz0QfDgdsn54ZUQ0Cm7lBeMQ3NkLLCgx7O1Ov04M1ugeY 1ts7Zdp+Te22oHRzROku4zb3Gphi+JFURRAHkE881kHYNDVgc+VcOeoAyAaulY78k+rP9mkmHCOn3 UVxbK/fQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSk0-0028d0-23 for linux-mediatek@lists.infradead.org; Wed, 15 Mar 2023 15:08:39 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcSjq-0008RT-3B; Wed, 15 Mar 2023 16:08:26 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pcSjm-004Kc6-75; Wed, 15 Mar 2023 16:08:22 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pcSjl-0057iv-37; Wed, 15 Mar 2023 16:08:21 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger Cc: AngeloGioacchino Del Regno , alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 110/173] ASoC: mediatek: mt8183-afe-pcm: Convert to platform remove callback returning void Date: Wed, 15 Mar 2023 16:06:42 +0100 Message-Id: <20230315150745.67084-111-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> References: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1769; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Vbc4xUnTL1Y0I7B/wT0bsowfdarYOTW4ugcUlyhtNZ0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkEd56cbEdE639c06BbjtIwKcsxlSF18v0KMOjU KcNVzNENRCJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZBHeegAKCRDB/BR4rcrs CdMfCACXO8H0LPcx1idndfScu9x9KvAjfBRlRKsCPhrXYUUjpgScQjOLz+GCNqQFuU3+fmLA2r7 /7u4opuAY4ecvMR7uPn+YV6Qywy3UZeYJuVJJsB/uoz+gCHtPX7gbF+AyGKy+WggPtb4LiBN4v4 LZ2F4zzyu6+Vq5hKNd/XFDE8T2LPHS04ot1qNFx7tmCpSzjeLfNfnqrMWISI2RAByyt4grAtt45 TpXXEFTmuudCbuFVrTGk231hw9Kip6LcapIFmfKlX0j5jwRA56sah0vySs57zcwc0M037mgRp9T 92lp6rk/SwLPOXM5g/7JZDOMNSMIribUc7HhDBLSlPj1k+wQ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230315_150837_720805_EAB52751 X-CRM114-Status: GOOD ( 16.01 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c index 86c8a523fe9e..90422ed2bbcc 100644 --- a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c +++ b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c @@ -1255,13 +1255,11 @@ static int mt8183_afe_pcm_dev_probe(struct platform_device *pdev) return ret; } -static int mt8183_afe_pcm_dev_remove(struct platform_device *pdev) +static void mt8183_afe_pcm_dev_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) mt8183_afe_runtime_suspend(&pdev->dev); - - return 0; } static const struct of_device_id mt8183_afe_pcm_dt_match[] = { @@ -1282,7 +1280,7 @@ static struct platform_driver mt8183_afe_pcm_driver = { .pm = &mt8183_afe_pm_ops, }, .probe = mt8183_afe_pcm_dev_probe, - .remove = mt8183_afe_pcm_dev_remove, + .remove_new = mt8183_afe_pcm_dev_remove, }; module_platform_driver(mt8183_afe_pcm_driver); From patchwork Wed Mar 15 15:06:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13176028 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 111BBC6FD1D for ; Wed, 15 Mar 2023 15:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ylSdmFuyCc+9KDOOxXXjE0UQFqteZdWuTwe2OKpGJD8=; b=llygj/B/xdYOjsbHYyLOviuF69 EQ3DIO5Zbq9ABniCunr0kkYb/eZI1TkJWDqcjE3hHOUMwCi8zRVvPUUachQXebVhGC1aJaIIJ2bld QREoNxWvoumJH43q1P5mXhGYZ5fG7faEbLAeTJlRtUkZRJkkT5WHSuDjPZmwJ0cbdem+SEL6iWSJQ yBfsoviSJb+CRMHtHX1BkYwBYS9H74Ode1KC/gGONVxsjWJbYXjLxyVObNN32Mx7iO9DH6G9PRgjc JLSPDeo7FTmt8aYo1i/ApvrCmNIWDPW/HfNltUhViSL6GpzHOTNqZgnIvwvaB3GDJlQmg8aRSwY2i ZfSiVHeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcSo3-00DnAv-2W; Wed, 15 Mar 2023 15:12:47 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSkI-00Dk6s-1L for linux-mediatek@bombadil.infradead.org; Wed, 15 Mar 2023 15:08:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=ylSdmFuyCc+9KDOOxXXjE0UQFqteZdWuTwe2OKpGJD8=; b=TA+0Z8Pn4MBhGW0BPh6LyLr4o0 WvLqlobmxSgWTP6AccbJB6cHnq9WQMCvE0cXZ7rC/bn+ur9vuVzxkvCyX8GFqRmLVNTYOEbW/9nuK 3pHAFjbqe77Crtm2Q64EKpQa+bmVTcBzT7H3nSn+vKYyKwTOjur6CzVHFgYrjRknAkawS1qs3F5MI yHIkdY75IraLQVw0LFbBSvI6vnU4tUtuDLqO6bb3D3p2x9m8Sm5gC27iv6wRCM5B87SJdm4vCU0XK l9lqEgJeBLjy8g2Sgk6/ruOcw8HhOvcCGDVEc2jX3VnxZ/QQDhgwAh3oR0v0wtZKEe0uETegDp/iI EgrHLhEQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pcSkC-00Dw1L-Fe for linux-mediatek@lists.infradead.org; Wed, 15 Mar 2023 15:08:52 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcSjq-0008SR-JL; Wed, 15 Mar 2023 16:08:26 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pcSjm-004KcI-Fz; Wed, 15 Mar 2023 16:08:22 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pcSjl-0057iy-AK; Wed, 15 Mar 2023 16:08:21 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , Trevor Wu , Dan Carpenter Cc: AngeloGioacchino Del Regno , alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 111/173] ASoC: mediatek: mt8188-afe-pcm: Convert to platform remove callback returning void Date: Wed, 15 Mar 2023 16:06:43 +0100 Message-Id: <20230315150745.67084-112-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> References: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1685; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rg/ZjAXLV7+w8zhdF1+AVjHUTlMZxTtIj2THNFeshK4=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkEd5/fru44LZHAAv4PCDovgzr8zNvOxmz7AIS9 c1cgADxPSKJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZBHefwAKCRDB/BR4rcrs CekrB/9BOlZfG9QLl7wV7Cu5kKBKyhpVi5qBSnjGYfECrdBABxkug2YMjP9qnOrR2Bmfp4hsL37 5aMQC+zS1yy673slw25+yuYa2EWew79TG+zzKhHWUGavxsJ0+c+5HMxAcGov/e6DqSxBd0AhBb8 ApOs09b6SsvVE+X002ZZBQS1fczVd2LLBdLJJmQp3jtHeiWPqhJAmIfON90yyaRomb1KQVHNH/O iNh0U79qwnDRCrj/eu3D4b08h2SeTEGvMdSgdsP0yxRtfgcS0mhT3hKJ1mnpjP/qIZ43pDtNiwa kfVSV9li0tdl1XipV9ztHWczAUvvIDTseXHKnY60O3bngPts X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230315_150849_051535_9773F9F5 X-CRM114-Status: GOOD ( 12.41 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno Acked-by: Trevor Wu --- sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c index e8e84de86542..e5f9373bed56 100644 --- a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c +++ b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c @@ -3323,11 +3323,9 @@ static int mt8188_afe_pcm_dev_probe(struct platform_device *pdev) return ret; } -static int mt8188_afe_pcm_dev_remove(struct platform_device *pdev) +static void mt8188_afe_pcm_dev_remove(struct platform_device *pdev) { snd_soc_unregister_component(&pdev->dev); - - return 0; } static const struct of_device_id mt8188_afe_pcm_dt_match[] = { @@ -3348,7 +3346,7 @@ static struct platform_driver mt8188_afe_pcm_driver = { .pm = &mt8188_afe_pm_ops, }, .probe = mt8188_afe_pcm_dev_probe, - .remove = mt8188_afe_pcm_dev_remove, + .remove_new = mt8188_afe_pcm_dev_remove, }; module_platform_driver(mt8188_afe_pcm_driver); From patchwork Wed Mar 15 15:06:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13176027 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 3F266C61DA4 for ; Wed, 15 Mar 2023 15:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0ypagvaTyxmSEqknsE7wboDoqjIAlpxphCb1cFmQ0m0=; b=i/Ij4CtY5auEXrHmRFaVWD1jn4 aFrEKytbqM7Llvc9kHUO46DT92vHQE3XqEaRv5cHDJSeSZctErUlyHdTJmI/SwI26Wqf25qEV9gXi T5Obb1amoi+R+k+/+Iwsp5uE8IclQ3ouYQxrcixYr9IOmjad5jPDdMPrSTtcLap9ks0xmWr/VpKH9 st6OuAqxc7uQ7wy29x+ghLO/nGsxftCDUjuYfc1kIv9AaIq2SzcdLQw6WtG9r9UN4SlqTQ15j4Vuh CBi3PeapG9WnePJaIbgqSwvW91Bft/HH7CxTtaXMaNqFUkkF2vP2Yzk9virJmI2WIxlOSKaznhTvw DLCa8ynA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcSn5-00DmP8-2b; Wed, 15 Mar 2023 15:11:47 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSkE-00Dk42-00 for linux-mediatek@bombadil.infradead.org; Wed, 15 Mar 2023 15:08:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=0ypagvaTyxmSEqknsE7wboDoqjIAlpxphCb1cFmQ0m0=; b=ccCE8G7XPb0+CFP49d+2DxDR6E Wp89d4D9Tsl48CXLIERabQAp3FiPk094DWLwSZW98Oryzsmo35Xy9FqOUUaq5sop6RQ6BmTAJ6ou6 3Rqtw4k7grEIw1Bdue8iGlgT25o6mmk9t+Q30MsORdGVKD+4JtygM62joYii1zVwjEjtVbpCFqBnR IKYrqS6AdjweCWC8EM0kFqD2ABjKClDK6uAFwLMP9iQ3f4GPRMp1J3ft25l7FuV7LeyJUS8s25vQc j8+8TSNmeDR/hFNODEVbcdSHfizvLE0HPub3bgYvtTvQWFQunN6sTPl70+D5Iwq7Ex7NgcCGK1KY6 BNRcp/yw==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSk1-0028d4-1D for linux-mediatek@lists.infradead.org; Wed, 15 Mar 2023 15:08:46 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcSjq-0008Rt-Ax; Wed, 15 Mar 2023 16:08:26 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pcSjm-004KcD-CL; Wed, 15 Mar 2023 16:08:22 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pcSjl-0057j2-Ha; Wed, 15 Mar 2023 16:08:21 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger Cc: AngeloGioacchino Del Regno , alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 112/173] ASoC: mediatek: mt8192-afe-pcm: Convert to platform remove callback returning void Date: Wed, 15 Mar 2023 16:06:44 +0100 Message-Id: <20230315150745.67084-113-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> References: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1850; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oy4WAcFg56RPxM4WdJAbkIaNY2s74SZyhCiy+bdWvBM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkEd6Cm8pswKLfMzxnzK+YKyJGFeJFqLJyx/NjW hDX4C58WXSJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZBHeggAKCRDB/BR4rcrs CWg4B/9BjBTomz49FUtXlQUBveDcQ04GYri71P24yDuc+2naiaNLblmOFsPC/Vuiz3rQxDHTPt8 95WZRIVjAfudPk652joJo9clCuaA6T1beDGqocTG5/zs/BqAkpfYvqiiEj6ERwmpSSftRv8k0NR sQZ+ZxzsTs/0QP9Mh+hcKAe2r06ShkxwMHIMfRfxLh4cOHdnljqMQEHe7739DqleBaKm3eKRVU6 ULgV5cpgHe91YVUnzKGFwpIQzolTeZyX8kDrZZUk0C8joTPX4DYy+wzP6027wZ+qRykBCG34Gen O7vCXPJkjE5yU3dmuFYt1q6gOyyQOFkViIEDw3W22k2gSu8c X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230315_150844_548972_5FBEE0C1 X-CRM114-Status: GOOD ( 16.32 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c index e1e4ca931551..adff3d667267 100644 --- a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c +++ b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c @@ -2353,7 +2353,7 @@ static int mt8192_afe_pcm_dev_probe(struct platform_device *pdev) return ret; } -static int mt8192_afe_pcm_dev_remove(struct platform_device *pdev) +static void mt8192_afe_pcm_dev_remove(struct platform_device *pdev) { struct mtk_base_afe *afe = platform_get_drvdata(pdev); @@ -2363,7 +2363,6 @@ static int mt8192_afe_pcm_dev_remove(struct platform_device *pdev) /* disable afe clock */ mt8192_afe_disable_clock(afe); - return 0; } static const struct of_device_id mt8192_afe_pcm_dt_match[] = { @@ -2384,7 +2383,7 @@ static struct platform_driver mt8192_afe_pcm_driver = { .pm = &mt8192_afe_pm_ops, }, .probe = mt8192_afe_pcm_dev_probe, - .remove = mt8192_afe_pcm_dev_remove, + .remove_new = mt8192_afe_pcm_dev_remove, }; module_platform_driver(mt8192_afe_pcm_driver); From patchwork Wed Mar 15 15:06:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13176084 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 655FBC7618B for ; Wed, 15 Mar 2023 15:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RK7MYjHCpmf5gCNBsNMMEU85AwiavIw9SVthyTMh9O8=; b=HSJVIRQPzUWnixSDdCFn4gW5eM K7BtABBiKkFzz2mC1BIbtIMzmPdq8Ae3oXtyNBRzYPmwJAdmZcxvLPJt5i4NLIplQu907ycSs20US 3CO7dpmGbW9Rd04xWLX93DObT4eUGf4xXOHTaEimv5WFruYvIYkSzgZDTd+zLfYoDpnOCBMtO6shJ mcBTGhzpJx2olnaRJKP6iJSmvUF1DTaD2F5FOI0dPVlFbnK3qkqEQ6LVVg9usR0sR2HBu71r5DXeI QHO5bZeRpNKPjfHSOmD43aOasmlpVluDDvjnU+tdS0heJ04OPSk6c8W59/deJHItpM1s1ZtOVK/jY 3gn5LK+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcSq0-00Dp47-33; Wed, 15 Mar 2023 15:14:48 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSkS-00DkFy-2O for linux-mediatek@bombadil.infradead.org; Wed, 15 Mar 2023 15:09:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=RK7MYjHCpmf5gCNBsNMMEU85AwiavIw9SVthyTMh9O8=; b=C6LYA5NnuwjExocnGAkpM/vaEL 6JaZJXxhHWDSsx8f5OYgpJyYOEGu1WbJHGoUBG4350SUEhX9G5juh3AxJT11kgpMhPVII/jsGt5Cd PPC5iCsv0K1dValqsTtUv8lkQc0H8CvTlM6jPE24DJWTSKqe8dmuk02+HjO9VCSckRF0P4YbSfIt6 YrEYqaGLIRNlwR0F7QuINEALRyvssdfknKlO1zSV730+f/z9kqMk7tLjvkW8TGORvDiArdun9F6NW dqKEXoxUih5ROmSIGsWnDYrid0169FC7Bg0v3pU4re4Gii4JIeEOtB/sOzu9V+L3wMp1LNDHu7P3b BJ9X1EAQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcSk1-0028d3-1E for linux-mediatek@lists.infradead.org; Wed, 15 Mar 2023 15:09:03 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcSjq-0008SQ-Hd; Wed, 15 Mar 2023 16:08:26 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pcSjm-004KcH-Fr; Wed, 15 Mar 2023 16:08:22 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pcSjl-0057j5-O5; Wed, 15 Mar 2023 16:08:21 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger Cc: AngeloGioacchino Del Regno , alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 113/173] ASoC: mediatek: mt8195-afe-pcm: Convert to platform remove callback returning void Date: Wed, 15 Mar 2023 16:06:45 +0100 Message-Id: <20230315150745.67084-114-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> References: <20230315150745.67084-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1866; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Vrevh/9+Tt9NBTkdA3ayadMtrznBbxNATV0c6JUQjk8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkEd6FPMOFGppFQCVABceDv/v8niyN69Vxw1dPW t1vVl8VttKJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZBHehQAKCRDB/BR4rcrs CROfB/9cn1lQZJZwq/BhnTEC7pmpcbvVu6MtU9rYrHSQOGFOlTJgeHY+o3jrkDezY2n6GGRxv77 A5y6LSFfENIfLl63FiSEcffYanjqtLo4RT19eJdXfaRbPfgE6yHOqKAeEsjY8Ub0kSS0MgG0ZRY u0evzAnY0guqz33nlb9dNaf5uThRrCVCpOZG/xOD6jbP88DDOgdIX8eYCkLJfqk0D/JIU98PvdL Kyk0SXvSAUL9PkW96Fn40F7SNm8o3KLuDVOKWNBZju57X1zCVv9spZtcN17bGGVywKxOgGCUOSY tJrlX8VFULBs8lKcYpY4feO33SfXKPRapCo69sle/NXefRGC X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230315_150901_776223_B45D5147 X-CRM114-Status: GOOD ( 16.26 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c index 72b2c6d629b9..9e45efeada55 100644 --- a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c +++ b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c @@ -3253,7 +3253,7 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev) return ret; } -static int mt8195_afe_pcm_dev_remove(struct platform_device *pdev) +static void mt8195_afe_pcm_dev_remove(struct platform_device *pdev) { struct mtk_base_afe *afe = platform_get_drvdata(pdev); @@ -3264,7 +3264,6 @@ static int mt8195_afe_pcm_dev_remove(struct platform_device *pdev) mt8195_afe_runtime_suspend(&pdev->dev); mt8195_afe_deinit_clock(afe); - return 0; } static const struct of_device_id mt8195_afe_pcm_dt_match[] = { @@ -3285,7 +3284,7 @@ static struct platform_driver mt8195_afe_pcm_driver = { .pm = &mt8195_afe_pm_ops, }, .probe = mt8195_afe_pcm_dev_probe, - .remove = mt8195_afe_pcm_dev_remove, + .remove_new = mt8195_afe_pcm_dev_remove, }; module_platform_driver(mt8195_afe_pcm_driver);