Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3046290rdh; Thu, 28 Sep 2023 00:21:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvhzIb3ltjFvh28Npd3oco5ZqNpNEM8a97fla7iVgQnR7apEQ6flblJRwBy2gej+nEzXNe X-Received: by 2002:a05:6358:949d:b0:145:63e6:8710 with SMTP id i29-20020a056358949d00b0014563e68710mr524130rwb.23.1695885686533; Thu, 28 Sep 2023 00:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885686; cv=none; d=google.com; s=arc-20160816; b=NwlgE3ojNbjeSr/8azmzYqlmnXA2DUXvOez0Z788glKVNvh8HD47y4FB5AqBK58/VX Ehck5tu1jjokxmli+sC/6lnhqEpwKSK2/r0hIudDYsJco/1SA9TZXepi0B7Rn/0JGBwH 67VMhEcFlhWWI2sMmMp+B3SNQTTa4/k3SUjjynd3wBYXr+SCaMIZ4/+9dEhXMYJvW2B8 qB1c8nC+RWJxxBASWIo6RRl/l59wZ1D43Mmiy4OfZrorjXwyE2JOqEoIHkcBY9ZAjPeJ u/XGQYD3baJkBYpYFhl4z6z9g9OjgZmZ0FrDc12JN6AUTtHo6V5iCcYefjLaSNMFhnSW YLRA== 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=9McDD7vsbF6uqtILQGNpFFK3xumgXjIMRspinir28fU=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=kfQzHGtLtbaj5+HkgMk84H8oOa0ODsckqsa7ARKAfiqhWVqTc6erQIGcczmFH4J9QX 0xGiBs4a1LoADPPIIhVuY2BcQm+joKL0X9b/99uvGGl3oL9JzNFA9a/UkdMEO6ti0vo5 tqRr8vTga4Iv8XqGUqYaVMrH7U1QRikt+4CeqXBGG7xs9eX2hldhgF/WHi002U0GRhO1 ggjzXFBlpUOhxvEyykaYXBDouIFC+k78c8YBUeaa0iBicrruOwM9tYeQlFWMo8UXeLB/ nHktC8MBbqKV0L53ctntpKWr21pZv7qks8dSrC8p/b5tZh49uMQpIm4ct9wdbQLZkEL3 f3kA== 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 o15-20020a656a4f000000b00563a0c1bf06si20562527pgu.428.2023.09.28.00.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:21:26 -0700 (PDT) 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 011AF82B484F; Thu, 28 Sep 2023 00:08:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231562AbjI1HIQ (ORCPT + 99 others); Thu, 28 Sep 2023 03:08:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231264AbjI1HHW (ORCPT ); Thu, 28 Sep 2023 03:07:22 -0400 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 CC8C4CCD for ; Thu, 28 Sep 2023 00:07:16 -0700 (PDT) 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 1qll79-0002R4-SP; Thu, 28 Sep 2023 09:07:11 +0200 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 1qll79-009WCM-FW; Thu, 28 Sep 2023 09:07:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qll79-005ZXx-6S; Thu, 28 Sep 2023 09:07:11 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/23] gpio: tb10x: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:07:00 +0200 Message-Id: <20230928070706.2290137-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230928070706.2290137-1-u.kleine-koenig@pengutronix.de> References: <20230928070706.2290137-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1873; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=52/8sMpkLnXCJmkoyAgbmBwgoxxupHjoRdYeDAnq7oA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRy4K9Ba9AEx+FrTZPsUfwm4VMZgfhNmqnB+ 0jVi/Uew2iJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkcgAKCRCPgPtYfRL+ Tj9BCACFsyugK4kPlLC6+uCxN5Sxud39t4cTpR7ANtPlVe0az6A4UDLIDwDCEpskhhqkMS0vVwO ui/NFi4UfVbdYYNDOAK39Lcc6YsjzbDMfnWuMASLCDEW9GY6+jfMTaMqZdY1E3zTJAqzmx2Sw58 c2V5rbv/TsypRNCHVsOoBT0MZ6u2c2aRCZdNQ0zQqqctuSc0Nw3SYbH+B8cW2oGIBz9Y7TBQhyf 2g55bMdfuYB4bq6RUxqt2u9JING3IheS5YcLx18+Z2dsjTXq+wH9Gq4KzzXHtXyVNHcalWh7KHM VSAQZ55vSqDMyJIggNLChJV6tLF2TbMUH45IgBsVeTgBVpTq 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 autolearn=unavailable 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]); Thu, 28 Sep 2023 00:08:33 -0700 (PDT) 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/gpio/gpio-tb10x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c index f96d260a4a19..e8c1485b9c73 100644 --- a/drivers/gpio/gpio-tb10x.c +++ b/drivers/gpio/gpio-tb10x.c @@ -215,7 +215,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev) return ret; } -static int tb10x_gpio_remove(struct platform_device *pdev) +static void tb10x_gpio_remove(struct platform_device *pdev) { struct tb10x_gpio *tb10x_gpio = platform_get_drvdata(pdev); @@ -225,8 +225,6 @@ static int tb10x_gpio_remove(struct platform_device *pdev) kfree(tb10x_gpio->domain->gc); irq_domain_remove(tb10x_gpio->domain); } - - return 0; } static const struct of_device_id tb10x_gpio_dt_ids[] = { @@ -237,7 +235,7 @@ MODULE_DEVICE_TABLE(of, tb10x_gpio_dt_ids); static struct platform_driver tb10x_gpio_driver = { .probe = tb10x_gpio_probe, - .remove = tb10x_gpio_remove, + .remove_new = tb10x_gpio_remove, .driver = { .name = "tb10x-gpio", .of_match_table = tb10x_gpio_dt_ids, -- 2.40.1