From patchwork Sun Oct 8 20:01:43 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: 13412781 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B1D7E95A67 for ; Sun, 8 Oct 2023 20:02:51 +0000 (UTC) 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=WuGIhh/fdACMwFCjZ9WZa7szatGkI692H8SZBR8B8y4=; b=qShXFXsdb7aDo0 MoPVXp/1D13XDF+Dx9LGJ2CBCTcUPI0+8B5TV1x90uhAGuz5HjsakPaSAZhYKV2h4QbzXEIflih/T A3oK+6JUCizcfNdFoyghcZ8yWQpqwASx1O5KEQQNOruYYhgChiQ0BjucUMc32IdsnyTFYt7AIkj44 lBWWXjkna3SDUccuW54aQ0yQRbx2iv2B6UxRGNwR7c54cBPIC92g3iOrJ8awI140H3SxX+mf/G+63 /UqWZOBmBWhbJtcteXTQQ90EDkP54DwPduWLFztvRWJUvb8gpkxNsuxm+QMqDuk44Ve8cj8r/Kv3c dxd65FNdBL4he3KSgfXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qpZyq-009E96-2u; Sun, 08 Oct 2023 20:02:24 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qpZyp-009E6F-2C for linux-arm-kernel@bombadil.infradead.org; Sun, 08 Oct 2023 20:02:23 +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=nRdVP1nIh27NhlHt0t4rQB7SM7vFaHK6e8G6dG+AdS0=; b=jPyYKpbXZXO3k09boRuY/Psu3T 2sZxB9sGAuiLBKSQKWrj4gfiGy/64vcHftnxbidMMkCujSCeTvshmmLsuXlSa3O6DF5dYmVlZfGfu PdzTc9QVvMipuHbWU/JlVEaieOCns/nJdEV9EAvSRsBTZ991iiyAfhpB8esD8Xjw4GGxPzTIvyEFC YlS4rsILbDuDTu5F1aHZLttUXJim7uOl1UagRH0XuobyYQXYr+rX8XsQxGbhtZKB1EGfDpvl9WXrF ALQo+4W3T2S7JqYeUy3FaaWopYSajLW/+J4U+F2N/4vtUAmMzxVKghsoBGB54Bu3dhZcksMgRp+Bz QAlU6v3w==; Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qpZyb-00ExWH-20 for linux-arm-kernel@lists.infradead.org; Sun, 08 Oct 2023 20:02:20 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpZyS-0001jy-7z; Sun, 08 Oct 2023 22:02:00 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpZyR-000F0J-6O; Sun, 08 Oct 2023 22:01:59 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpZyQ-00Bf1I-TB; Sun, 08 Oct 2023 22:01:58 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Vladimir Zapolskiy , Tudor Ambarus , Pratyush Yadav , Michael Walle , linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 20/20] mtd: spi-nor: nxp-spifi: Convert to platform remove callback returning void Date: Sun, 8 Oct 2023 22:01:43 +0200 Message-Id: <20231008200143.196369-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231008200143.196369-1-u.kleine-koenig@pengutronix.de> References: <20231008200143.196369-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1821; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=naz45ZlLPwuwObvGjtIvJZJclRSSvFqpgxi8Vbmk5oQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlIwqgidnwISLnn2wlQt26cGtIzR7Y6RfHiW5ew nWe+F3AGviJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSMKoAAKCRCPgPtYfRL+ TpZLB/wMwRsJwHP5D+q/AN+C7fE2cZticbk4ps8j7K6f/A+ZuDkYkXnnxY8rkLY098OXTKNqg6k k4UWUeBEwapzxprlQulJ5QCDqFhgr7L7+amLT7D6ovilKTlYhabfqKR0ppMJT8qFsDore19Mc06 n2lWdKEI9xDgDdjXOHO4BFgYe7keLLrh6qQ15PsRRfN5+yn+pWE1Eey9a3g1ypjqXrhhIjDqW/6 icqS/G63POyYuDDfNWBZ9LnEXWoSvU2H99F6Jm0agBsNrSdlWmk7Kp5ASvmZvbzdLpxwFoaCjsm 4lvzmOubUyGt3KquyDUIYH1td9UO/oquiQSZJ360Xs7lCGeo 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231008_210214_632963_384E9E9D X-CRM114-Status: GOOD ( 16.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). 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/spi-nor/controllers/nxp-spifi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/spi-nor/controllers/nxp-spifi.c b/drivers/mtd/spi-nor/controllers/nxp-spifi.c index 5d8f47ab146f..5aee62f51031 100644 --- a/drivers/mtd/spi-nor/controllers/nxp-spifi.c +++ b/drivers/mtd/spi-nor/controllers/nxp-spifi.c @@ -431,13 +431,11 @@ static int nxp_spifi_probe(struct platform_device *pdev) return 0; } -static int nxp_spifi_remove(struct platform_device *pdev) +static void nxp_spifi_remove(struct platform_device *pdev) { struct nxp_spifi *spifi = platform_get_drvdata(pdev); mtd_device_unregister(&spifi->nor.mtd); - - return 0; } static const struct of_device_id nxp_spifi_match[] = { @@ -448,7 +446,7 @@ MODULE_DEVICE_TABLE(of, nxp_spifi_match); static struct platform_driver nxp_spifi_driver = { .probe = nxp_spifi_probe, - .remove = nxp_spifi_remove, + .remove_new = nxp_spifi_remove, .driver = { .name = "nxp-spifi", .of_match_table = nxp_spifi_match,