From patchwork Sun Dec 17 14:29:35 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: 180017 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp733589dyi; Sun, 17 Dec 2023 06:32:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/GpJI70YldM9i0NgXvQtCixKvp+/R1OsqSmo0IOMXnnT8VwxA07JnxZ/bVXKBS6sUu1DD X-Received: by 2002:a05:6a00:3099:b0:6ce:6b7c:ba1b with SMTP id bh25-20020a056a00309900b006ce6b7cba1bmr13265872pfb.60.1702823569719; Sun, 17 Dec 2023 06:32:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702823569; cv=none; d=google.com; s=arc-20160816; b=N2u5csfg48J98jN4ZOXfadPR7/MfcAFFysLwZpee9hr+9WFt2jHZHGq9MZRMZr/uVS vmtR4rHt+30EVDGbUjh8UBtR+D0LKDQzl6/AkR/NNihw50SkplE0iEotxeGA+71YNGxn vuo+s8pDE5hQr0sGL6HidvW6veEdnTefCvE3Nr1Jc7YFbdwMSnBNDVq4V56kP2l17R5b ob0LDiwxM7aDjbSvDPbFRZjD3Mr1UUtScIbq/MBuHQkD5pGIvOa01lxMzkoTzjQlWw1u 9UYmvKpH/b6ah1K2n3CWCDkw+hqPzHLJgOkYeFMAJCSTr5Jt54T1QFjvzbLSQ45u3aBq GuaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=QHArEJAR8+lz3+RtGspIM0u+Mn3j/hP8FpMKesgZ7oU=; fh=e08qmhSPRKoDoCS9mOXl3SU+TueaIFtaf9hHDo9WBfU=; b=U1Y76tRJ9oW3Ldf80yMfrsi70Rsgd3r6ZfNGwpJC7sxeVFlVtpSkQWDCyRQyy6NqVi Bi8APKh5buq5lsOceShTzrHms2hOkmxbIecR+kqKGhS1fT2tyn/GMMha0IEWpaxHjMgR 5SI06ZzxtDkBzqrzwGA5jebVU0Mo1ymXKjUFCOzIuDZk5NwlBsGd8bFjA0sgzhJAwv+n 4ewyH1CiIl63SfLUtV6Xd+iiNcxYRrCzzn38EfGvRwP6FUlVFhKg1tXOknhGuSscinA/ nUX42PTNdpK42tWzA4Lsd9WChQ4E7JCcfXYizFUVgYNOzpiXIgWY30X97zX+qZBgJsSZ O/6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-2631-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2631-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u7-20020a056a00098700b006d693cb47b5si695536pfg.335.2023.12.17.06.32.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 06:32:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2631-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-2631-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2631-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5D36AB22205 for ; Sun, 17 Dec 2023 14:32:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65DE7481D7; Sun, 17 Dec 2023 14:30:24 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5401444C8C for ; Sun, 17 Dec 2023 14:30:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9e-0006WA-83; Sun, 17 Dec 2023 15:30:06 +0100 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 1rEs9d-00GUhZ-Ri; Sun, 17 Dec 2023 15:30:05 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9d-004hzO-Ic; Sun, 17 Dec 2023 15:30:05 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 09/15] memory: renesas-rpc-if: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:35 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1725; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=ZMDbiRa3FGTihhO4tO5ODGE29OSsGDt4kVGBu1a2R44=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXPj3UhNZgDNyg4+9bkx2WCA2L43Uy2kWkf2 vpluzZRuM2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8FzwAKCRCPgPtYfRL+ TiKUB/9qljxV2MeMzDUCTbF/CisoK5J7jGBMJKNKmSczc/ZId0wNcKIE/ZII9SiOa0sXgMqooq2 hdXWYXREWg4OuL+Q6yATWPNRJbgu8AcnTbBzxW5mdOnDUVjyH7XYjNdBeoddZQ4pO/c7GDbsJA9 9CXDI67v2k0lSPlOdxGxcw5FHk4jIV45aIdEVvr3YMxoAsM8TkKU8GU5hEyushutaxsNLJybyK5 06XicsJma81Z0Pxc/yJoTw3FJGgjhPQhkJyYpMPnHsEkDeSgQWmeJ+em1rCWYx+ldaoogQ+12FC 6oEs0QakXakB0gOgxA88WgRQdXWMH+NxXbJ/J+AYFLn9x/mv 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785539927618166323 X-GMAIL-MSGID: 1785539927618166323 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/memory/renesas-rpc-if.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c index 9695b2d3ae59..3167826b236a 100644 --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -777,13 +777,11 @@ static int rpcif_probe(struct platform_device *pdev) return 0; } -static int rpcif_remove(struct platform_device *pdev) +static void rpcif_remove(struct platform_device *pdev) { struct rpcif_priv *rpc = platform_get_drvdata(pdev); platform_device_unregister(rpc->vdev); - - return 0; } static const struct of_device_id rpcif_of_match[] = { @@ -797,7 +795,7 @@ MODULE_DEVICE_TABLE(of, rpcif_of_match); static struct platform_driver rpcif_driver = { .probe = rpcif_probe, - .remove = rpcif_remove, + .remove_new = rpcif_remove, .driver = { .name = "rpc-if", .of_match_table = rpcif_of_match,