Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp243629rdb; Tue, 5 Dec 2023 04:27:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHk5rczXTbWYJs5mNZ/WgGGm9Y4G4aD4VDbWrqXuxAP95r9ec6wtft1/EdawW0k1OcB03aE X-Received: by 2002:a05:6a21:1a3:b0:18f:97c:5b7b with SMTP id le35-20020a056a2101a300b0018f097c5b7bmr2422123pzb.73.1701779231058; Tue, 05 Dec 2023 04:27:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701779231; cv=none; d=google.com; s=arc-20160816; b=UZENyIRO312UnnfUT4h/yK+p+G1CqqLC/6b8dVQYe6UNiLFgGcoa/AnjBvgHUCi3zL Jz1na7AFe1DtNlQrEsFV0wP8g0S6SCPLU+6sV5wiMs3Vv0BqdtfJtvkKQwj6W/CFCUxT js3OUMWcggQJS+gN2KLgC+5VtLKubbJQuN+UaxF2cdf6vji/xgm2Ok1FlS+vDBqbnCw9 fCZ5mBZ3Okxj4ALjCIHxh7ysNGxZROPvEffAUPNpsecUm1EI8ihEdUSxKsXDSGwQnErP +YZkbWAfRFzEVr4y0qoXCz0olXE3p//ly4aO7CX7X8auq+S3hhAw9jtt9YaMzQxFYYOr vFBg== 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=iz4S9wGLtU367r9UzGRSB/QAT3ieU73xFVMSChw56e8=; fh=SV7jp/N4w5H/WguTuPXZpem2ktA8CMnlzZDNo6r9whw=; b=XjO5FkJ6QbQdRXKd9kYCGNBTePuAHj/s8SRiD9uOzH8bLULd+8oj9pgPM5KJ9H8Wpd N9fBaDtgciW5e9DflLX0gutIm9rAzbAAEExka5EQ4ik5uMAAy39WyZmWRpG4AUfwvMb8 C/kJndCP2DzEsbRdgBYj5XmQy2jWsVzyHnD5k0TZQr0FIjyEy0JC0m+IFK/JYCn1jxLQ TZv0XYGl7D1/Odkqljmu8GoqSAsz4GB9U1TVbMtiNwGc7hGFh/b65Kd5vvvewHOr7WQP Qe/a7fBzyd0Wh4mLnOF7r6fSvwiCTyiky9RKv6d6qpy3HgAMEpMXHJNO+KV5sDIJ+Kgp m0Gg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id g10-20020a656cca000000b005bd85b32495si9926191pgw.685.2023.12.05.04.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 04:27:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 95CC480A4AE4; Tue, 5 Dec 2023 04:27:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235166AbjLEM0i (ORCPT + 99 others); Tue, 5 Dec 2023 07:26:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231888AbjLEM0c (ORCPT ); Tue, 5 Dec 2023 07:26:32 -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 2783C11F for ; Tue, 5 Dec 2023 04:26:38 -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-0005Y2-7R; 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 1rAUVX-00Djv6-Qq; Tue, 05 Dec 2023 13:26:35 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rAUVX-00EhQu-I2; Tue, 05 Dec 2023 13:26:35 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 6/8] regulator: userspace-consumer: Convert to platform remove callback returning void Date: Tue, 5 Dec 2023 13:26:21 +0100 Message-ID: <89c5f261707bf178e1508cf5dd55121f0da2dc3f.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=2190; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=A8FP1XBHehjd8UZNqwQtALdNNbXhhXcBzW90wH3+wU0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlbxbt3vaMkK4LhyfDydpOLGLXDFYQBWohwmjpu 9scuU8+/uOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZW8W7QAKCRCPgPtYfRL+ TtCQB/9nVBvW/kdX4kAi9nIrvM74HxCnyXKpICHcrA/OS3LUZ9JMacf2aFINSrGVRFzqWXY6zbP CxwOkupHvIut6+Rgs5HyxXwT8sF4Dh/KpH5fKZ4/A7oEBEX8FXWauziq8vMAjxavImdQCLsNHd2 w9W+Qb7bBfW/c2SYnFwTyJ0aWamRJwT/ZkiaF7cc8buQs9HXbDSgtG4neFmrW1XSHOlCciPom8o cdPsI8kf4xyVyxY7BFDhtjO8ZnpQitWrMbU0V6Eh1FCtStPSnFDETH8Fig2KLG2+Q/ymECJn8Z+ 3CtO9SueGnykA0xkxN6ahwAQxtoVvNDH7yHz50X7ty0t545p 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=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Tue, 05 Dec 2023 04:27:03 -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/userspace-consumer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/userspace-consumer.c b/drivers/regulator/userspace-consumer.c index 97f075ed68c9..53d1b9d6f69c 100644 --- a/drivers/regulator/userspace-consumer.c +++ b/drivers/regulator/userspace-consumer.c @@ -194,7 +194,7 @@ static int regulator_userspace_consumer_probe(struct platform_device *pdev) return ret; } -static int regulator_userspace_consumer_remove(struct platform_device *pdev) +static void regulator_userspace_consumer_remove(struct platform_device *pdev) { struct userspace_consumer_data *data = platform_get_drvdata(pdev); @@ -202,8 +202,6 @@ static int regulator_userspace_consumer_remove(struct platform_device *pdev) if (data->enabled && !data->no_autoswitch) regulator_bulk_disable(data->num_supplies, data->supplies); - - return 0; } static const struct of_device_id regulator_userspace_consumer_of_match[] = { @@ -213,7 +211,7 @@ static const struct of_device_id regulator_userspace_consumer_of_match[] = { static struct platform_driver regulator_userspace_consumer_driver = { .probe = regulator_userspace_consumer_probe, - .remove = regulator_userspace_consumer_remove, + .remove_new = regulator_userspace_consumer_remove, .driver = { .name = "reg-userspace-consumer", .probe_type = PROBE_PREFER_ASYNCHRONOUS, -- 2.42.0