Message ID | 20231109202830.4124591-1-u.kleine-koenig@pengutronix.de |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp690179vqs; Thu, 9 Nov 2023 12:31:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHY12P8OIkc9vZTlceyV6n5OPTpf9B+0eUZlTfhTzpxPd0IoI7X7oFmsM3VSC4scgrRRV0o X-Received: by 2002:a05:6808:2096:b0:3b5:ae0d:b208 with SMTP id s22-20020a056808209600b003b5ae0db208mr3103908oiw.6.1699561871673; Thu, 09 Nov 2023 12:31:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699561871; cv=none; d=google.com; s=arc-20160816; b=NrbA/pFDGEfiT7khyRKSW95w4+9i5+OIp5MAukgnTNVte7uZqywg6wr4msB/eTytd7 b+b4wpZvwa4IgPP7S7Zg6bT7IA9nz7Q3xtNpb3xI9JgsnRHKm1LLtm6OIoQYarH3bNT9 oOIB97kzCBgQwSxHEdkLHNoF6PS80ilDHyUokwt6aFDqdqXIQTXc+2HmkQ7BrSGlKFqe FgFEKB2wzTRs00xT0KI12VKAkWbVmyTrhLubiFuefJco3iTpuLSN9rxyF+5OB0cSCm4K RBSe1YUFSP8jo2hdj2ZJfstZCShJvBqNwA4h43IxUpri+GQ5MU/kcoOMPh/FH64TRNjo 3Tiw== 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 :message-id:date:subject:cc:to:from; bh=lcPLa6Lccn94kJsFVnFuHR9Al6oyn914Qxv2Xzye1XU=; fh=qQpF7K0n7Ik5NmJNcTfmvPcpnTCSWsoAnYGp3z0/IOc=; b=t1Q81ktr2yi3x4k4p0vtp4NwMN5EsbNMBcqGYRoCWQCyPoOEY2pw1pb+TCMvdIs/Aa LsjWiMT9l7Eh4gMHdafGdc4ItUVg0Xqw6Bs5iSX0fr8D82H4zuxD1vVATi5G9xPj2Nrq 2tHQRghMIukP5l1YmGZzkiFihwz7gpZ0GwJWAU6xU/YF6qLRu60ZQuGUrLJhcd4q3jqb GBvzn07NDZK/x1EW7kIrMb33dzLVju8/e99bHl+F74iUl7cTKBsUmp8L/5wIqof9S13L GM27YqenOUCFhMKXneIz3rpk/H+Qpx9XprKATFgVZs174NKDh4jXZrMLWaXJAO97yIjF IP6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id t23-20020a656097000000b005bdfda8e04asi2644714pgu.733.2023.11.09.12.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 12:31:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id EB57880FD8A8; Thu, 9 Nov 2023 12:30:53 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345209AbjKIUaf (ORCPT <rfc822;lhua1029@gmail.com> + 30 others); Thu, 9 Nov 2023 15:30:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345221AbjKIUaM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Nov 2023 15:30:12 -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 8729C44BB for <linux-kernel@vger.kernel.org>; Thu, 9 Nov 2023 12:29:39 -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 <ukl@pengutronix.de>) id 1r1BeH-0002yL-0M; Thu, 09 Nov 2023 21:29:09 +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 <ukl@pengutronix.de>) id 1r1BeC-007rWU-Et; Thu, 09 Nov 2023 21:29:04 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <ukl@pengutronix.de>) id 1r1BeC-00GGtM-3f; Thu, 09 Nov 2023 21:29:04 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> To: Jay Fang <f.fangjian@huawei.com>, Arnd Bergmann <arnd@arndb.de>, Rob Herring <robh@kernel.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Laurentiu Tudor <laurentiu.tudor@nxp.com>, Tony Lindgren <tony@atomide.com>, "Sicelo A. Mhlongo" <absicsz@gmail.com>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Liu Ying <victor.liu@nxp.com>, Geert Uytterhoeven <geert+renesas@glider.be>, Luis Chamberlain <mcgrof@kernel.org>, Nick Alcock <nick.alcock@oracle.com>, Chen-Yu Tsai <wens@csie.org>, Samuel Holland <samuel@sholland.org>, Hans de Goede <hdegoede@redhat.com>, Yangtao Li <frank.li@vivo.com>, Yuan Can <yuancan@huawei.com>, Thierry Reding <thierry.reding@gmail.com>, Jonathan Hunter <jonathanh@nvidia.com> Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH 00/12] bus: Convert to platform remove callback returning void Date: Thu, 9 Nov 2023 21:28:30 +0100 Message-ID: <20231109202830.4124591-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=openpgp-sha256; l=2306; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=J6a3im7lNbnTqrSTHauek+j417sdu4W8300ivumT3qU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTUDuVSwm6Dry76QAgY1MQyxgniK5Ur0yUy/Cg DW8XtvPhlCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU1A7gAKCRCPgPtYfRL+ TonZB/4nfsBuFdJxCVjGRqREV3frv3i56Yi9aUTm3cZVViaDV6rrVzn83paMyvZOMcV+Qntq2tX 7WQ5SPanfT1NJ1AfbG/XwNxY6PS3hUii1I+bPm9FjxoxiyDrW0S2+D6+JEzITZZrJE7B8YHT0I2 Mf0d40VtdzK5EZ00R/it9N/7Pqn6lruK/C1HUU05s1WsFol+DMhIi62hlmt6UoLuPVZIoYHGZcu KtiwLuPKFLIuOikg/fK/+o/C+jl4BIv0TSXd6ezG6EL+9m0N1RQrTAAh6kI2ULO6AfQDkNbiMoF 1DoqM5OyvFMQd4GG4MjyGP6ulmlIBjWUtD4VZ5yBOlwjhO2c 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 Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 09 Nov 2023 12:30:54 -0800 (PST) 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 lipwig.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782119788877626832 X-GMAIL-MSGID: 1782119788877626832 |
Series |
bus: Convert to platform remove callback returning void
|
|
Message
Uwe Kleine-König
Nov. 9, 2023, 8:28 p.m. UTC
Hello, this series converts all drivers below drivers/bus to struct platform_driver::remove_new(). See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for an extended explanation and the eventual goal. drivers/bus/fsl-mc was already addressed earlier with a separate series[1]. All conversations are trivial, because all .remove() callbacks returned zero unconditionally. Some of the drivers touched here don't have a maintainer and there is no maintainer for all of drivers/bus. It would be great if someone could pick up the whole series, maybe Arnd might do that? Best regards Uwe [1] https://lore.kernel.org/lkml/20231103230001.3652259-3-u.kleine-koenig@pengutronix.de Uwe Kleine-König (12): bus: hisi_lpc: Convert to platform remove callback returning void bus: omap-ocp2scp: Convert to platform remove callback returning void bus: omap_l3_smx: Convert to platform remove callback returning void bus: qcom-ssc-block-bus: Convert to platform remove callback returning void bus: simple-pm-bus: Convert to platform remove callback returning void bus: sun50i-de2: Convert to platform remove callback returning void bus: sunxi-rsb: Convert to platform remove callback returning void bus: tegra-aconnect: Convert to platform remove callback returning void bus: tegra-gmi: Convert to platform remove callback returning void bus: ti-pwmss: Convert to platform remove callback returning void bus: ti-sysc: Convert to platform remove callback returning void bus: ts-nbus: Convert to platform remove callback returning void drivers/bus/hisi_lpc.c | 6 ++---- drivers/bus/omap-ocp2scp.c | 6 ++---- drivers/bus/omap_l3_smx.c | 6 ++---- drivers/bus/qcom-ssc-block-bus.c | 6 ++---- drivers/bus/simple-pm-bus.c | 7 +++---- drivers/bus/sun50i-de2.c | 5 ++--- drivers/bus/sunxi-rsb.c | 6 ++---- drivers/bus/tegra-aconnect.c | 6 ++---- drivers/bus/tegra-gmi.c | 6 ++---- drivers/bus/ti-pwmss.c | 5 ++--- drivers/bus/ti-sysc.c | 6 ++---- drivers/bus/ts-nbus.c | 6 ++---- 12 files changed, 25 insertions(+), 46 deletions(-) base-commit: b622d91ca201bf97582e9b09ebbaab005ecee86f
Comments
On Thu, Nov 9, 2023, at 21:28, Uwe Kleine-König wrote: > Hello, > > this series converts all drivers below drivers/bus to struct > platform_driver::remove_new(). See commit 5c5a7680e67b ("platform: > Provide a remove callback that returns no value") for an extended > explanation and the eventual goal. > > drivers/bus/fsl-mc was already addressed earlier with a separate > series[1]. > > All conversations are trivial, because all .remove() callbacks returned > zero unconditionally. > > Some of the drivers touched here don't have a maintainer and there is no > maintainer for all of drivers/bus. It would be great if someone could pick up > the whole series, maybe Arnd might do that? Sure, please send a pull request to soc@kernel.org if there are no further comments. Arnd
On Thu, 9 Nov 2023 21:28:37 +0100 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote: > 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 <u.kleine-koenig@pengutronix.de> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Thanks, Andre > --- > drivers/bus/sunxi-rsb.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c > index db0ed4e5d315..fd3e9d82340a 100644 > --- a/drivers/bus/sunxi-rsb.c > +++ b/drivers/bus/sunxi-rsb.c > @@ -817,15 +817,13 @@ static int sunxi_rsb_probe(struct platform_device *pdev) > return 0; > } > > -static int sunxi_rsb_remove(struct platform_device *pdev) > +static void sunxi_rsb_remove(struct platform_device *pdev) > { > struct sunxi_rsb *rsb = platform_get_drvdata(pdev); > > device_for_each_child(rsb->dev, NULL, sunxi_rsb_remove_devices); > pm_runtime_disable(&pdev->dev); > sunxi_rsb_hw_exit(rsb); > - > - return 0; > } > > static const struct dev_pm_ops sunxi_rsb_dev_pm_ops = { > @@ -842,7 +840,7 @@ MODULE_DEVICE_TABLE(of, sunxi_rsb_of_match_table); > > static struct platform_driver sunxi_rsb_driver = { > .probe = sunxi_rsb_probe, > - .remove = sunxi_rsb_remove, > + .remove_new = sunxi_rsb_remove, > .driver = { > .name = RSB_CTRL_NAME, > .of_match_table = sunxi_rsb_of_match_table,
Dne četrtek, 09. november 2023 ob 21:28:37 CET je Uwe Kleine-König napisal(a): > 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 <u.kleine-koenig@pengutronix.de> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Best regards, Jernej > --- > drivers/bus/sunxi-rsb.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c > index db0ed4e5d315..fd3e9d82340a 100644 > --- a/drivers/bus/sunxi-rsb.c > +++ b/drivers/bus/sunxi-rsb.c > @@ -817,15 +817,13 @@ static int sunxi_rsb_probe(struct platform_device *pdev) > return 0; > } > > -static int sunxi_rsb_remove(struct platform_device *pdev) > +static void sunxi_rsb_remove(struct platform_device *pdev) > { > struct sunxi_rsb *rsb = platform_get_drvdata(pdev); > > device_for_each_child(rsb->dev, NULL, sunxi_rsb_remove_devices); > pm_runtime_disable(&pdev->dev); > sunxi_rsb_hw_exit(rsb); > - > - return 0; > } > > static const struct dev_pm_ops sunxi_rsb_dev_pm_ops = { > @@ -842,7 +840,7 @@ MODULE_DEVICE_TABLE(of, sunxi_rsb_of_match_table); > > static struct platform_driver sunxi_rsb_driver = { > .probe = sunxi_rsb_probe, > - .remove = sunxi_rsb_remove, > + .remove_new = sunxi_rsb_remove, > .driver = { > .name = RSB_CTRL_NAME, > .of_match_table = sunxi_rsb_of_match_table, >