From patchwork Tue Dec 5 12:26:19 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: 174027 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3391550vqy; Tue, 5 Dec 2023 04:27:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDiRhRaoA28NH69qhdKcr5tpMNFe8rMV3R0/viFEhtTQ16zHMyyXp5GDuW7aE/K0mlAKnv X-Received: by 2002:a05:6a20:7352:b0:18b:94c5:257c with SMTP id v18-20020a056a20735200b0018b94c5257cmr2902144pzc.16.1701779223992; Tue, 05 Dec 2023 04:27:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701779223; cv=none; d=google.com; s=arc-20160816; b=QuKyIwoBhRwxjods/icRR7WFDDePhS4LlXvntmzHTY4rES79m94gN6bONvibeeZ5VC Mk9e/f9s1JbgaKELjUTHcL62qjJw2NkzpiaNTpos5xtYJHT+eqYN3+VtCq6HSpUDB2F3 GznJ7X3tRm6yEwh77+oJVGIuHEU7LlTBKpIOS7eoIvYwa2rXxvc7+wwaQQZkEBUISKeS gtCP0T2G3tfjBvIBHAwuAOssol+0JfjIxZYyU8e9scbqcaj2dzCoFa5m6fZrqWHJO51R MSjSPnU2l/9caU8CXcU9a6/WUma2SOkNmc8JOmkUDHDIJr5khp9dlyZjNpC+Yvm/hQOu hH9w== 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=jCBgI/ojb7tPzaf7yc4efGbClN2W7714z+OXJp0pzV4=; fh=ngtBh25P6mLYKRTVXn/J5Ppoq/KJSo3gYX6g5J5bE9k=; b=MtxJM4jJupOXQ3q1mVhp+hSGTc92VwUidDTtkUGmU3SfpHiy0/KZN10sOTiIWTWDte N7Xq8ofJmiCPI1UjiHSZXFtfxXBe8ooE4N2/8BvbUfjjzt99gsNORgogMPsUtZeSVk/8 nyTduTILyLmpoWe/yBrMwve0CvpZRertYHzItoBtEOV6UGvxjLPZDI0CVBZbsg2nzIJe q9oYdAbaxCpEQtAylggJFli/6zrVyRX3taz/hwAsqyDnERK0mG0I7tfbtBeYzZDgnf4+ ZT91V/n0D9GqmYZ7yoaHC9rvm3kUPds0oSzxq4O2wX+oqJKYdx9wPwm6gh4/cNvRQIZE lZCg== 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 Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id gg16-20020a17090b0a1000b002866c405e01si5872778pjb.17.2023.12.05.04.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 04:27:03 -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 B2DB280C65C2; Tue, 5 Dec 2023 04:27:02 -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 S235174AbjLEM0r (ORCPT + 99 others); Tue, 5 Dec 2023 07:26:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235151AbjLEM0f (ORCPT ); Tue, 5 Dec 2023 07:26:35 -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 5C865C9 for ; Tue, 5 Dec 2023 04:26:41 -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-0005Xu-76; 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-00Djux-Eg; 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-00EhQm-5Y; Tue, 05 Dec 2023 13:26:35 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: Maxime Coquelin , Alexandre Torgue , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 4/8] regulator: stm32-vrefbuf: Convert to platform remove callback returning void Date: Tue, 5 Dec 2023 13:26:19 +0100 Message-ID: <2e96cf99c8d97b728d891a745e8f94ee39fbfee8.1701778038.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2049; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=sYW+VRQlaUR4tM4vU6xMFTkIkYFDO3ZsrQVPaJ+GEJ4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlbxbqWGuXtsy7gv6tNYQlb2xj7XMEobJPqduLF BBMwrfHmbqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZW8W6gAKCRCPgPtYfRL+ TgbCB/98owzxEUqbrEj9sMckpRxSmLplun0ZyYiCAYe6awaXUO86peyV+H+0CXO93EdHbFb4Ha1 xR5aVqiHFvoflGPGMgYevzws9GXypUxbh9gddEc2dz8xIkjTjFUvIKL/GtY/xbEwdI812mdn2vK cwO2rD6nuyqSKMytiCXe1J1ms/54sERaxtP2fOqj35P8hbQoBW6LBF9iC4Q7bu7gWN8jzQUTFFb g5GpT/vMiC1D1cyVqLkr+nihchbcCW2SQ1C5Pa7VtvAxHVy1/T5Q7GsxR7SxccytJxtrxjMPlhE tA3urkm3LotZUnKzL2NsfSDubXKXyLeesFdivas8fQU+d4sc 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-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:27:02 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784444851615206857 X-GMAIL-MSGID: 1784444851615206857 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/stm32-vrefbuf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/stm32-vrefbuf.c b/drivers/regulator/stm32-vrefbuf.c index 717144cbe0f9..40855105dd33 100644 --- a/drivers/regulator/stm32-vrefbuf.c +++ b/drivers/regulator/stm32-vrefbuf.c @@ -233,7 +233,7 @@ static int stm32_vrefbuf_probe(struct platform_device *pdev) return ret; } -static int stm32_vrefbuf_remove(struct platform_device *pdev) +static void stm32_vrefbuf_remove(struct platform_device *pdev) { struct regulator_dev *rdev = platform_get_drvdata(pdev); struct stm32_vrefbuf *priv = rdev_get_drvdata(rdev); @@ -244,8 +244,6 @@ static int stm32_vrefbuf_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); pm_runtime_put_noidle(&pdev->dev); - - return 0; }; static int __maybe_unused stm32_vrefbuf_runtime_suspend(struct device *dev) @@ -282,7 +280,7 @@ MODULE_DEVICE_TABLE(of, stm32_vrefbuf_of_match); static struct platform_driver stm32_vrefbuf_driver = { .probe = stm32_vrefbuf_probe, - .remove = stm32_vrefbuf_remove, + .remove_new = stm32_vrefbuf_remove, .driver = { .name = "stm32-vrefbuf", .probe_type = PROBE_PREFER_ASYNCHRONOUS,