From patchwork Fri Oct 13 22:19:47 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: 733346 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 E73ECCDB47E for ; Fri, 13 Oct 2023 22:23:02 +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 29FF7836; Sat, 14 Oct 2023 00:22:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 29FF7836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697235781; bh=TllgjmOjMn10IcS4j2LTAf95NQP1JOMB2P4WeNA3glA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=NykeJ+VNhAJ7AR6F0Z3wwC5VHsOjp1sfGUcehg01Dq7iUkMcnAQbK5xSLlKEKHiel AMIhbg/TKD7uD2N53iwEmeceXsIeQRgrfRInJYWCW6R/EoDmq9U/AY04poQlBDku0A m1awsCvTyw1c237MlDy5DdBeQhNu1/CUZzAFHCXU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B1FD3F80571; Sat, 14 Oct 2023 00:21:15 +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 320FDF8057E; Sat, 14 Oct 2023 00:21:15 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6D484F802E8; Sat, 14 Oct 2023 00:20:32 +0200 (CEST) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0059BF802BE for ; Sat, 14 Oct 2023 00:20:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0059BF802BE Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qrQVv-0003u2-Mh; Sat, 14 Oct 2023 00:20:11 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qrQVu-001UR1-MZ; Sat, 14 Oct 2023 00:20:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qrQVu-00FrGo-DA; Sat, 14 Oct 2023 00:20:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: Nicolas Frattaroli , Jaroslav Kysela , Takashi Iwai , Heiko Stuebner , linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 1/7] ASoC: rockchip: i2s_tdm: Convert to platform remove callback returning void Date: Sat, 14 Oct 2023 00:19:47 +0200 Message-ID: <20231013221945.1489203-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> References: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1807; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=TllgjmOjMn10IcS4j2LTAf95NQP1JOMB2P4WeNA3glA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlKcKCP/NXhj0+ihQ+srsUX95YXpJG5+0IZy8Iu eZgljftmt2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSnCggAKCRCPgPtYfRL+ TmSFB/4sT4DJ034kWuvTwoq22jsYVgiW1Q7xzIWZcBuAX2Spwetg9y0flIXxPLCfAj+yn+6uBZw 1o/nympFzyUhMsxc48WTFX2j7o2sQW4NNLhB3xfA/T/H71MnXZb92R/VKs9WSJc6QcDzXD+bNus Ff9Wf3PMWoIUPIKq5vpxEDqavSeewxK7m4F40Cr/cYk2wn2ONgGNeFQDfMUOK8wgzJceCF1fTIW mL6dDSi3cszIQHnHcmt4O/x5laqTFEPvk4RbqOcsNDA+h0ZouQMBthj1yl1gbLF7zeZ5NwsPqWs O5Pxu+sVWG/iQ/d7JgfWF3pWYmhAtPmZ5ZUJtpFT1dJR6ahL 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Message-ID-Hash: WCC37J7WFPQMSBE3J4S52XCKU67NEVWD X-Message-ID-Hash: WCC37J7WFPQMSBE3J4S52XCKU67NEVWD X-MailFrom: ukl@pengutronix.de 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: 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 --- sound/soc/rockchip/rockchip_i2s_tdm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index 7e996550d1df..5c51dbef6e86 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -1714,14 +1714,12 @@ static int rockchip_i2s_tdm_probe(struct platform_device *pdev) return ret; } -static int rockchip_i2s_tdm_remove(struct platform_device *pdev) +static void rockchip_i2s_tdm_remove(struct platform_device *pdev) { if (!pm_runtime_status_suspended(&pdev->dev)) i2s_tdm_runtime_suspend(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static int __maybe_unused rockchip_i2s_tdm_suspend(struct device *dev) @@ -1756,7 +1754,7 @@ static const struct dev_pm_ops rockchip_i2s_tdm_pm_ops = { static struct platform_driver rockchip_i2s_tdm_driver = { .probe = rockchip_i2s_tdm_probe, - .remove = rockchip_i2s_tdm_remove, + .remove_new = rockchip_i2s_tdm_remove, .driver = { .name = DRV_NAME, .of_match_table = of_match_ptr(rockchip_i2s_tdm_match), From patchwork Fri Oct 13 22:19:48 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: 733344 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 777EECDB47E for ; Fri, 13 Oct 2023 22:24:03 +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 99E3AAE9; Sat, 14 Oct 2023 00:23:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 99E3AAE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697235841; bh=a4kF45rrvlrC2pNbdDyNnShL5GVx8qgLtcKs8E5z5Qw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bdC60Ts7IpkOV3DtaVcC5hve4VLxhFZSO4IgQQNZNYmkZl+5xiXAZv6zUWA/FslZe 3S22zoN7ZaqngQYOQBP1If1RLkjJlaIYAB8+Pxz7r5MHZwcPpWNKv2Qk5R/J2ArKj2 uNVTqft4eMfigC5k19cU5dHLEokmGEmS1fwOdisc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 51F7AF805C7; Sat, 14 Oct 2023 00:21:21 +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 C23EBF805C4; Sat, 14 Oct 2023 00:21:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 86A0AF802BE; Sat, 14 Oct 2023 00:20:40 +0200 (CEST) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 302ABF80536 for ; Sat, 14 Oct 2023 00:20:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 302ABF80536 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qrQVv-0003u3-Vj; Sat, 14 Oct 2023 00:20:11 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qrQVu-001UR4-Tq; Sat, 14 Oct 2023 00:20:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qrQVu-00FrGr-Kb; Sat, 14 Oct 2023 00:20:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: James Schulman , David Rhodes , Richard Fitzgerald , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, patches@opensource.cirrus.com, kernel@pengutronix.de Subject: [PATCH 2/7] ASoC: cs42l43: Convert to platform remove callback returning void Date: Sat, 14 Oct 2023 00:19:48 +0200 Message-ID: <20231013221945.1489203-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> References: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1736; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=a4kF45rrvlrC2pNbdDyNnShL5GVx8qgLtcKs8E5z5Qw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlKcKD3YpCG/9D3u+ByUWFdjShg45cyhLTHdzvQ Btobwn6wWyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSnCgwAKCRCPgPtYfRL+ TrfGCACZBeXj7+ClQGVGgiOPkXB9M6c+VxkC/ADzb97xaJKGjc6Dg+VEmHaWV2H+0Z5hFVR3hVD ZgwZttu4H/L+uuI5seg2WfGhxRCWAt22ObFP9YHlUS4veCZ4Uhpwj3NLERYPypqmu7rLaEJ8tsG QEulSBlUyFmd8G0IO+vtSc+8aobe9i/YrSlhDyJpL78wI1x6MuSzO0C7k12xlsolvoVQwokI0de RP3mKFKiHPZ1OEi6Dl+ENvg0SpOuG0mkqhd5Uk+vVZZpMw7FxUW4bgaw3GLd668Alwfb7dGyTif Ar+bLYHft/4sA7NnlfleTircpcimH9NaVuxzv8QpL6d0hOA1 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Message-ID-Hash: 6CSASBXK7GRTFGWLY6D5WYKHGEHMYJFL X-Message-ID-Hash: 6CSASBXK7GRTFGWLY6D5WYKHGEHMYJFL X-MailFrom: ukl@pengutronix.de 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: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- sound/soc/codecs/cs42l43.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/cs42l43.c b/sound/soc/codecs/cs42l43.c index 532183095818..d62c9f26c632 100644 --- a/sound/soc/codecs/cs42l43.c +++ b/sound/soc/codecs/cs42l43.c @@ -2232,13 +2232,11 @@ static int cs42l43_codec_probe(struct platform_device *pdev) return ret; } -static int cs42l43_codec_remove(struct platform_device *pdev) +static void cs42l43_codec_remove(struct platform_device *pdev) { struct cs42l43_codec *priv = platform_get_drvdata(pdev); clk_put(priv->mclk); - - return 0; } static int cs42l43_codec_runtime_resume(struct device *dev) @@ -2269,7 +2267,7 @@ static struct platform_driver cs42l43_codec_driver = { }, .probe = cs42l43_codec_probe, - .remove = cs42l43_codec_remove, + .remove_new = cs42l43_codec_remove, .id_table = cs42l43_codec_id_table, }; module_platform_driver(cs42l43_codec_driver); From patchwork Fri Oct 13 22:19:49 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: 733712 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 28D32CDB47E for ; Fri, 13 Oct 2023 22:23:52 +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 613CEBC0; Sat, 14 Oct 2023 00:23:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 613CEBC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697235830; bh=g2V2vrlnHeJrYX5VINthEX/RpkofxwJieO4iq+veUzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ieTOu3/WaNRaZL4KQgNppEWosMw2r1LChaTQVw0bxq0s017UAQ71XDDlXzzXvjRqN kQ58kFl7k9roi7PyMl3ym6PiRfmU/ARIdbFt+lOOHyllvdWgMrSixB3X7xqOYnHUVg jmoRZzSZ1D5sPyP03nUrZLEzAIceWnf/WiFRVBJA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D2A34F805C0; Sat, 14 Oct 2023 00:21:19 +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 4FB4DF805B5; Sat, 14 Oct 2023 00:21:19 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 58F1CF802BE; Sat, 14 Oct 2023 00:20:38 +0200 (CEST) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B53C6F80552 for ; Sat, 14 Oct 2023 00:20:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B53C6F80552 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qrQVw-0003u4-No; Sat, 14 Oct 2023 00:20:12 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qrQVv-001UR7-4u; Sat, 14 Oct 2023 00:20:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qrQVu-00FrGw-Rl; Sat, 14 Oct 2023 00:20:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: Hal Feng , Xingyu Wu , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, kernel@pengutronix.de Subject: [PATCH 3/7] ASoC: starfive/jh7110-pwmdac: Convert to platform remove callback returning void Date: Sat, 14 Oct 2023 00:19:49 +0200 Message-ID: <20231013221945.1489203-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> References: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1719; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=g2V2vrlnHeJrYX5VINthEX/RpkofxwJieO4iq+veUzs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlKcKEYcb7ImaTZYMmTnCG4dWZiMht64O1nfUBY 8a94Q99vHyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSnChAAKCRCPgPtYfRL+ TgqQB/9PJw/zSp0d4t4pbM6wlGXVGRk/LzCTRMnrg+ApWHwVED8mWA/rK3nTkhLfQQoL+5LcZY/ RhJLXbC6PC80SRFYPuc27jokr9qytxn0/MNPwlZKo/1URdOwKtyCrWUnc8GsCiGVfuEA5ttO+9b X8GrAJk7w6LbMHxVtN8e2p2gq3o4CIw2u7/n95Bgar15/ytaJHrb37Xwyeh6lHyj4brEKgmckZA HF03KPL33kuJfkG2lr6uU4MtoF5tKBoxWOy//xrlQWPwOOSQAnj3CqGJGHnOvHG4JvIws4wA1gf 6NKgeQVJIa+hRh0YfTWmd3/9YuTKlvgJRM9/GujO/wLYF3Rd 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Message-ID-Hash: PZTEIW4TN6HM4BRQSBXUVOUSOMM2PQOB X-Message-ID-Hash: PZTEIW4TN6HM4BRQSBXUVOUSOMM2PQOB X-MailFrom: ukl@pengutronix.de 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: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- sound/soc/starfive/jh7110_pwmdac.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/starfive/jh7110_pwmdac.c b/sound/soc/starfive/jh7110_pwmdac.c index 65ee3e339494..4a4dd431b82b 100644 --- a/sound/soc/starfive/jh7110_pwmdac.c +++ b/sound/soc/starfive/jh7110_pwmdac.c @@ -498,10 +498,9 @@ static int jh7110_pwmdac_probe(struct platform_device *pdev) return ret; } -static int jh7110_pwmdac_remove(struct platform_device *pdev) +static void jh7110_pwmdac_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); - return 0; } static const struct of_device_id jh7110_pwmdac_of_match[] = { @@ -517,7 +516,7 @@ static struct platform_driver jh7110_pwmdac_driver = { .pm = pm_ptr(&jh7110_pwmdac_pm_ops), }, .probe = jh7110_pwmdac_probe, - .remove = jh7110_pwmdac_remove, + .remove_new = jh7110_pwmdac_remove, }; module_platform_driver(jh7110_pwmdac_driver); From patchwork Fri Oct 13 22:19:50 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: 733711 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 76017CDB47E for ; Fri, 13 Oct 2023 22:24:13 +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 67A2A9F6; Sat, 14 Oct 2023 00:23:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 67A2A9F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697235851; bh=rg4UGscGMxesn/Ng7C8DgLhgb75kOFpu1RFwbvoHWiQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=nBcdby1ReFOCRd5Wl6qqvQTxrV9DIFEQ2FcW0aK5hPTWoOspPVNSDGdM8JB3IMp0R 4Cj4zrdRNZv9+vXe0Ga/yLX7ggyrgKBuA3IR8gLWXP3kAGnvsEBUnF8SMMxiIKnTsf sqAMw5pDTifTM0TRlDz5RSX0penWtunK+3Lqe3UU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D48A5F80553; Sat, 14 Oct 2023 00:23:08 +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 968DCF802E8; Sat, 14 Oct 2023 00:23:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3AC7DF802E8; Sat, 14 Oct 2023 00:23:05 +0200 (CEST) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2C035F8019B for ; Sat, 14 Oct 2023 00:20:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2C035F8019B Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qrQVy-0003u5-Qp; Sat, 14 Oct 2023 00:20:14 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qrQVv-001URA-CZ; Sat, 14 Oct 2023 00:20:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qrQVv-00FrH0-2F; Sat, 14 Oct 2023 00:20:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: Jaroslav Kysela , Takashi Iwai , Thierry Reding , Jonathan Hunter , Kuninori Morimoto , Rob Herring , AngeloGioacchino Del Regno , Wang Yufen , Aidan MacDonald , Jernej Skrabec , Claudiu Beznea , Astrid Rost , Robert Hancock , Herve Codina , Sameer Pujar , alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-tegra@vger.kernel.org Subject: [PATCH 4/7] ASoC: simple-card-utils: Make simple_util_remove() return void Date: Sat, 14 Oct 2023 00:19:50 +0200 Message-ID: <20231013221945.1489203-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> References: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4890; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rg4UGscGMxesn/Ng7C8DgLhgb75kOFpu1RFwbvoHWiQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlKcKGL/n3H0zBmYbBzfwwn0/S3LeJpoZbTMsSH HTIS/gbK3eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSnChgAKCRCPgPtYfRL+ TvXzB/9OK2CuojbMg5wW/zm2mMiLcGkVhvxLYL1K6cFryasc2dPnJbFSnIY6yfLP0u6LmlzxOKX 8StxWYXnpVTuM89nzV7jz1lO/wM3Lymb0pg16hOyo4XFGXc2prKtCEhmPz2ZJdUxi08GyxJTXdC pPwnQcAmqpwk2O7v58LpC4AyBFFRxbCGdMba2CZDz3wQ8o3MxcflT7zEJzBJiiYnW90jQqUAbX4 xprDn/3PGncmua3RkVvA6VJpp3J5Upano0KXw1p+LPk4S+LpxP9qzqI15jAUWU3fZ0YdF7/9Sbv R+HovEKevmUBv33CbkfJv90pZIinxbr5vq/oSadeBE1UShgQ 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Message-ID-Hash: 6AW7XOHAF3SABM3FVQLFILYTKBHA3CFR X-Message-ID-Hash: 6AW7XOHAF3SABM3FVQLFILYTKBHA3CFR X-MailFrom: ukl@pengutronix.de 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: 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. simple_util_remove() returned zero unconditionally. Make it return void instead and convert all users to struct platform_device::remove_new(). Signed-off-by: Uwe Kleine-König --- include/sound/simple_card_utils.h | 2 +- sound/soc/generic/audio-graph-card.c | 2 +- sound/soc/generic/audio-graph-card2-custom-sample.c | 2 +- sound/soc/generic/audio-graph-card2.c | 2 +- sound/soc/generic/simple-card-utils.c | 4 +--- sound/soc/generic/simple-card.c | 2 +- sound/soc/tegra/tegra_audio_graph_card.c | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 18e7a0b89395..e5da10b4c43b 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -188,7 +188,7 @@ int simple_util_init_aux_jacks(struct simple_util_priv *priv, char *prefix); int simple_util_init_priv(struct simple_util_priv *priv, struct link_info *li); -int simple_util_remove(struct platform_device *pdev); +void simple_util_remove(struct platform_device *pdev); int graph_util_card_probe(struct snd_soc_card *card); int graph_util_is_ports0(struct device_node *port); diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 704f32bda24d..76a9f1e8cdd5 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -644,7 +644,7 @@ static struct platform_driver graph_card = { .of_match_table = graph_of_match, }, .probe = graph_probe, - .remove = simple_util_remove, + .remove_new = simple_util_remove, }; module_platform_driver(graph_card); diff --git a/sound/soc/generic/audio-graph-card2-custom-sample.c b/sound/soc/generic/audio-graph-card2-custom-sample.c index 4dc65e249ecb..1b6ccd2de964 100644 --- a/sound/soc/generic/audio-graph-card2-custom-sample.c +++ b/sound/soc/generic/audio-graph-card2-custom-sample.c @@ -176,7 +176,7 @@ static struct platform_driver custom_card = { .of_match_table = custom_of_match, }, .probe = custom_probe, - .remove = simple_util_remove, + .remove_new = simple_util_remove, }; module_platform_driver(custom_card); diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 1344e1adfc67..7146611df730 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -1224,7 +1224,7 @@ static struct platform_driver graph_card = { .of_match_table = graph_of_match, }, .probe = graph_probe, - .remove = simple_util_remove, + .remove_new = simple_util_remove, }; module_platform_driver(graph_card); diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 11f186ea662a..cfa70a56ff0f 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -958,13 +958,11 @@ int simple_util_init_priv(struct simple_util_priv *priv, } EXPORT_SYMBOL_GPL(simple_util_init_priv); -int simple_util_remove(struct platform_device *pdev) +void simple_util_remove(struct platform_device *pdev) { struct snd_soc_card *card = platform_get_drvdata(pdev); simple_util_clean_reference(card); - - return 0; } EXPORT_SYMBOL_GPL(simple_util_remove); diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 048357ae7ae6..9c79ff6a568f 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -827,7 +827,7 @@ static struct platform_driver simple_card = { .of_match_table = simple_of_match, }, .probe = simple_probe, - .remove = simple_util_remove, + .remove_new = simple_util_remove, }; module_platform_driver(simple_card); diff --git a/sound/soc/tegra/tegra_audio_graph_card.c b/sound/soc/tegra/tegra_audio_graph_card.c index 8b48813c2c59..feba9d42bbc5 100644 --- a/sound/soc/tegra/tegra_audio_graph_card.c +++ b/sound/soc/tegra/tegra_audio_graph_card.c @@ -248,7 +248,7 @@ static struct platform_driver tegra_audio_graph_card = { .of_match_table = graph_of_tegra_match, }, .probe = tegra_audio_graph_probe, - .remove = simple_util_remove, + .remove_new = simple_util_remove, }; module_platform_driver(tegra_audio_graph_card); From patchwork Fri Oct 13 22:19:51 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: 733345 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 921F7CDB47E for ; Fri, 13 Oct 2023 22:23:43 +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 A360EA4A; Sat, 14 Oct 2023 00:22:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A360EA4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697235821; bh=yF2Q7ng4BO/0bNqNzg+OGX3edKvUXFE8sRAPvpn8ZJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=vp5R11wP7cGVWxibvEQ+Zwev7WcoaQR6qH38tKgWuNfEXWmNHaDumg4Sus/qBmaIl aNUfwna9ehJSEp/uLT4G3nnwWSRPDan6aTxBcO8ZvAveDNoyXcvWg5Zcll4XP6WxzJ 1RSHZTCscdGXqeffKutSAhdvWBvcWWuylJk/s0Sw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D80F4F805AA; Sat, 14 Oct 2023 00:21: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 1E07EF805A0; Sat, 14 Oct 2023 00:21:18 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 53BDCF802E8; Sat, 14 Oct 2023 00:20:36 +0200 (CEST) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7486FF8027B for ; Sat, 14 Oct 2023 00:20:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7486FF8027B Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qrQVw-0003uC-6H; Sat, 14 Oct 2023 00:20:12 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qrQVv-001URD-JE; Sat, 14 Oct 2023 00:20:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qrQVv-00FrH4-9h; Sat, 14 Oct 2023 00:20:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: Jerome Brunet , Jaroslav Kysela , Takashi Iwai , Neil Armstrong , Kevin Hilman , Martin Blumenstingl , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 5/7] ASoC: meson: Make meson_card_remove() return void Date: Sat, 14 Oct 2023 00:19:51 +0200 Message-ID: <20231013221945.1489203-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> References: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2962; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=yF2Q7ng4BO/0bNqNzg+OGX3edKvUXFE8sRAPvpn8ZJo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlKcKHnrjMUvX5oysin1crHzg1x1xYF02Horo6o vPoRHC1nheJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSnChwAKCRCPgPtYfRL+ Tmm+CACpOts6HE9b9hyqqncrhckXQLavS2qdjGfrlZ74Retu3o4BrjF0Ho9Eep0YyRBFa/GO9zk bLHgnB6Trr/uXT7wqct/v/1G0godBI9CqlvGQ3EMJnLo04jKjURN8Bv48BJe+cFxU3FWcTvPhzS zw+S1/+m3a+x4lD7EvUKIGvzyOvqNLFLyw3HWeqwchXjCbF/M7iiYMY17ikaPfdqEMQl//Xrqg7 JFOGTHgPhFSYKICrH+y3m3+JikstRYb1amhs4lRHu62wqDOBsE7ZESaCQ/CGGLtHQAgbEtgSGCd OoEtVbD0rmSuRY7G9/04hQZgq+Xz84tFoF04Zo4ZSV8pv2ey 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Message-ID-Hash: 6DTCDUWNA4UTG42EQAE4DWJF7XUPUTMB X-Message-ID-Hash: 6DTCDUWNA4UTG42EQAE4DWJF7XUPUTMB X-MailFrom: ukl@pengutronix.de 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: 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. meson_card_remove() returned zero unconditionally. Make it return void instead and convert all users to struct platform_device::remove_new(). Signed-off-by: Uwe Kleine-König Reviewed-by: Jerome Brunet --- sound/soc/meson/axg-card.c | 2 +- sound/soc/meson/gx-card.c | 2 +- sound/soc/meson/meson-card-utils.c | 4 +--- sound/soc/meson/meson-card.h | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c index 18b16274449e..3180aa4d3a15 100644 --- a/sound/soc/meson/axg-card.c +++ b/sound/soc/meson/axg-card.c @@ -360,7 +360,7 @@ MODULE_DEVICE_TABLE(of, axg_card_of_match); static struct platform_driver axg_card_pdrv = { .probe = meson_card_probe, - .remove = meson_card_remove, + .remove_new = meson_card_remove, .driver = { .name = "axg-sound-card", .of_match_table = axg_card_of_match, diff --git a/sound/soc/meson/gx-card.c b/sound/soc/meson/gx-card.c index 01beac1d927f..f1539e542638 100644 --- a/sound/soc/meson/gx-card.c +++ b/sound/soc/meson/gx-card.c @@ -130,7 +130,7 @@ MODULE_DEVICE_TABLE(of, gx_card_of_match); static struct platform_driver gx_card_pdrv = { .probe = meson_card_probe, - .remove = meson_card_remove, + .remove_new = meson_card_remove, .driver = { .name = "gx-sound-card", .of_match_table = gx_card_of_match, diff --git a/sound/soc/meson/meson-card-utils.c b/sound/soc/meson/meson-card-utils.c index c81099218597..ed6c7e2f609c 100644 --- a/sound/soc/meson/meson-card-utils.c +++ b/sound/soc/meson/meson-card-utils.c @@ -327,13 +327,11 @@ int meson_card_probe(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(meson_card_probe); -int meson_card_remove(struct platform_device *pdev) +void meson_card_remove(struct platform_device *pdev) { struct meson_card *priv = platform_get_drvdata(pdev); meson_card_clean_references(priv); - - return 0; } EXPORT_SYMBOL_GPL(meson_card_remove); diff --git a/sound/soc/meson/meson-card.h b/sound/soc/meson/meson-card.h index a5374324a189..a0d693e4f460 100644 --- a/sound/soc/meson/meson-card.h +++ b/sound/soc/meson/meson-card.h @@ -49,6 +49,6 @@ int meson_card_set_fe_link(struct snd_soc_card *card, bool is_playback); int meson_card_probe(struct platform_device *pdev); -int meson_card_remove(struct platform_device *pdev); +void meson_card_remove(struct platform_device *pdev); #endif /* _MESON_SND_CARD_H */ From patchwork Fri Oct 13 22:19:52 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: 733714 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 78DDDCDB47E for ; Fri, 13 Oct 2023 22:22:54 +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 613B2868; Sat, 14 Oct 2023 00:22:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 613B2868 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697235772; bh=BokPyYVG7aD1G6y+f2Y3dpkMLyYMGoIrNwIoPdZNxhU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=A/wqy8gcaQvOQXq1+PRFe/1ikwlkT4AfcNxePawK3goKk9dbnzSeGWQmOnSVa7DXu 7qXudCMy7GczWGyx82NgzA9bSly5XWf5Er1wtYYYiTOB5rvn0ECzzYSGic9l3pA5cQ n/ioxYiUU+g1CC3xOKB+z1305/loFCYNvpkAoRoM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AE901F8055B; Sat, 14 Oct 2023 00:21:14 +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 CC833F8055C; Sat, 14 Oct 2023 00:21:13 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BC234F80553; Sat, 14 Oct 2023 00:20:30 +0200 (CEST) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6C01BF8019B for ; Sat, 14 Oct 2023 00:20:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6C01BF8019B Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qrQVw-0003uJ-Oe; Sat, 14 Oct 2023 00:20:12 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qrQVv-001URH-QI; Sat, 14 Oct 2023 00:20:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qrQVv-00FrH8-Gt; Sat, 14 Oct 2023 00:20:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: Srinivas Kandagatla , Banajit Goswami , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, kernel@pengutronix.de Subject: [PATCH 6/7] ASoC: qcom: lpass: Make asoc_qcom_lpass_cpu_platform_remove() return void Date: Sat, 14 Oct 2023 00:19:52 +0200 Message-ID: <20231013221945.1489203-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> References: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4609; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=BokPyYVG7aD1G6y+f2Y3dpkMLyYMGoIrNwIoPdZNxhU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlKcKIHGuYjXU1i9+OotCiM7vj8dtN06tcNWRmK YB0FsHkHWqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSnCiAAKCRCPgPtYfRL+ TuYiB/9ewUPtxKy4ZiOX12ybpMfu6IjmIsrMwtEiR44mDb0DncgLYSo4G3phjYPsrgtCkQqegTI J9A7C6WIC2K4jNYrA1SHOr5JcRMNOBkaAee9HpAAie44ZtZqm3FDRYtRvrwV2LJHpkz9IrYX+DB REHPpcbHMT0Bj0eY8NxqfXVDr1cQITuvYC23sgFEYLFUEwG2nC1MYIwu3TFIXuYJt8Cl5p8Y5Ey H6BFn6P1H37nH34bxnbFUqUL8FmeNz60FjQJl7NEwTI9ugxgMaEGyO3MTippynDJ9JsDj+9E8Zb yw7BFUKQ447f0AcbqG97Vj76SLhU2EuUflLhXdorE+/Xi3or 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Message-ID-Hash: ZMJPQNK52DNYJCUYJGGGMZPEBWFHOTLX X-Message-ID-Hash: ZMJPQNK52DNYJCUYJGGGMZPEBWFHOTLX X-MailFrom: ukl@pengutronix.de 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: 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. asoc_qcom_lpass_cpu_platform_remove() returned zero unconditionally. Make it return void instead and convert all users to struct platform_device::remove_new(). Signed-off-by: Uwe Kleine-König --- sound/soc/qcom/lpass-apq8016.c | 2 +- sound/soc/qcom/lpass-cpu.c | 5 +---- sound/soc/qcom/lpass-ipq806x.c | 2 +- sound/soc/qcom/lpass-sc7180.c | 2 +- sound/soc/qcom/lpass-sc7280.c | 2 +- sound/soc/qcom/lpass.h | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c index 8ce75b442b64..8e58e814a95f 100644 --- a/sound/soc/qcom/lpass-apq8016.c +++ b/sound/soc/qcom/lpass-apq8016.c @@ -300,7 +300,7 @@ static struct platform_driver apq8016_lpass_cpu_platform_driver = { .of_match_table = of_match_ptr(apq8016_lpass_cpu_device_id), }, .probe = asoc_qcom_lpass_cpu_platform_probe, - .remove = asoc_qcom_lpass_cpu_platform_remove, + .remove_new = asoc_qcom_lpass_cpu_platform_remove, }; module_platform_driver(apq8016_lpass_cpu_platform_driver); diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index ba8fa7919884..88b80ed45c66 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -1274,15 +1274,12 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_platform_probe); -int asoc_qcom_lpass_cpu_platform_remove(struct platform_device *pdev) +void asoc_qcom_lpass_cpu_platform_remove(struct platform_device *pdev) { struct lpass_data *drvdata = platform_get_drvdata(pdev); if (drvdata->variant->exit) drvdata->variant->exit(pdev); - - - return 0; } EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_platform_remove); diff --git a/sound/soc/qcom/lpass-ipq806x.c b/sound/soc/qcom/lpass-ipq806x.c index bbe9f11d7780..e0e9ad35821c 100644 --- a/sound/soc/qcom/lpass-ipq806x.c +++ b/sound/soc/qcom/lpass-ipq806x.c @@ -172,7 +172,7 @@ static struct platform_driver ipq806x_lpass_cpu_platform_driver = { .of_match_table = of_match_ptr(ipq806x_lpass_cpu_device_id), }, .probe = asoc_qcom_lpass_cpu_platform_probe, - .remove = asoc_qcom_lpass_cpu_platform_remove, + .remove_new = asoc_qcom_lpass_cpu_platform_remove, }; module_platform_driver(ipq806x_lpass_cpu_platform_driver); diff --git a/sound/soc/qcom/lpass-sc7180.c b/sound/soc/qcom/lpass-sc7180.c index 1b0c04b210ce..22063b834554 100644 --- a/sound/soc/qcom/lpass-sc7180.c +++ b/sound/soc/qcom/lpass-sc7180.c @@ -315,7 +315,7 @@ static struct platform_driver sc7180_lpass_cpu_platform_driver = { .pm = &sc7180_lpass_pm_ops, }, .probe = asoc_qcom_lpass_cpu_platform_probe, - .remove = asoc_qcom_lpass_cpu_platform_remove, + .remove_new = asoc_qcom_lpass_cpu_platform_remove, .shutdown = asoc_qcom_lpass_cpu_platform_shutdown, }; diff --git a/sound/soc/qcom/lpass-sc7280.c b/sound/soc/qcom/lpass-sc7280.c index 7cd3e291382a..47c622327a8d 100644 --- a/sound/soc/qcom/lpass-sc7280.c +++ b/sound/soc/qcom/lpass-sc7280.c @@ -445,7 +445,7 @@ static struct platform_driver sc7280_lpass_cpu_platform_driver = { .pm = &sc7280_lpass_pm_ops, }, .probe = asoc_qcom_lpass_cpu_platform_probe, - .remove = asoc_qcom_lpass_cpu_platform_remove, + .remove_new = asoc_qcom_lpass_cpu_platform_remove, .shutdown = asoc_qcom_lpass_cpu_platform_shutdown, }; diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h index aab60540563a..2f222bd4ffcc 100644 --- a/sound/soc/qcom/lpass.h +++ b/sound/soc/qcom/lpass.h @@ -399,7 +399,7 @@ struct lpass_pcm_data { /* register the platform driver from the CPU DAI driver */ int asoc_qcom_lpass_platform_register(struct platform_device *); -int asoc_qcom_lpass_cpu_platform_remove(struct platform_device *pdev); +void asoc_qcom_lpass_cpu_platform_remove(struct platform_device *pdev); void asoc_qcom_lpass_cpu_platform_shutdown(struct platform_device *pdev); int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev); extern const struct snd_soc_dai_ops asoc_qcom_lpass_cpu_dai_ops; From patchwork Fri Oct 13 22:19:53 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: 733713 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 84CB3CDB47E for ; Fri, 13 Oct 2023 22:23:15 +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 7B326DEE; Sat, 14 Oct 2023 00:22:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7B326DEE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697235793; bh=NRJs7bNLMD4lY8a8Vf+RrZRTY5Ve2yfdxKsArY8jPyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=b3uuv6jIpFYLuFMGH6npHIAuBHsnAjQNxV8pV/PLZOiLl06CLA5TIdheTZENpjZlQ ftivNA1luWpNf2rgMen6OlJCLNl6gcLJMP/0YQkCqXt13VN9ndPfRO8RZLTPb6hJqw p/nsccUH1lGkBFlkgADWpMiuk5ECn6QUakQnHiAM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8AD60F80588; Sat, 14 Oct 2023 00:21:17 +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 BFED0F805A0; Sat, 14 Oct 2023 00:21:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 579AFF802BE; Sat, 14 Oct 2023 00:20:34 +0200 (CEST) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0E629F80310 for ; Sat, 14 Oct 2023 00:20:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0E629F80310 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qrQVw-0003ud-PV; Sat, 14 Oct 2023 00:20:12 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qrQVw-001URK-1M; Sat, 14 Oct 2023 00:20:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qrQVv-00FrHC-Ny; Sat, 14 Oct 2023 00:20:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: Jaroslav Kysela , Takashi Iwai , Kunihiko Hayashi , Masami Hiramatsu , Kuninori Morimoto , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 7/7] ASoC: uniphier: Make uniphier_aio_remove() return void Date: Sat, 14 Oct 2023 00:19:53 +0200 Message-ID: <20231013221945.1489203-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> References: <20231013221945.1489203-9-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3221; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=NRJs7bNLMD4lY8a8Vf+RrZRTY5Ve2yfdxKsArY8jPyI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlKcKJxAOOwZo8A0nM1ztzYVQbZKOe148hr3/BD 51JsdLSYBKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSnCiQAKCRCPgPtYfRL+ TtNqCACRFDRxXpbfwRQ8G3682hQ1+Tl8TLhAMUnG9xT0DVK/7q2E5gA9h/SYFQbdeTa/lw3Ct8r F8dFPi3VuzqfGJcoN10MUimydDNs6+oFNQZ/A8Jai3/TbSbbczwMdXsREbXHkaL9J35TLw8CrFS 6y59q7PK70HdLX+KIN0OWw5xfkn25igPF72lemRZsPKaaopwD2TlpEOxYqK1rZHC8m5W6jssr1i 1qVmLkEx+PFIDRG2ekpdO3Oq/ZhS/ZGKykOHqfwkk6kCEBnCsZNg4JM+MnxFbu8qKmA0xn1D2fm 3Re8KlVghC03CbRoUbf3B7kkBRR5l4DV0WUEGSQ+NgNiDZZY 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Message-ID-Hash: BU2USWXZALYBKUCHCEMGS2RAJHFCH4PO X-Message-ID-Hash: BU2USWXZALYBKUCHCEMGS2RAJHFCH4PO X-MailFrom: ukl@pengutronix.de 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: 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. uniphier_aio_remove() returned zero unconditionally. Make it return void instead and convert all users to struct platform_device::remove_new(). Signed-off-by: Uwe Kleine-König --- sound/soc/uniphier/aio-cpu.c | 4 +--- sound/soc/uniphier/aio-ld11.c | 2 +- sound/soc/uniphier/aio-pxs2.c | 2 +- sound/soc/uniphier/aio.h | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sound/soc/uniphier/aio-cpu.c b/sound/soc/uniphier/aio-cpu.c index 7c5188477b7c..470f129166a4 100644 --- a/sound/soc/uniphier/aio-cpu.c +++ b/sound/soc/uniphier/aio-cpu.c @@ -822,14 +822,12 @@ int uniphier_aio_probe(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(uniphier_aio_probe); -int uniphier_aio_remove(struct platform_device *pdev) +void uniphier_aio_remove(struct platform_device *pdev) { struct uniphier_aio_chip *chip = platform_get_drvdata(pdev); reset_control_assert(chip->rst); clk_disable_unprepare(chip->clk); - - return 0; } EXPORT_SYMBOL_GPL(uniphier_aio_remove); diff --git a/sound/soc/uniphier/aio-ld11.c b/sound/soc/uniphier/aio-ld11.c index 15dbded63804..01cc3b961999 100644 --- a/sound/soc/uniphier/aio-ld11.c +++ b/sound/soc/uniphier/aio-ld11.c @@ -347,7 +347,7 @@ static struct platform_driver uniphier_aio_driver = { .of_match_table = of_match_ptr(uniphier_aio_of_match), }, .probe = uniphier_aio_probe, - .remove = uniphier_aio_remove, + .remove_new = uniphier_aio_remove, }; module_platform_driver(uniphier_aio_driver); diff --git a/sound/soc/uniphier/aio-pxs2.c b/sound/soc/uniphier/aio-pxs2.c index 305cb2a1253d..fba13a212bdb 100644 --- a/sound/soc/uniphier/aio-pxs2.c +++ b/sound/soc/uniphier/aio-pxs2.c @@ -256,7 +256,7 @@ static struct platform_driver uniphier_aio_driver = { .of_match_table = of_match_ptr(uniphier_aio_of_match), }, .probe = uniphier_aio_probe, - .remove = uniphier_aio_remove, + .remove_new = uniphier_aio_remove, }; module_platform_driver(uniphier_aio_driver); diff --git a/sound/soc/uniphier/aio.h b/sound/soc/uniphier/aio.h index 09ccb47337fd..d9fd61dd976f 100644 --- a/sound/soc/uniphier/aio.h +++ b/sound/soc/uniphier/aio.h @@ -307,7 +307,7 @@ int uniphier_aiodma_soc_register_platform(struct platform_device *pdev); extern const struct snd_compress_ops uniphier_aio_compress_ops; int uniphier_aio_probe(struct platform_device *pdev); -int uniphier_aio_remove(struct platform_device *pdev); +void uniphier_aio_remove(struct platform_device *pdev); extern const struct snd_soc_dai_ops uniphier_aio_i2s_ld11_ops; extern const struct snd_soc_dai_ops uniphier_aio_i2s_pxs2_ops; extern const struct snd_soc_dai_ops uniphier_aio_spdif_ld11_ops;