Message ID | 20230401161938.2503204-39-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=kPkoC6P6; 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=mQlnOjI4; 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 4Ppj9L01lXz1yY8 for <incoming@patchwork.ozlabs.org>; Sun, 2 Apr 2023 02:22:13 +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=WuyqGiIJzfYd4FPg85iBBcEPc0wL5g+aSV5EJ0Rb8bY=; b=kPkoC6P6Ne5lpa nA+u/PtOGMPKPLaAxr+Jj6geKg6kWK0rR4jMjnZ6eeDFWJUS/F5fR6BmkthUE2+kQ3MXUr6JXDi0g 9fL+RnNeQu6gblBWe0zcu2lodMQ8VdyxC2uSHcGKBk+3qeS81iZrG9/BmADBXliT2n4O/IrqBWYUy INqmB3mI/qTki8kmTsW+JrxhFAqdKro7DGuhcDIJ3q2w7pIO6OzDybgLu+KRGm4SAFyCRkzLHzA4O UDcKAeo3enHT4vP6kbBbNtf2c4VfhvMfs5XIMyM7wU7nrklQI2liHQgv/0FvCnP9/vC+I/0Y0CD9F ylJ/12y3TdVI9N5eQU8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pidz5-00AtKq-02; Sat, 01 Apr 2023 16:21:43 +0000 Received: from desiato.infradead.org ([90.155.92.199]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pidxg-00AsJV-0Z for linux-mtd@bombadil.infradead.org; Sat, 01 Apr 2023 16:20:16 +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=/O11WgaS5cBOw6Rxe6DxWIEIPKTr28R/vgUioRrfmfk=; b=mQlnOjI4hJ0FRYj/ifrFcoxbrc Lhs3m/gTiu1AL/uRU+/JUva3GqRlJy/hIAPrE6B7YMb5Q4sS+5y4tfD1hnOmPWBYii1ocnvRPRElV OP1e1mwCTO8niEy5kz9XGVuywYuEjOfA7VAsoRxcsDH0YxlGSyZsn8WFZc19Txrs6qcsCAeZnrvHp EfmoXzO+mvQLtjSPdASmnF+nY//Ia99JstKuX0PG2AoYkoP7q+jVCBHjqwRudJR2YC9S3+rN2PQ7N DfQcBrQmB42zumwmRDq3L2PJV/VOZ2z8TYKMshaYgdM0dvUxxsiVTRN1VzW+gPIKjBlpI/eU33Nzr ny97+xcg==; Received: from metis.ext.pengutronix.de ([85.220.165.71]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pidxX-008DLR-1K for linux-mtd@lists.infradead.org; Sat, 01 Apr 2023 16:20:15 +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 1pidxM-0008Un-4u; Sat, 01 Apr 2023 18:19:56 +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-008GST-Tr; 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 1pidxK-009khV-7r; Sat, 01 Apr 2023 18:19:54 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> To: Manivannan Sadhasivam <mani@kernel.org>, Miquel Raynal <miquel.raynal@bootlin.com>, Vignesh Raghavendra <vigneshr@ti.com> Cc: Richard Weinberger <richard@nod.at>, linux-mtd@lists.infradead.org, linux-arm-msm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 38/49] mtd: rawnand: qcom: Convert to platform remove callback returning void Date: Sat, 1 Apr 2023 18:19:27 +0200 Message-Id: <20230401161938.2503204-39-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=1878; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=G28o7xn3QeMDu6fYFFRYPya7v5M/PkKU71x1+qlTeuM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKFlIoSNlhz8SuPP1vj89aETRFZubu7irTsjfo seAd3212iyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZChZSAAKCRCPgPtYfRL+ TlG6B/0ToTS5PmudnWMvPXc08gvHEHveyRmqI7ZmtdZLRYRCCj8qe8KsVhsQcsJTd73Z6ggGkOx TIW4NvZh9lWSMxLI5pd+hdAkIuoROHvfnlXH5VJXAYJf8qXO8NDozk4tiwuwB+tUDdDo/FIgeX4 JMKBWLS9FOnI0boY53KWw/Acb0j/SZBqN0emeA61Bko07JE/6hTwRtF6KXSzUp9tUdf9/4nzsJG XyO3X64lRIA591mmoYy9Mh28lXwszMvqT++JT83dKptAPuSNDT2/xvToXkCrISLTyi2xw/Q3gne MbcghY8XSx32hMyRSr9OehzOlAQAkKS0GGMRmET4yKitNY3q 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_704628_AFBC326A X-CRM114-Status: GOOD ( 15.94 ) 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 ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -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] 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/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c index 198a44794d2d..218c8a840e32 100644 --- a/drivers/mtd/nand/raw/qcom_nandc.c +++ b/drivers/mtd/nand/raw/qcom_nandc.c @@ -3315,7 +3315,7 @@ static int qcom_nandc_probe(struct platform_device *pdev) return ret; } -static int qcom_nandc_remove(struct platform_device *pdev) +static void qcom_nandc_remove(struct platform_device *pdev) { struct qcom_nand_controller *nandc = platform_get_drvdata(pdev); struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -3337,8 +3337,6 @@ static int qcom_nandc_remove(struct platform_device *pdev) dma_unmap_resource(&pdev->dev, nandc->base_dma, resource_size(res), DMA_BIDIRECTIONAL, 0); - - return 0; } static const struct qcom_nandc_props ipq806x_nandc_props = { @@ -3405,7 +3403,7 @@ static struct platform_driver qcom_nandc_driver = { .of_match_table = qcom_nandc_of_match, }, .probe = qcom_nandc_probe, - .remove = qcom_nandc_remove, + .remove_new = qcom_nandc_remove, }; module_platform_driver(qcom_nandc_driver);
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/qcom_nandc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)