Message ID | 20230401161938.2503204-32-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=p1+s640H; 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=aTWAn/tS; 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 4Ppkl04rCbz1yZG for <incoming@patchwork.ozlabs.org>; Sun, 2 Apr 2023 03:33:00 +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=2tC6NBMWXawnyZNsFQjKrjMWG90uxnaOcP0xZiG81xQ=; b=p1+s640HeWpiTy ISTIGl8fdR+QeH4H0MLnytWv/3qqTcr1o9vlP7ZYbBRQ+mD3F2fNO082DBkbG3m9xPLOVgNGVIvYC yXpCQJqWYGxIjb7dkmtUQPeOIwyChYndMfr+Mq7EGeUxGorittZ25yg2CAWMVgtROXR3S2VdBp++X /l/PLkoWsSHQLCzk9PdbENMSappQCvcwPDHoPpjipRjvIbgp3DYTy4YWOrRoKyBUSwq3O9Fxm0Byh ylxJzUmlDrBgA6BK1yhxZNAMCUqU++RpO3w8xbXn2sgg0+qtIiMWbB+f2e+r21cwJ6iHUFFdewRp8 oeNpblCMfG8i7elKiHFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pif4n-00B2QL-2J; Sat, 01 Apr 2023 17:31:41 +0000 Received: from desiato.infradead.org ([90.155.92.199]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pidxd-00AsHa-1u for linux-mtd@bombadil.infradead.org; Sat, 01 Apr 2023 16:20:13 +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=NCE/ldrxSa+FF6qnukQ2DHKY3ZdJE+sGfGdk1eIOhBo=; b=aTWAn/tSoAPtdVtUFAGdCUxWxp GYWluIRVAUmft8XRI73DfK4t+lAnwzL/M1SmMqs243Sp3+qfKZhGYgUUdgTt2+8oxEj2VwZmcpk1i 7p0QAPA+gUHEzerejJPaATgJ3ugIcFWCHE6xY2mLQM0Y+V0nnhnPMKCNhi3gZx8y5oqPBXDF1hb9d zVCkPzDvqdd6X6qe2BLqpXp+Gzn9Hs197DRbP0zzJhqWhwgZEmRvAx26ZUhD7UD5XyYDiZ6zKqykV 0NxUd6hto6gCUKCTIdpzeu0VQm1AaTwfjcd0YvFJD+jdHZ+WGG9HjvJ1oW6e2OU665xaBLt1glmzV mpAQrOGg==; 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-008DKy-31 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 <ukl@pengutronix.de>) id 1pidxL-0008Pq-0d; 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 <ukl@pengutronix.de>) id 1pidxK-008GS3-0p; 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 <ukl@pengutronix.de>) id 1pidxI-009kh5-Pv; Sat, 01 Apr 2023 18:19:52 +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> Cc: Richard Weinberger <richard@nod.at>, linux-mtd@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 31/49] mtd: rawnand: omap2: Convert to platform remove callback returning void Date: Sat, 1 Apr 2023 18:19:20 +0200 Message-Id: <20230401161938.2503204-32-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=1830; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=TjwsYyVXkVzqjG2vivAFKm41kuR5ZKJlPg0Vh5ce9Xw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKFk2eS8BmfIUsjae7lovOqs/KE4sctEFcpuhD jsnTdErsNiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZChZNgAKCRCPgPtYfRL+ TgxDB/9P5lfFOlz9gSWDpu1e0hHgB8Sxwz0uFI0rklSMd69NOkDXXfVc9Q9B+V3ynogYMmt3o8g C5yuiLfLZF7+criDceHGQUIUP5561t79iEpurCoQdMvA29T8McJ96JSKo3KvsECMQrAzr9sSnNs +5WvTiJW4ViDwkHyuttKfd5CKYmug+gt+sBppv4iQuBG0ixrCqDYzNpyo4y1Jj2B5N/jA/INaWS C8a/eYcTrJPlv/a9A178tcfLqPawZmzXFYQ2OXjC4dKoIeIevlL/DAftkF13dxPq7VVu1m9RQzo kR817M0i94y/slVFighOFUuj7lh5292uS+qp398+mJg9h8NH 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_217616_C99D953C X-CRM114-Status: GOOD ( 17.10 ) 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/omap2.c b/drivers/mtd/nand/raw/omap2.c index 4a9f2b6c772d..db22b3af16d8 100644 --- a/drivers/mtd/nand/raw/omap2.c +++ b/drivers/mtd/nand/raw/omap2.c @@ -2273,7 +2273,7 @@ static int omap_nand_probe(struct platform_device *pdev) return err; } -static int omap_nand_remove(struct platform_device *pdev) +static void omap_nand_remove(struct platform_device *pdev) { struct mtd_info *mtd = platform_get_drvdata(pdev); struct nand_chip *nand_chip = mtd_to_nand(mtd); @@ -2285,7 +2285,6 @@ static int omap_nand_remove(struct platform_device *pdev) dma_release_channel(info->dma); WARN_ON(mtd_device_unregister(mtd)); nand_cleanup(nand_chip); - return 0; } /* omap_nand_ids defined in linux/platform_data/mtd-nand-omap2.h */ @@ -2293,7 +2292,7 @@ MODULE_DEVICE_TABLE(of, omap_nand_ids); static struct platform_driver omap_nand_driver = { .probe = omap_nand_probe, - .remove = omap_nand_remove, + .remove_new = omap_nand_remove, .driver = { .name = DRIVER_NAME, .of_match_table = omap_nand_ids,
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/omap2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)