Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp243524rdb; Tue, 5 Dec 2023 04:26:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQ5ZbRxTwXlv6KbR3HiJYbt8zK4vZK8BSQj6WwFdGAVYs/Osyw0Xf1RtxGXmR55b8ngywT X-Received: by 2002:a05:6a21:272f:b0:18f:97c:8a4d with SMTP id rm47-20020a056a21272f00b0018f097c8a4dmr5212656pzb.120.1701779219613; Tue, 05 Dec 2023 04:26:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701779219; cv=none; d=google.com; s=arc-20160816; b=yaShh4eHqcKHPulWeh4P1c/M6iNlouK6WiiUIkgaHsKzfYrBjcnBf5ESCBWNne75G6 1Mc7yJhYuS9IzvdB5wkZ7KyD0LnBW5nkIBgh4wGWIOqWp0j3qxBGVMCIeDBHPlkJJCzf qIaSQHeDmdS+mo5HOgNuORw3q/n+GAwd0lF9on2ZfMZRPFE6DmCts6+/MHaRKPTaFH08 2l21iTQsbsqalUYYFXMhek8Y3+7nBx0+E3JK/Xa8glQRMYWs4HQdBEiL8qHg1GKy3lRA DbgtZNyyv2cZt3jFwl74+iqomcSbwxR0bZEmlrBpalt9+YZgXM7FywVcVMVRXH0Vrln/ MfNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=D5NrSzna7INnsXccytkg94x0324E8SoI5WpimyzuIhk=; fh=+bOS7EAwdGBDNDi3DApgKxJaZ2RNm60AI+OqdQ0si9c=; b=i2Kc4FWP3vML7vwzYM65/zvYwUfWjGbEWhZOiv2doFIzdBU3mc7xqKLMCCd4Mj6KQY f2oZqGVWFln48ZTA2tEQSrWhgUHZcpX5iNO/s1ghF+x3Q7Mf5hvCQpanIX/6+l7ORpW7 LjilKychjY6fyaBImGjRXFw+HoVlD+0HXv5OlzVrM7UkKwvwLrVRujfWXYMMKL/3EVDy wV0myyyOi9kydDUHnMYKOjnBTLwiED1DZhaFz0PeFazlu8rCNeomZTdEuc5/SEEZVv2i 4AnmQdlb5USs6QMftjbqrnF5qj5EkthVYPhscGmf7brgfUZX+vefVW6icBUy6p+tfN4z TNkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b4-20020a6541c4000000b00557531eafb0si9218359pgq.559.2023.12.05.04.26.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 04:26:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 912D780C65CE; Tue, 5 Dec 2023 04:26:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235163AbjLEM0n (ORCPT + 99 others); Tue, 5 Dec 2023 07:26:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235142AbjLEM0e (ORCPT ); Tue, 5 Dec 2023 07:26:34 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A623C10F for ; Tue, 5 Dec 2023 04:26:40 -0800 (PST) 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 1rAUVY-0005YU-Jo; Tue, 05 Dec 2023 13:26:36 +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 1rAUVY-00DjvC-6i; Tue, 05 Dec 2023 13:26:36 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rAUVX-00EhR2-U0; Tue, 05 Dec 2023 13:26:35 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 8/8] regulator: wm8350: Convert to platform remove callback returning void Date: Tue, 5 Dec 2023 13:26:23 +0100 Message-ID: <1f7bbc545829a1cc3df40be0424fe46d7449fb72.1701778038.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1929; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=uGW+3kGg7E8CYPUZDYr0vtieqTGUZjfYrj/+nnZMeCo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlbxbvtvaXAKewk789zdSg231w7Q/drOBpuY49i mOQm03R7/uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZW8W7wAKCRCPgPtYfRL+ TqJ7CACEozsAbKkt6lOP19XV6OZ6tXJSH5WsUAVOfYvQohvM9BR+HeeUI22qYxq22wpvRnFEzkv SfTf/fyXYiifW7/88tlLg+5UpL6v+GCVQJMRsKJcJ5lvDDZYH7XfOTMz5PqNox/ZIXpgQf2ehRg gPaec0VE41ysvLW/I7AX9DUNbxL1aglPNYOYVzcrZkDviz+K+XDG3686mReIEcrOvpZE8bTapRA uNHH8sxlAug8ssCzBBvxtTLfJb5tkg/n7i9gEChJH6sg2l9CqN3RqlV4dUgzo1wJUJZEQOZlk2a GjHLKwB+BrdzwfT6RT7mnIKrJixUvZ50xBntzjKgnnKLMDPr X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: 8bit 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 05 Dec 2023 04:26:58 -0800 (PST) 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/regulator/wm8350-regulator.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 1445bafcab40..9939a5d2cbec 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c @@ -1158,14 +1158,12 @@ static int wm8350_regulator_probe(struct platform_device *pdev) return 0; } -static int wm8350_regulator_remove(struct platform_device *pdev) +static void wm8350_regulator_remove(struct platform_device *pdev) { struct regulator_dev *rdev = platform_get_drvdata(pdev); struct wm8350 *wm8350 = rdev_get_drvdata(rdev); wm8350_free_irq(wm8350, wm8350_reg[pdev->id].irq, rdev); - - return 0; } int wm8350_register_regulator(struct wm8350 *wm8350, int reg, @@ -1306,7 +1304,7 @@ EXPORT_SYMBOL_GPL(wm8350_register_led); static struct platform_driver wm8350_regulator_driver = { .probe = wm8350_regulator_probe, - .remove = wm8350_regulator_remove, + .remove_new = wm8350_regulator_remove, .driver = { .name = "wm8350-regulator", .probe_type = PROBE_PREFER_ASYNCHRONOUS, -- 2.42.0