From patchwork Sat Apr 1 16:19:24 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: 1764100 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=dBl6Q3Nr; 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=qvH8WZWz; 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 4Ppj9C0Llnz1yY8 for ; Sun, 2 Apr 2023 02:22:07 +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=KCSQG2xPwkaBQ/afl4Nf1O9oMxbX7xEXmmc4HF8Nu6s=; b=dBl6Q3NrKzoEi2 8FwazCFsklwyJzwFo1ho+UNHKXnfKg5JH/sAQ9QXevvovNGefn5b3Q/ldowrHcF+jwM58mPByj72q 7tNoio6/2khcPRRIY2+6xEJY85glE3MruSGbzj/brx8VAjpgI7zWdEaS5MQv54/1Y0azHsSz2F1KZ Y6Ma40SCKFAdMptwESluCDo9M082aprMS5B8dqM/Uo189ZTyXgTcX8slNqUTYvWIaiTdEaCqYUPtB VfIQ35thKpqxhvtv3xGqIgfu+dvZUc6axQCtWbdraZLJmjljS55iBuUl0eTlbYPD2+O/vRU+WNyUK U8k1Y/KmYd7MLp+ckeLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pidyv-00AtBj-0x; Sat, 01 Apr 2023 16:21:33 +0000 Received: from desiato.infradead.org ([90.155.92.199]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pidxf-00AsIv-0P for linux-mtd@bombadil.infradead.org; Sat, 01 Apr 2023 16:20:15 +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=jrJiyKZF9kqAhMV8Ti7tWzbfe4xxL2DeSQ69bt3YA6w=; b=qvH8WZWzA+c4tVjREtX/LStBOf yrlbep6gEXHblJDYLQpPukv5k51OP05mWVXLd6pcwsfFqEttd9OJKir7uUK5a+1MPHsLXQXBd1fni +s6q2e5wBCOV+zZYYqXaD9AMeZnEfA2RRV6mupebRSCpd5jYwuuUGu3iAC5p93Vedsk7qLVKb8tsN 91gWganx3sgLV/R1CBGe/P4WPIwK+KUkUT9xSUQ6x01S/WLtXIlYyVQ4CO/PYL+0/50TfiktWb2fj AJcJ2EKDh674reMaOSeGIz5uf5ItxXVK0QtRaqywdiqVmq4Kz6Y/eYMngWO8UiBba8I+LS7BXqi2W Nc2CD82g==; 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 1pidxX-008DKt-0w 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 1pidxL-0008S4-Bh; Sat, 01 Apr 2023 18:19:55 +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 1pidxK-008GSK-Gc; Sat, 01 Apr 2023 18:19:54 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pidxJ-009khJ-Jz; Sat, 01 Apr 2023 18:19:53 +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 35/49] mtd: rawnand: pasemi: Convert to platform remove callback returning void Date: Sat, 1 Apr 2023 18:19:24 +0200 Message-Id: <20230401161938.2503204-36-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=1789; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rgBV6881M98FXTWkqugpWL04vASk/F42pNRXrgmXIWk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKFlFJ9oxzlBlf6V4uTLw8WDLIk+Qvk0gKyb+M wjxdszSaFSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZChZRQAKCRCPgPtYfRL+ TiQUB/9f+dwzu29y0r/j5ted0svXmvaEHiC+MlWSlj/nK9NVZqxxwKw99FM4IQ3s34LlU3pJg/k UA4+IGON9Ir13kD/fIdTlUbP94dEsgB5HIVmrXL0heMSQtCzD52+JLzPF2SsxTRbjbJex4nJ30/ J7YHSknMp+/YxxiSQ7EGUizkyqUik7ukQddRG/M2vRHYABPOjCYrHplIqIjC7UG6IxVCdELMwVX /idcZYLWVa1q/mPDfJ/oI145YckPNLC0bDg6hLwSDttYmqkGiOGlD3K/UOG09jasKyO7yN3iIcE jHEElVa56NFF/K99yYQr690k4B4ntGoYzQKxE4pPPdkcOefh 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_172007_607636_46F9C121 X-CRM114-Status: GOOD ( 15.82 ) 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 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/pasemi_nand.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/raw/pasemi_nand.c b/drivers/mtd/nand/raw/pasemi_nand.c index f7ef6ca06ca9..19b2c9d25863 100644 --- a/drivers/mtd/nand/raw/pasemi_nand.c +++ b/drivers/mtd/nand/raw/pasemi_nand.c @@ -197,7 +197,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev) return err; } -static int pasemi_nand_remove(struct platform_device *ofdev) +static void pasemi_nand_remove(struct platform_device *ofdev) { struct pasemi_ddata *ddata = platform_get_drvdata(ofdev); struct mtd_info *pasemi_nand_mtd; @@ -218,8 +218,6 @@ static int pasemi_nand_remove(struct platform_device *ofdev) /* Free the MTD device structure */ kfree(ddata); - - return 0; } static const struct of_device_id pasemi_nand_match[] = @@ -239,7 +237,7 @@ static struct platform_driver pasemi_nand_driver = .of_match_table = pasemi_nand_match, }, .probe = pasemi_nand_probe, - .remove = pasemi_nand_remove, + .remove_new = pasemi_nand_remove, }; module_platform_driver(pasemi_nand_driver);