From patchwork Wed Mar 8 10:00:08 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: 1754021 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=3HCN4eZm; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PWnsl27xMz1yWs for ; Wed, 8 Mar 2023 21:02:03 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=WH1g5vMYb88FKxrNTC51bNiETyTiB+B/5nJ6t7CdCNY=; b=3HCN4eZmR1E9xv dJxHtP+v/Vd8L+LSt5HcrwArGWx2idCv1dpAlit8+3hL0fN5L1EFbwYZp++6qsDdZ7yXuY5j/2Fmi kNBJyvDSSgAXRgxhTEHYCbt5C2J67V+qisstKLkvbHHJYmi8mpHVYqfuGGtURP/aMUSGUF3IMxB/X Yjb3SgOUpqN2uKzI0iOAj0zaBhoq+xn+5XhfHPCfW/o+LTTnbqs800wLG6df9sys23HvFOF+sOdcB Urzv+loEfPVnhQG9gk59JQFJcXToLu5bQmbb3JzVPXuhw6l50kh2CkZ2k9KcfjpFEDDVM1UqcnvsA Ok6xWdkrqJh2DFlfH+3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZqcA-004I2y-1y; Wed, 08 Mar 2023 10:01:42 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZqaz-004HWT-Ev for linux-arm-kernel@lists.infradead.org; Wed, 08 Mar 2023 10:00:30 +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 1pZqao-0004Xv-S2; Wed, 08 Mar 2023 11:00:18 +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 1pZqao-002gW1-0X; Wed, 08 Mar 2023 11:00:18 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pZqam-003Fid-AQ; Wed, 08 Mar 2023 11:00:16 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Russell King , Shawn Guo , Sascha Hauer , Arnd Bergmann Cc: Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/8] ARM: imx: mmdc: Convert to platform remove callback returning void Date: Wed, 8 Mar 2023 11:00:08 +0100 Message-Id: <20230308100012.2539189-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230308100012.2539189-1-u.kleine-koenig@pengutronix.de> References: <20230308100012.2539189-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1744; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=B46cfeCDsVMkG/Tx70HDw3HrIkRVLIx+oIV5gCRRMqQ=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkCFyZXzk208/1ZVhlciCYkyzkMsRtY2waxE94T WReesh5YzOJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAhcmQAKCRDB/BR4rcrs CfXZCACZMEqK4qPahgeoR3rwDyBrOnNfR/XE0t7ye+FezryQ2DhZuKlL3xXMtNFJ3IN24KK2KUS EeIVENJq30fTG2H+bwurQkoH7UnTp4bB49PfDBaz5wuSWt/bWuq51KkmH5zTPGcQ6ICF9eX910u KOEpGWTYAGFb7NsuhYDmTbYFpv0IkI40BOOQYN6VvPuabSnA/2qV6CmC5CO4eC2X5dg7xSfESKY hZG7ReXoD20YcVHyQF1BrUqvKZfTxhZOMEC+/j1jTLzXW6YUfDQyerGGkHCqKHL1evM0r65SUGu NYsf+CMbcgWP6aUkOA6HXacINSv7VCuGmebBZlsuBtEpsmV3 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230308_020029_525594_A697FE3E X-CRM114-Status: GOOD ( 17.60 ) X-Spam-Score: -2.3 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (-2.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2001:67c:670:201:290:27ff:fe1d:cc33 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.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 Acked-by: Shawn Guo --- arch/arm/mach-imx/mmdc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index b9efe9da06e0..2157493b78a9 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -456,7 +456,7 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc, return pmu_mmdc->id; } -static int imx_mmdc_remove(struct platform_device *pdev) +static void imx_mmdc_remove(struct platform_device *pdev) { struct mmdc_pmu *pmu_mmdc = platform_get_drvdata(pdev); @@ -466,7 +466,6 @@ static int imx_mmdc_remove(struct platform_device *pdev) iounmap(pmu_mmdc->mmdc_base); clk_disable_unprepare(pmu_mmdc->mmdc_ipg_clk); kfree(pmu_mmdc); - return 0; } static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_base, @@ -592,7 +591,7 @@ static struct platform_driver imx_mmdc_driver = { .of_match_table = imx_mmdc_dt_ids, }, .probe = imx_mmdc_probe, - .remove = imx_mmdc_remove, + .remove_new = imx_mmdc_remove, }; static int __init imx_mmdc_init(void)