From patchwork Sat Apr 1 16:19:03 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: 1764097 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: 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=) 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=qp+HyN9F; 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 4Ppj8g11yMz1yY8 for ; Sun, 2 Apr 2023 02:21:39 +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=ZxOt64Et4SLZ8fcaGsAIUk5Whocici2yicPDWevbLIA=; b=qp+HyN9FtX4BpX 3IBSpxc03bnHs6fxlhk7X4GT9oaYe/2O5dgMqDua8e0gmGDdzZwLmaZQHJugPHqBLD8JIEzKiGOtC W/M7u1bXuD9S2LHISVCt/g55Ry3a0yudnb/PdQ0NW412bLY+ty6CeYQM6Ksjvg/Of1tIg+8OdrSGW n1NPsPlOxLmpxsdw7e0jn9J9Hpvlp9uS9nrof66+vToqQoVl79xZxijn7e6PKZvO3lyNg3f66BBek yAJKQw+bKYOUuB49i0SOjD5Df07kcf6uk9tCbylbq3PjCgoHjnTpqXHf/rXw26v/+5Nfra0IYIfcA 7LvM1HD1JQZCS3IWKf5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pidyU-00Asog-1N; Sat, 01 Apr 2023 16:21:06 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pidxX-00As9E-15 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 ) id 1pidxH-0008C1-1z; Sat, 01 Apr 2023 18:19:51 +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 ) id 1pidxG-008GQZ-3S; Sat, 01 Apr 2023 18:19:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pidxF-009kfw-5q; Sat, 01 Apr 2023 18:19:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Miquel Raynal , Vignesh Raghavendra Cc: Richard Weinberger , linux-mtd@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 14/49] mtd: rawnand: fsl_ifc: Convert to platform remove callback returning void Date: Sat, 1 Apr 2023 18:19:03 +0200 Message-Id: <20230401161938.2503204-15-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=1828; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=tILjMWwXKfgbmOVfr+Iz7CPm8Wx8v3dtR1CS5qHAr7g=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSNiP9t8//NLPvoMNNUk1mlNO+lYWezttwVjZknvtZtM cntihToZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAiS0TY/ymFiJwuUOPVWihY s5TLwSFds8Aw1vrk740fLBXTsvOWiJxyKgqM3yUQq/37916VP/ktjx0iG0O2BPUw32k9lv2u8cg 7yQCztD8MUdwF9vH7VweEWH38+pb9zJlF91as/Og8XcTqG5P/3Ujry/NsV1zXsr0UUJTwV6XArJ yzel6K/yu7mpQlwT6s8hKu2zRPpKn8P7Mo+9hsLsNZ89g4AtZt8Vh8SODXar99UmunP2Jd7tz5Q fPNST/lSwrqG3+n1L2v4JHoV56WXWgxPSwrwU1SX+S8dqXdvM3TlBRbL2Vllj9buNnphOL9h1uN pi1zvBHmMGsP2z8hY/3dxZoTklsVJHgiz3OLzg4V/mwIAA== 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_092007_434211_665284A0 X-CRM114-Status: GOOD ( 15.86 ) 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-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=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 --- drivers/mtd/nand/raw/fsl_ifc_nand.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c index 02d500176838..fa537fee6701 100644 --- a/drivers/mtd/nand/raw/fsl_ifc_nand.c +++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c @@ -1094,7 +1094,7 @@ static int fsl_ifc_nand_probe(struct platform_device *dev) return ret; } -static int fsl_ifc_nand_remove(struct platform_device *dev) +static void fsl_ifc_nand_remove(struct platform_device *dev) { struct fsl_ifc_mtd *priv = dev_get_drvdata(&dev->dev); struct nand_chip *chip = &priv->chip; @@ -1113,8 +1113,6 @@ static int fsl_ifc_nand_remove(struct platform_device *dev) kfree(ifc_nand_ctrl); } mutex_unlock(&fsl_ifc_nand_mutex); - - return 0; } static const struct of_device_id fsl_ifc_nand_match[] = { @@ -1131,7 +1129,7 @@ static struct platform_driver fsl_ifc_nand_driver = { .of_match_table = fsl_ifc_nand_match, }, .probe = fsl_ifc_nand_probe, - .remove = fsl_ifc_nand_remove, + .remove_new = fsl_ifc_nand_remove, }; module_platform_driver(fsl_ifc_nand_driver);