Message ID | 20230928070706.2290137-8-u.kleine-koenig@pengutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3129696vqu; Thu, 28 Sep 2023 00:21:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENL9nI++3E7xza/8BCundO8Ex3r0FZxU6W/9Fh6duaZTtmZyLyUjl8f/QeTuEmcNlkCsnN X-Received: by 2002:a17:902:ec83:b0:1c7:27a1:a9e5 with SMTP id x3-20020a170902ec8300b001c727a1a9e5mr776603plg.33.1695885706765; Thu, 28 Sep 2023 00:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885706; cv=none; d=google.com; s=arc-20160816; b=ED9zG86Aa+1lsv620eYodBdu8CQFa1oSeYdtp+ZsvzlXM2vUK3QHWwec/Jg33OtjXx +1ZolDn4oDnXfEvk9JazxJ1B5EevZGR5FWxKQVhCuo971YRr6GjLDQ0YVVx2kZZ1hfyF pL9mcwarnLMOACfwPhwAbP+wyJtz9A7UR4YpVOxkxZXpkYi3ZeVtCOMUPfLlZOX5H/OO +ZBfHaPfl8blCsZXynGCnWpqS5hPoHDxzQ26SQvDlusi9Imdn5TiFMp4pMOWTO01a2vG ATTBaYM3p/m6cjyqMiREE4vtmfQqLYWnSjXWmCjZsETOheau2djAe6DgqellmL7HIsXN +moQ== 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=qJ/FrSEDpgX5fJyO/2QX8ZwTq13Wjs8wSYDYHMfXAzw=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=xVE1XrYFtMa73d+or9wuJuX5Jf46B7ZKALi7Zni8uTiSZhRmTIX0kX9qzL0WvUmQo5 cG5JraSL/5+6PjS+hhaO7UUyHcvYN02uEaDNffXF5gA0R5RwyawzFA92chAKlMJ3c45X FP5NzYSMd2R3B0W4LY0B/bmtS8Cn7X7VreDOMpfby3b5mvNA4Efl+Wug7X7gGGaIFo5T qbEdw2+JkJUwB5Oc8gE9LhGG6Sllu6gZhoZEtVH353leP8FWvpjwOzZ35HyiHnHecaNY 1PzatE2IORZEMfSnU9JrHn7Arw86hoh1pcX3tRdSYVgacmig8PU4+tUnDVCc6PdfZQPR Bm7g== 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 p6-20020a170902e74600b001c62d93585csi149104plf.611.2023.09.28.00.21.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:21:46 -0700 (PDT) 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 20660828CC16; Thu, 28 Sep 2023 00:08:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231157AbjI1HHb (ORCPT <rfc822;ruipengqi7@gmail.com> + 20 others); Thu, 28 Sep 2023 03:07:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231165AbjI1HHT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 28 Sep 2023 03:07:19 -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 E744C1B4 for <linux-kernel@vger.kernel.org>; Thu, 28 Sep 2023 00:07:14 -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 <ukl@pengutronix.de>) id 1qll78-0002PF-4w; Thu, 28 Sep 2023 09:07:10 +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 <ukl@pengutronix.de>) id 1qll77-009WBh-O2; Thu, 28 Sep 2023 09:07:09 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <ukl@pengutronix.de>) id 1qll77-005ZXJ-Eq; Thu, 28 Sep 2023 09:07:09 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> To: Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <brgl@bgdev.pl> Cc: Andy Shevchenko <andy@kernel.org>, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/23] gpio: grgpio: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:50 +0200 Message-Id: <20230928070706.2290137-8-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=1775; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=CBRa5uc4jxkn5sVY8frORfw+bQVQ0W6ZrDl2ytRwOVw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRmrR74n8YeidQDHng8LSxFjhMKe5ULUsUQf I8LtTIQNkuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkZgAKCRCPgPtYfRL+ Tg8OB/9Qmd8kmBwuNsJEQXn/z5BtpNMLdsh9EGEmxP7/6REtWKdCuqTOYdzJt9tQKw6jand0WJh //zdsKChP3Xca/hv5CgORW2ACPrAZKhb7o0pOB6aVtakBCxuEtpwIs1PnAQ/2kI0Lk+rfakzy3a 6mAZf+x8e3UZJdXjzRwkhJFRFIcF0sA9mjyYut2RcBYMe3VbDcqKWys8R4UcwsuySUXb+HBNglM oZ3qM2vANqw9wqNHDxkFPXJ499LSt8i9VlNkAIXFcdJ7liuCg/W+h0Ng9Y6GHX/LTyPcEwVzmld 7MTAzYJ8T855BORoU9K+SVr4Oc+dFuPwtK+L3YVMzzaTI+C+ 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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, 28 Sep 2023 00:08:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265050321011754 X-GMAIL-MSGID: 1778265050321011754 |
Series |
gpio: Convert to platform remove callback returning void
|
|
Commit Message
Uwe Kleine-König
Sept. 28, 2023, 7:06 a.m. UTC
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>
---
drivers/gpio/gpio-grgpio.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c index 0163c95f6dd7..017c7170eb57 100644 --- a/drivers/gpio/gpio-grgpio.c +++ b/drivers/gpio/gpio-grgpio.c @@ -431,7 +431,7 @@ static int grgpio_probe(struct platform_device *ofdev) return 0; } -static int grgpio_remove(struct platform_device *ofdev) +static void grgpio_remove(struct platform_device *ofdev) { struct grgpio_priv *priv = platform_get_drvdata(ofdev); @@ -439,8 +439,6 @@ static int grgpio_remove(struct platform_device *ofdev) if (priv->domain) irq_domain_remove(priv->domain); - - return 0; } static const struct of_device_id grgpio_match[] = { @@ -457,7 +455,7 @@ static struct platform_driver grgpio_driver = { .of_match_table = grgpio_match, }, .probe = grgpio_probe, - .remove = grgpio_remove, + .remove_new = grgpio_remove, }; module_platform_driver(grgpio_driver);