From patchwork Sat Apr 1 16:19:15 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: 1764090 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=ZSFYa/b5; 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 4Ppj8J441Xz1yY8 for ; Sun, 2 Apr 2023 02:21:20 +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=seXNMmH3WPfGOPzca0K8KhPoYfHPvk959C8S5paCbhQ=; b=ZSFYa/b55lwqBp hws4LCDNSh2NuVgiAjRhSJR1sciZzgG+NjF2n6C1llZ6HiPD7BFBatU7QSQ/3wsblSpAdRoR9pizC 6kw4KLRQZ1gU8QbUW7VhV0bkpRFeY5rDL2tISvo2MtsnBbrheNRLuG4dkciAQA3+GLiY/TJh0Kw+c 4gQAfyWTca/Ao8PDfePM36IubmdWeOZItlXefAkomM+X3mUIGWudeYiI3j60U6NYQ+yh8zRgx3xN5 +D2bpxpBJFyGTzfME+xagfa/eHFUX1L5jYYi6UNAT284eSFjzn51bf8UeG9UEneOy/8VT6P/7Y/G0 WsoS3ADPMat3oYSk7yLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pidyC-00AsXY-0S; Sat, 01 Apr 2023 16:20:48 +0000 Received: from metis.ext.pengutronix.de ([85.220.165.71]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pidxX-00As9n-0T for linux-mtd@lists.infradead.org; Sat, 01 Apr 2023 16:20:12 +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 1pidxJ-0008My-PK; Sat, 01 Apr 2023 18:19:53 +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 1pidxI-008GRV-H6; Sat, 01 Apr 2023 18:19:52 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pidxH-009kgk-N2; Sat, 01 Apr 2023 18:19:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Miquel Raynal , Vignesh Raghavendra , Christophe Leroy , Phil Edworthy Cc: Richard Weinberger , linux-mtd@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 26/49] mtd: rawnand: mpc5121_nfc: Convert to platform remove callback returning void Date: Sat, 1 Apr 2023 18:19:15 +0200 Message-Id: <20230401161938.2503204-27-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=1819; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=HHKBs+ztWbaNRbFQg/27JaTmEYNnysEvMJ9/PAQExiQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKFkmFXTn26zDrLiPe+3+6NktgHh9H2lKUtR+B roDK/oGw9SJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZChZJgAKCRCPgPtYfRL+ TrA+CAC5dAbqyTuQccLXX2vjaKYRQWFG3gDV79iIGx8gGKPW/AnhRxA3dAlHX3l6JCrUttMB5E7 qxbwE/lN03yQlHswDTic2gtrztelwxhxVBQhi24XNhNi/Dj+B6YEduEA2938ulWIBzdOveIiFH4 /K17o2u6doGzio6YdY5OULlwW1yT6tFdrUfVMhQpw+mWIzyVLn34nWpCPIYjkZoA23sG/KHowBB TKnr0k0/qRmoyZ+xCiDKuWUZRVxzhDmWprHVo9Uv0URLVUWfCsinIrHBNefTl2Bv5Lx9dD0fBid WgziUmjj0hgIElkBu2xs6+yU470as+kNvEYethb99UybJcrT 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_226465_9896044D X-CRM114-Status: GOOD ( 16.73 ) 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 [85.220.165.71 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/mpc5121_nfc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/raw/mpc5121_nfc.c b/drivers/mtd/nand/raw/mpc5121_nfc.c index f68349cb7824..ab05ee65702c 100644 --- a/drivers/mtd/nand/raw/mpc5121_nfc.c +++ b/drivers/mtd/nand/raw/mpc5121_nfc.c @@ -822,7 +822,7 @@ static int mpc5121_nfc_probe(struct platform_device *op) return retval; } -static int mpc5121_nfc_remove(struct platform_device *op) +static void mpc5121_nfc_remove(struct platform_device *op) { struct device *dev = &op->dev; struct mtd_info *mtd = dev_get_drvdata(dev); @@ -832,8 +832,6 @@ static int mpc5121_nfc_remove(struct platform_device *op) WARN_ON(ret); nand_cleanup(mtd_to_nand(mtd)); mpc5121_nfc_free(dev, mtd); - - return 0; } static const struct of_device_id mpc5121_nfc_match[] = { @@ -844,7 +842,7 @@ MODULE_DEVICE_TABLE(of, mpc5121_nfc_match); static struct platform_driver mpc5121_nfc_driver = { .probe = mpc5121_nfc_probe, - .remove = mpc5121_nfc_remove, + .remove_new = mpc5121_nfc_remove, .driver = { .name = DRV_NAME, .of_match_table = mpc5121_nfc_match,