Message ID | 20230401161938.2503204-48-u.kleine-koenig@pengutronix.de |
---|---|
State | Changes Requested |
Delegated to: | Miquel Raynal |
Headers | show
Return-Path: <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=<UNKNOWN>) 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=yYpBGwsw; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=Oq/MYdHB; 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 4PpjWl4hwQz1yY8 for <incoming@patchwork.ozlabs.org>; Sun, 2 Apr 2023 02:38:11 +1000 (AEST) 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=8W6/DZlyOxTccZ2KnfFQW+4Vu15PcfZe8bAZRJ3G+zM=; b=yYpBGwsw+5/bkI 7mp5XCakEILdr46YPyMP+8JLoF/4XHypRAuasKJmYqYRn0mtGDRuarzr7Y93R8Ee+EjDVX8rd/fGE 0Mw3YkvnwmgyQBIB/bTzgG/hlsKQRNvJeoudJZm2AxOGvtzCG6cfL+lwIGrCceXOnXpWQ3xfEhNQo N1Efq5gOMaQZr3h09ODho2zDg49dUusKhRllzRfLyUNABdnR8TiJkWdtYFiSSVclTJNuR2RCK/8/J qbeufwFJcSn/0CSbBdkUqe8GlC9bqCEjp/SuasRVMn1fXjgDXS9YF9yLohB6zYDUO05VT2VtaNe5n m6uQxufkSeTVYucWS6YA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pieEP-00AwXh-0r; Sat, 01 Apr 2023 16:37:33 +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 1pieEI-00AwRk-2D for linux-mtd@bombadil.infradead.org; Sat, 01 Apr 2023 16:37:26 +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=301kFvtK4RtbC0nZ+yzzxf3wyF/k/mU8UZOl0iG7Pt8=; b=Oq/MYdHBBhToiBhv1/UrGxvu+v mggtr2hurbLTkTLpFxAqmKUMZPrIeA/l4bkRhDujDnQ5U/VmqUrmvobq26EOwWabNKJ1qftiGGGs/ xCxl3NX6jHUM0aRfpLwviOjYWjndnfN6bUhhj9fFBDgMm5VQdWh87uhZBcPjj3vikbWYk04bAgZGH 9UbbjeLj4dT6Ty0hVYINi8LSPTjhdUFni9Hi2RlpidyMJughOp2VtWTdWRde6RZuA3+TPCyZGUHZm iihWlhpUDbtekxKx7TuMipa3eHm0pc1QJsch39U8iozZBCwbKFayQ5TMzU4dUuwVoS8iif7AW/5On PuoTSCpQ==; 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 1pidxW-00CYSf-4g for linux-mtd@lists.infradead.org; Sat, 01 Apr 2023 16:20:13 +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 <ukl@pengutronix.de>) id 1pidxP-0000ME-Hx; Sat, 01 Apr 2023 18:19:59 +0200 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 <ukl@pengutronix.de>) id 1pidxN-008GTN-Gb; Sat, 01 Apr 2023 18:19:57 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <ukl@pengutronix.de>) id 1pidxM-009ki5-4s; Sat, 01 Apr 2023 18:19:56 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> To: Stefan Agner <stefan@agner.ch>, Lucas Stach <dev@lynxeye.de>, Miquel Raynal <miquel.raynal@bootlin.com>, Vignesh Raghavendra <vigneshr@ti.com>, Thierry Reding <thierry.reding@gmail.com>, Jonathan Hunter <jonathanh@nvidia.com> Cc: Richard Weinberger <richard@nod.at>, linux-mtd@lists.infradead.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 47/49] mtd: rawnand: tegra: Convert to platform remove callback returning void Date: Sat, 1 Apr 2023 18:19:36 +0200 Message-Id: <20230401161938.2503204-48-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230401161938.2503204-1-u.kleine-koenig@pengutronix.de> References: <20230401161938.2503204-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1816; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ZiZFcm2VIBzpJkDbD8DIuKg1PQYv1Ul6eBh2oA6JjdA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKFlTMtlZDjKeoygTPmrf6hZi+i2/pICmViBsi CEyn2O89+WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZChZUwAKCRCPgPtYfRL+ TkNsB/9QNZahdyLisGkG6jy26g0n4gYeXOUuhi1ekybIlVCO75qsiXWDUGQW4WmM5mx7lcyXmTi zoODOr5CJP8UuKYOqC2T2jSOGFvN2dKtLdh4mhyHaZNdyksoGw0rUCIfI1JlmtSXNo5HaAsp3hx PXoO18Q6yocN0esmIkwUnIOZ0PPelpNRn5cGrZ8zfQtvHPdwjdXGenW4tXgwEedXsr7erMiVqfQ VmPufDSQ4DtguTF2kXXQkReGR3+tjsotqqaYPkZtbkQg6Ak3c6cKKSQeP4x9pKozNhW1VPvTLKL d2fiVOEnWXUb+Fk2HNrSzLjffkCV8HB7RDN7zkf/V9leigQm 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-mtd@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230401_172006_239123_5AEBEA74 X-CRM114-Status: GOOD ( 12.85 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.4.6 on casper.infradead.org summary: Content analysis details: (-4.2 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] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -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-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list <linux-mtd.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-mtd/> List-Post: <mailto:linux-mtd@lists.infradead.org> List-Help: <mailto:linux-mtd-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org> Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
mtd: nand: Convert to platform remove callback returning void
|
expand
|
On Sat, Apr 01, 2023 at 06:19:36PM +0200, Uwe Kleine-König wrote: > 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 <u.kleine-koenig@pengutronix.de> > --- > drivers/mtd/nand/raw/tegra_nand.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) Acked-by: Thierry Reding <treding@nvidia.com>
diff --git a/drivers/mtd/nand/raw/tegra_nand.c b/drivers/mtd/nand/raw/tegra_nand.c index a9b9031ce616..eb0b9d16e8da 100644 --- a/drivers/mtd/nand/raw/tegra_nand.c +++ b/drivers/mtd/nand/raw/tegra_nand.c @@ -1220,7 +1220,7 @@ static int tegra_nand_probe(struct platform_device *pdev) return err; } -static int tegra_nand_remove(struct platform_device *pdev) +static void tegra_nand_remove(struct platform_device *pdev) { struct tegra_nand_controller *ctrl = platform_get_drvdata(pdev); struct nand_chip *chip = ctrl->chip; @@ -1232,8 +1232,6 @@ static int tegra_nand_remove(struct platform_device *pdev) pm_runtime_put_sync_suspend(ctrl->dev); pm_runtime_force_suspend(ctrl->dev); - - return 0; } static int __maybe_unused tegra_nand_runtime_resume(struct device *dev) @@ -1277,7 +1275,7 @@ static struct platform_driver tegra_nand_driver = { .pm = &tegra_nand_pm, }, .probe = tegra_nand_probe, - .remove = tegra_nand_remove, + .remove_new = tegra_nand_remove, }; module_platform_driver(tegra_nand_driver);
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 <u.kleine-koenig@pengutronix.de> --- drivers/mtd/nand/raw/tegra_nand.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)