Message ID | 20230401161938.2503204-23-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=sYpW2wdX; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=hWccJAjA; 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 4Ppj896Jr3z1yZB for <incoming@patchwork.ozlabs.org>; Sun, 2 Apr 2023 02:21:13 +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=Dq6+3cLPH3RYIhypk1n7ILUuIVK/bZDYjZW5lX261nc=; b=sYpW2wdXAEHsVA 8iCp9LW+d+Vp+scmuSTCBVRGns5pDQ4lj1uffu/TZn/4NKO0LIaNUd8qXnfb/0sySK2CcYbzgDs7Q LOUng4Nc8cZzL898+R4iVUyg/4SAzTF9UShCl6K4cCZXFLX0jZeeFKUtFDVRFtr7HZYWHDhrB/qyc zy2jpEgK3Y18RQJn2UWAzjLI7tO5Pryzyl0fzhCpGbOls2bvTeFIFZFYTBEECuDXPoTr0O1Fb+qAp qw5B1mLcdQJ5lhUODAiNgxFXjpMbCcUJ5n3Bp2UBW3YTS92dtuEqJ8Jmj5TUknt9drnke2BqS1EQj GnjT09jPT/wI1dDXAN4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pidxn-00AsMd-0A; Sat, 01 Apr 2023 16:20:23 +0000 Received: from desiato.infradead.org ([90.155.92.199]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pidxb-00AsFu-02 for linux-mtd@bombadil.infradead.org; Sat, 01 Apr 2023 16:20:11 +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=82OGQX4FQHKXC/0gh6rSGyigQm/ixNj7n6g/PqGRZFc=; b=hWccJAjAyD0Qyjx0+EgoPdEn0d OFDWMJNJt8N+9LrnBYdEzU+jzMamKOjjSwb+Tn9YORQkl8d2ojLmbO5424yvdYWJkf6bQ+0I4Zr7V 5lQLX2Lm2LwRizajZopNwQlyxNt5Uobx1mjPVXwdzNBI26kwyNAhBxwgYRlgN4sehC11454R3DyBQ A2wqWchq4k2pBOXNldhAkI3YTqgDAZLaL+gX7JCzM4M6vP/TDOGiQJxTx4H8YCNFqc7jV9ztYBhcq mtEERMyKRYDVpgY+32PEyI+bie42NIRvJ7vtSTIEzUx8kanWIVeZVFrdFV0PlGLMNlzvEGWJmk9nP F3OssBbg==; 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 1pidxW-008DKx-1G for linux-mtd@lists.infradead.org; Sat, 01 Apr 2023 16:20:08 +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 1pidxI-0008JG-Jd; Sat, 01 Apr 2023 18:19:52 +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 1pidxH-008GRD-L5; Sat, 01 Apr 2023 18:19:51 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <ukl@pengutronix.de>) id 1pidxG-009kgS-QD; Sat, 01 Apr 2023 18:19:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> To: Miquel Raynal <miquel.raynal@bootlin.com>, Vignesh Raghavendra <vigneshr@ti.com>, Vladimir Zapolskiy <vz@mleia.com>, Geert Uytterhoeven <geert@linux-m68k.org>, Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Richard Weinberger <richard@nod.at>, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 22/49] mtd: rawnand: lpc32xx_mlc: Convert to platform remove callback returning void Date: Sat, 1 Apr 2023 18:19:11 +0200 Message-Id: <20230401161938.2503204-23-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=1879; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=TWFefpDxHWfkuMQsZUU/YYnQA1Ncz9g/YAZzkYUP7N4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKFkd8KJ2FC0m02q7GglRFellH7wX4OKY4WkZK fheCZgA7i+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZChZHQAKCRCPgPtYfRL+ TvECCACow5b8t+Hq5gDTf6e+tnBdhSOgrsnyqDBhEiYEqa77h150Sgy1x+wfRmsH5/b88M4R4WD 8qKRyef2PAKE55ATKvBO68X0fZqz5iO85iunO+VG58sH+4wzGbUjrWcmrVENgZgWhPh55dDADA5 GJdr6qn9zRKR+b982z12byIVLj942NSZTVNwAlSNk2bHOE+gMJYR87UFWVze+MOxm9zqZYpECFX ROd4IiNuKolA0ytb9DVyK+t7Wl4rN2gzUgsavWjDRpcoI9z33qAlwPwwfaYKzc4zNexhTMWEhfQ h5XWkNg/OZ3N6f6vG+ofuD1Z3FiUEAy4KKvcjf9M0Xb5boak 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_626945_54B03295 X-CRM114-Status: GOOD ( 16.28 ) X-Spam-Score: -2.3 (--) X-Spam-Report: Spam detection software, running on the system "desiato.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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches 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
|
diff --git a/drivers/mtd/nand/raw/lpc32xx_mlc.c b/drivers/mtd/nand/raw/lpc32xx_mlc.c index ae7f6429a5f6..b3136ae6f4e9 100644 --- a/drivers/mtd/nand/raw/lpc32xx_mlc.c +++ b/drivers/mtd/nand/raw/lpc32xx_mlc.c @@ -827,7 +827,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) /* * Remove NAND device */ -static int lpc32xx_nand_remove(struct platform_device *pdev) +static void lpc32xx_nand_remove(struct platform_device *pdev) { struct lpc32xx_nand_host *host = platform_get_drvdata(pdev); struct nand_chip *chip = &host->nand_chip; @@ -846,8 +846,6 @@ static int lpc32xx_nand_remove(struct platform_device *pdev) lpc32xx_wp_enable(host); gpiod_put(host->wp_gpio); - - return 0; } static int lpc32xx_nand_resume(struct platform_device *pdev) @@ -889,7 +887,7 @@ MODULE_DEVICE_TABLE(of, lpc32xx_nand_match); static struct platform_driver lpc32xx_nand_driver = { .probe = lpc32xx_nand_probe, - .remove = lpc32xx_nand_remove, + .remove_new = lpc32xx_nand_remove, .resume = pm_ptr(lpc32xx_nand_resume), .suspend = pm_ptr(lpc32xx_nand_suspend), .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/lpc32xx_mlc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)