Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp243429rdb; Tue, 5 Dec 2023 04:26:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhn173Kff4f0QyuB0ewI/02HuhI8OERSXS+4Mt2r771Rjl1MeRcvqL+XSFOCyc7Up2MS+a X-Received: by 2002:a17:90a:68c6:b0:286:b27f:46fb with SMTP id q6-20020a17090a68c600b00286b27f46fbmr1251895pjj.9.1701779207101; Tue, 05 Dec 2023 04:26:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701779207; cv=none; d=google.com; s=arc-20160816; b=iKOsgZWYvmJV4711njnfEUn1eG/HaHYqzUiB89lvx2uk7y9WrN1iYEnNDBMMYBuEY0 9uOm7JbUanuBMlLeNJyMBThF05St+7KRdaeEKaG51NKqLoOuu2nWSbLxAeWUsmtzFBtc w/rpYVTawVTS6CPa7v3asd7r0/lQj9sYjhfDn9M19wmxLgB63aHZg98i0oujgASfADZL QNWIU6fdE/2k6pL78Cma5BtX7hdpp9W/v6j4lFpKuM8zAuce8JLrTjdWUlwwgRbEQu69 f3f4IBXZjHCjhnH8Cobj+JGsqPG8b/3KjhcQiJH8dRZPysSWgqD4eP3Q1XiIzyRmKfW7 6hXg== 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=l1dEnt1STa0zYIltqERfcWT038bn7mZMfufxjMJTrL4=; fh=hjIksG6EtuG1RH3YtJvtaLD1e60yuZ9kPU55ceFRx48=; b=UraUpYqyT6OgxTkHbl1a8WBpDj/nYGk8K5f72aTvjjiX98eH8OXGsoSmMNMWc6hDRA oB8/DNjG2Eran2Oz/wSU4dUQw7EvzPJn8rvMk3/JZV9a4cdwwSAcYGq9SZH8sSBIqngz inQDA6ePdKVbPZcKuTn9yUTgt/0+CAC8fmD6nC8XZwyt2lzzWR88/IAv7bpjBwC07p4H 2R/Hnx+WuUI/JCJFcUDS65SgZq6vAjK/hOyrgnuGg8JqmgIIxBhx5RMLZpA+pXRb9V0o a8nxhijMAii+YBqxDJG4zF9UkMWkWJqVijk6j+vlsQVpzimOa8AfazTVsZhju7lTIrMC bmmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id mr17-20020a17090b239100b00286686b9d9dsi6053880pjb.130.2023.12.05.04.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 04:26:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 18A0180C592D; Tue, 5 Dec 2023 04:26:45 -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 S235146AbjLEM0e (ORCPT + 99 others); Tue, 5 Dec 2023 07:26:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231945AbjLEM0b (ORCPT ); Tue, 5 Dec 2023 07:26:31 -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 0748A116 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 1rAUVX-0005XX-Ey; Tue, 05 Dec 2023 13:26:35 +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-00Djur-2H; 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 1rAUVW-00EhQd-PT; Tue, 05 Dec 2023 13:26:34 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: Marek Vasut , linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 2/8] regulator: bd9571mwv: Convert to platform remove callback returning void Date: Tue, 5 Dec 2023 13:26:17 +0100 Message-ID: <639e796b36815a219ff1172cc758ba7378211d74.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=1844; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=xHLhRqowwhFDnR1Zz3hrHDK3dQ0zi02Jx4061ISe4MM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlbxboQOaQkKi2vEhgf7ZGG0FfDWxXYpAN6cRlW K/zmQb5HeqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZW8W6AAKCRCPgPtYfRL+ TtJqB/9e48xXfRTGrxFhfDHXi37CoQOy9e3v7lcsWmzELvxm0TOXy6bKEhcgZNuCqJP5wwUk1N0 8xFFcSEr4zOn2UBM1VtvoVU9IX/9QGmYZxwmZT9MPJwax4LswsO8+CreHzbtc2DR5iNx0Je5Eeh NdL7c9NSnyNi2eB+PZoTa+lfrerh03l7ETvyltKcIhf4heaqw6CJ0mfFg+I2hB9lmFnDw2+rMIA qM+W++qoJpzP7LwL/R/P1Z7Yjre1h8l5+pbo+dyWl4vIhNDIeVZtXEI/g9G/mTk4MfuElMviw/Y j9Cy0KNqDouDLaGjr0yEI4dBeDfxuZnzsGaCIFBHxq2PlmW/ 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:45 -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/bd9571mwv-regulator.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c index d469481d8442..c7ceba56e7dc 100644 --- a/drivers/regulator/bd9571mwv-regulator.c +++ b/drivers/regulator/bd9571mwv-regulator.c @@ -260,10 +260,9 @@ static const struct dev_pm_ops bd9571mwv_pm = { SET_SYSTEM_SLEEP_PM_OPS(bd9571mwv_suspend, bd9571mwv_resume) }; -static int bd9571mwv_regulator_remove(struct platform_device *pdev) +static void bd9571mwv_regulator_remove(struct platform_device *pdev) { device_remove_file(&pdev->dev, &dev_attr_backup_mode); - return 0; } #define DEV_PM_OPS &bd9571mwv_pm #else @@ -357,7 +356,7 @@ static struct platform_driver bd9571mwv_regulator_driver = { .pm = DEV_PM_OPS, }, .probe = bd9571mwv_regulator_probe, - .remove = bd9571mwv_regulator_remove, + .remove_new = bd9571mwv_regulator_remove, .id_table = bd9571mwv_regulator_id_table, }; module_platform_driver(bd9571mwv_regulator_driver); -- 2.42.0