From patchwork Sat Apr 1 16:18:57 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: 1764077 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=ryD6x7zw; 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 4Ppj863sjmz1yZB for ; Sun, 2 Apr 2023 02:21:10 +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=ZKnI2NX/SxHx3ywXKcmJAqofbzu4VYbG2aGZRwx16uo=; b=ryD6x7zwIBSNwa bnCSb3LuH07qR0UfZjgmANmmLwrmr8KwuHKl2omRO4A0nISriNcl4UxbimnoKe1i0Yx6AMvWEDcEn MEQoknD+TjiVjKEKedanQbRFC/4rElf4MfCc4cJeriqvj3AGqeT5jEMAzHxub0a65jZi6cV2l14UE B1PhRXaxdc4MjPTyPHVADhRM3BzIIOiZMIRJu6ME/rJDl+cKrfnWvB21GhBlZcqvLureqIwGA1GAq QEq2avTGOG+4E30IHFJ394K+xZe2Zq5r8wwobHzsk5GyyanwsE2VHSdrz5EzgieqWnAFCl57eVpyG W5LTn1MMTjzoAaZus96A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pidxi-00AsKS-0b; Sat, 01 Apr 2023 16:20:18 +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-00As8s-01 for linux-mtd@lists.infradead.org; Sat, 01 Apr 2023 16:20:10 +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 1pidxF-00089h-E8; Sat, 01 Apr 2023 18:19:49 +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 1pidxE-008GQ6-Q9; Sat, 01 Apr 2023 18:19:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pidxD-009kfZ-SJ; Sat, 01 Apr 2023 18:19:47 +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 08/49] mtd: rawnand: au1550nd: Convert to platform remove callback returning void Date: Sat, 1 Apr 2023 18:18:57 +0200 Message-Id: <20230401161938.2503204-9-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=1774; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zR4KJcDy8DkDRPFs1TFovFy1Y4Ig2wiD2/77Dyp2h2U=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKFj50iV5z22Ij3VWT5Jk2bjBtZQYADW+rSmBB po/dg74IwOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZChY+QAKCRCPgPtYfRL+ TnzyCACnrlfh5M2+y32Bxp4PUl4qUj/6G/it024Td4JAHKb/m4yuC3V0tHnQU4rfxhmGjDk/qWm YhufUjagstjKhCLhS1OErPHn0qvFKZd5m05aF2cIdfc7KI2581ulQ0O4ELAXSeuHk7QcjwzVGQX kfoGAkwxod6ZLLtZuB5QaRpWsDpQ7ao9vD4ZNG7zdJ3Y5rIVATwtIDROVnrQoAITtrnrIge98Yt OK3pt2QL0I6TzoQohv3gM0F7+NrPQgp71UWX+CRI+GL57k/L4KSpf6f/K1E8IOI/R5lQrKrE/jU FygcYIBTVqqsRfF7JmEvygfwHIJFQzPt2eiRM5w0VVXqj2xZ 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_062644_EBB23E09 X-CRM114-Status: GOOD ( 16.59 ) 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/au1550nd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/au1550nd.c b/drivers/mtd/nand/raw/au1550nd.c index 5aa3a06d740c..063a5e0b8d4b 100644 --- a/drivers/mtd/nand/raw/au1550nd.c +++ b/drivers/mtd/nand/raw/au1550nd.c @@ -337,7 +337,7 @@ static int au1550nd_probe(struct platform_device *pdev) return ret; } -static int au1550nd_remove(struct platform_device *pdev) +static void au1550nd_remove(struct platform_device *pdev) { struct au1550nd_ctx *ctx = platform_get_drvdata(pdev); struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -350,7 +350,6 @@ static int au1550nd_remove(struct platform_device *pdev) iounmap(ctx->base); release_mem_region(r->start, 0x1000); kfree(ctx); - return 0; } static struct platform_driver au1550nd_driver = { @@ -358,7 +357,7 @@ static struct platform_driver au1550nd_driver = { .name = "au1550-nand", }, .probe = au1550nd_probe, - .remove = au1550nd_remove, + .remove_new = au1550nd_remove, }; module_platform_driver(au1550nd_driver);