From patchwork Thu Sep 28 07:06:44 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: 145821 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3129956vqu; Thu, 28 Sep 2023 00:22:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMVIV1agnkhTpTbdxh2MNZz9jWH+V66ynlmV4WQIBSi+QewUfc8vTYeR4viZw8IbS9dhTv X-Received: by 2002:a67:ff01:0:b0:452:6135:d with SMTP id v1-20020a67ff01000000b004526135000dmr364074vsp.33.1695885743709; Thu, 28 Sep 2023 00:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885743; cv=none; d=google.com; s=arc-20160816; b=buJieS6DJkDjh3NK6Jr6AGoGvl2S13C+hN8J82Q8QDUN4p/ySm/eEjYCC4VtsIvjbv RGuBdkXh4sKxtzQNpW5LuyNDUBcTm38tRcw1ZJmBzhceTuiQOgUctGTaNQQm4vWAaR2o lGku1w2O2S4DybdO++75weN8LzL2VZxBmNxKGhnjLGPu5kKzxSNgXNHOkpx+7FIUJjLg EKXP45DWTe/xCGobmWMMm8eaxjB+hqVnbfWDdHLHGJKjUaI6x+G9f+q0mdAwvdRDirdV o+1U/DuosaeWjKO1L96f15iMG9ItFn5Oqxm3LbH+vyiaNIuuN/Ofdd1ycnSDT8SZVB0m qDtg== 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=Szeir1plWs33a4L/xJ0y4mLopkwSdkfwmhVR/ieFoKM=; fh=UFNb8J+//2ZIlgQmgcgnisjn6fJUT0LIozybFTBH+Zg=; b=X5Wfc40tTHY1wG2dR3jtpx8Y7Sh3IIMbvLfcRuwkYJ7jua+MipA/USpbXNunYPiybg bhdxAUdLlfHSUtrFQXRTrUFv99ZRqDIchX3kVhaiwF845kPL8eY3QU8RpEHKO6gWsnm9 txgDq2iQC98HhExz2HuQiGT62gAYvN6ltzChD7JPt29kQve6C8Qh5R3ODSFitZzJ4V8j i2GFouBh2jlkQ2Lprtzj01KNMrLwuEr963BmZ4FddTrkqW7U1vDcj+vbn5wd1s6bZk/V lvUgpSZ0wRl1EsHx5mg4MVA/EUaMpzPwxhp6lQ0iPqDtJjEhzCC/UUDcFiDVUgoMM74S /Dag== 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 x23-20020a631717000000b005440b9f013csi17950327pgl.899.2023.09.28.00.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:22:23 -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 D670E828DE62; Thu, 28 Sep 2023 00:09:33 -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 S231476AbjI1HIV (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231263AbjI1HHW (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 1C82F1A5 for ; Thu, 28 Sep 2023 00:07:18 -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 1qll77-0002OG-2d; Thu, 28 Sep 2023 09:07:09 +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 1qll76-009WBM-LJ; Thu, 28 Sep 2023 09:07:08 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qll76-005ZWw-Bp; Thu, 28 Sep 2023 09:07:08 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Mun Yew Tham , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/23] gpio: altera: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:44 +0200 Message-Id: <20230928070706.2290137-2-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1746; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=movoJjxQGZhdEpgxeET/qoYXLgHYq3xl1yWlhPlVaxA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRfsfQe8UNLM96ju5YikzLyrTwfSWJGH9BpG gLuYVJNbUWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkXwAKCRCPgPtYfRL+ TjMzB/9FzKkndhb2OKR9Cj0r+JiewFdwFzc7z8IBbKvN6fDWG3gLCpOrIOWyxBatr9+TcLNmq7j mo1kDYs7JLymGovUd4VcK++ImsZ7qguUArtD2qF2dcmHAGM8IbTN0vscbllr0tFed9uQuWfYMRY yV7t4XStCPUTYfnbOKamM2wGp6+xeCHuziRURSoxqpwMBpdFcquBi8zL1Gv04D2gYntEt0Klxix 2Ds73wlW82DU0u8XHbPLyoLOzhdciaN7Yzpn52bC2gaiYV24FZCC+F6AcusccIvWLzXM900Pqhy BkSHMT81As2tCrR3tebgGVCNbHwa9PNag0QtQ6zpyPIsT09O 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=-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: 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:09:33 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265089880552738 X-GMAIL-MSGID: 1778265089880552738 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-altera.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c index 54d7c450c596..c2edfbb231fc 100644 --- a/drivers/gpio/gpio-altera.c +++ b/drivers/gpio/gpio-altera.c @@ -317,13 +317,11 @@ static int altera_gpio_probe(struct platform_device *pdev) return 0; } -static int altera_gpio_remove(struct platform_device *pdev) +static void altera_gpio_remove(struct platform_device *pdev) { struct altera_gpio_chip *altera_gc = platform_get_drvdata(pdev); of_mm_gpiochip_remove(&altera_gc->mmchip); - - return 0; } static const struct of_device_id altera_gpio_of_match[] = { @@ -338,7 +336,7 @@ static struct platform_driver altera_gpio_driver = { .of_match_table = altera_gpio_of_match, }, .probe = altera_gpio_probe, - .remove = altera_gpio_remove, + .remove_new = altera_gpio_remove, }; static int __init altera_gpio_init(void) From patchwork Thu Sep 28 07:06:45 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: 145812 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3129583vqu; Thu, 28 Sep 2023 00:21:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE76Lihm1mL12WfIwd9gnB4XesFx55cknM2iof2r2CeGa2yjBRj0VDqCCGei2dv12HMoyZP X-Received: by 2002:a05:6358:4311:b0:143:96ac:96ec with SMTP id r17-20020a056358431100b0014396ac96ecmr347479rwc.25.1695885689130; Thu, 28 Sep 2023 00:21:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885689; cv=none; d=google.com; s=arc-20160816; b=nQpakiKzbDP6hJBD0n+0/aXYzHtL9cTSaT8Y8t5DF9Wyr4H+WHqDeNzlFO1xMcL//I 7l8aDlvPVEDALeXvNxBb9tQEMYhtGc6D71kZCLd/lReDMbMdgMGwfx+GbuKWz+gv4g3t lDPdkr3b05IGZ+iMWoJtGHaMyDRd3Ksl3UDKhCKS5zhO/WF1/132QBpzuPJdhTG3otUV bjerDpHLCYg5v/0rD2EYQA8WhKDaHtzoiwwoyouUsQ8vOHxil6qnhRExAX5JEn887Ore TnnXJ6Vbhvvdbm9v/JFnxIjf7413mIgpl7saOsKA1fvtj1w6dtTXwJnykzc//ODEIA4B eH0Q== 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=oN7JRp0Jiju/914LZMpo4cagQz16wLM2rb8V+gGJUZA=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=GzHQG7pYvgyXZfIwa1s17fwpflvbxkjogbaVfDVmf//iDnC5GkhfPv1GP0BnI8V6K5 0O88yaCmWcfuyTa0u+/oZmexPq07HjIT1xCusrxrOzHtRQPipNl3sjWfnOKzQ4D7HZ1H CF+EEdbcHQZzZkaQCHzL0/qk2BNJdL/kJewRE8gyJDhXptyrgMBBP4sbSt015d5DD5fy MRSvZIXDWbyWCZZCOeeqxS2Q05n2DIIWdDOVcDCsU5wgXqPbmWrTZrO9jey2TONgJKr5 vTwKNcYyj811l5I/GvEe6U876NSbKGN0l3z36kOv12YEXlCRHjfjO+wXX4XdCSk8W7BT 8yjw== 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 bz16-20020a056a02061000b00578bb93aa4fsi21951466pgb.730.2023.09.28.00.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:21:29 -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 2E5DE828C485; Thu, 28 Sep 2023 00:07:43 -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 S231203AbjI1HH2 (ORCPT + 20 others); Thu, 28 Sep 2023 03:07:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231156AbjI1HHS (ORCPT ); Thu, 28 Sep 2023 03:07:18 -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 3904E1AC for ; 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 ) id 1qll77-0002OH-7C; Thu, 28 Sep 2023 09:07:09 +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 1qll76-009WBP-Qd; Thu, 28 Sep 2023 09:07:08 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qll76-005ZWz-HM; Thu, 28 Sep 2023 09:07:08 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/23] gpio: amdpt: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:45 +0200 Message-Id: <20230928070706.2290137-3-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1704; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=pmBQ7x4NlnXZMn9aA/nAoCKl01g7jBU9/A19/uOU6ts=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRgGcmEwGahH1iTqFL7RNhqMJ9vePhEwX8cN fgjDAG+mw+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkYAAKCRCPgPtYfRL+ TsGnB/oCwnKuHDTBqxM0td9Y3sbgKQ0IHV+CxG1zN/bLO54cAS+c+2Reqy6DB3VeHXJvZRqPQcz q6LubKG/DWDnO5vXsXIKhZkKC84nvwYylxX3BzzWB6GVSxeWxlWz8p3Hzcv4ZzJZCYDaC5TZ1+r 9hf8Q/vSN5zGhW3CSP2ZFFpC6+hDofGbTXaf/NGhODjMe5XOoQmUKB1DUh+dUvFxFG2Wo9EG+Yt IdyOgx/a7XCgitedepWM4eLfSCtBhM0/pfKhdgaidDdcQrSsg+3Qr5ODJGJwWITwTZOMi1nMHPj 0wvHk+Dd4ercHPeAVJcxYoQGv/c7d/C4JYe5Pj7NrlFx73Ld 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=-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: 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:07:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265032198498294 X-GMAIL-MSGID: 1778265032198498294 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-amdpt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-amdpt.c b/drivers/gpio/gpio-amdpt.c index 07c6d090058d..0a2ea9db4682 100644 --- a/drivers/gpio/gpio-amdpt.c +++ b/drivers/gpio/gpio-amdpt.c @@ -122,13 +122,11 @@ static int pt_gpio_probe(struct platform_device *pdev) return ret; } -static int pt_gpio_remove(struct platform_device *pdev) +static void pt_gpio_remove(struct platform_device *pdev) { struct pt_gpio_chip *pt_gpio = platform_get_drvdata(pdev); gpiochip_remove(&pt_gpio->gc); - - return 0; } static const struct acpi_device_id pt_gpio_acpi_match[] = { @@ -145,7 +143,7 @@ static struct platform_driver pt_gpio_driver = { .acpi_match_table = ACPI_PTR(pt_gpio_acpi_match), }, .probe = pt_gpio_probe, - .remove = pt_gpio_remove, + .remove_new = pt_gpio_remove, }; module_platform_driver(pt_gpio_driver); From patchwork Thu Sep 28 07:06:46 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: 145831 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3137870vqu; Thu, 28 Sep 2023 00:43:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHsy4A0ADe7X6/obKwyZYitXRl6Ng42FToZlL4giBUCKQl+VZtoAx/ER2cKAxm6ZLNtyi85 X-Received: by 2002:a05:6870:b60b:b0:1b4:4a2e:33f1 with SMTP id cm11-20020a056870b60b00b001b44a2e33f1mr439079oab.29.1695887022614; Thu, 28 Sep 2023 00:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695887022; cv=none; d=google.com; s=arc-20160816; b=DiiO7M12Q0Nmx4q4YjpUr7twwNl7XY7VZuM9NMeyy6TOQUjej7neO6gkIB894fXL4A gqCQSQFc2psaoucmEj4F21OjV/tMVO60pPXUMJpkgR1Fb1Sy0v5+AqXXDGrcw1pTXDnr Q1API806Gk1Hk77J6EfWDNHsvUT1QbynswTh2sE7/ubEiUI2dTrtktmoKxwwiYcHhjiI OKvT/7wbHJRp1iOfM8JLf4eAJcmDJcfXG6miz5kNzTfeTJR46is3HlBefvZecTC32saW ChgsKdZdbE0o0Xbv0csB1xdTXDtq1nzQXuyOn3mOmT7Q0++bVjw3md4FwTL3aEX08tol JwRw== 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=8Yq+diQUheCD3fUUT0CNmFL0pSY7EX+NHhNdESWu5us=; fh=EvJbm2+irY+PPyj+PTELouHtgCPy28Y0uZ3aUG7RGc0=; b=A5U77y64cNevI9Le78MllFVj4Z4ysyXjHcWHc66ivKIujMq6QfrERgPO6wXyBjyWtz 5Ir+PWcfbhX98+R/BjuFDaRnIWfFpEmXY4HqQh3oibantte0ZduNod/LeC6vNsbPFszG 4K87euYbVG9ddH639X15npZid1/OqQrXukCSOqVCoz7Ng4lVPbJmnDT41iMLoB/r0Ac7 iy1xytYgmNUBhh4UOOMmOgXTbWVsmALYxH1A+DrfaNkp2AGIRSh8SGSz6S81wstkFj/e iwgVGJCh7vXTsogl3Pwuqa0qgooeWBDMW0pok2KKZVJWPpNYII1gGSJiMwShqRJZ8U+u oeQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id l9-20020a654c49000000b0055785a37147si18409167pgr.590.2023.09.28.00.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:43:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 3392F840FE0F; Thu, 28 Sep 2023 00:08:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231567AbjI1HIX (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231163AbjI1HHX (ORCPT ); Thu, 28 Sep 2023 03:07:23 -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 4403CCD3 for ; Thu, 28 Sep 2023 00:07:17 -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 1qll77-0002OQ-ET; Thu, 28 Sep 2023 09:07:09 +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 1qll77-009WBS-17; 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 ) id 1qll76-005ZX3-Np; Thu, 28 Sep 2023 09:07:08 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Doug Berger , Florian Fainelli , Broadcom internal kernel review list , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/23] gpio: brcmstb: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:46 +0200 Message-Id: <20230928070706.2290137-4-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1927; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=L+YuiCv+iiMESLsUmp6IhUmqUktxmuMzPNS/HWpaLWs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRiwnkuoSq9wBB88Trgo/gTM6hWPAwSqR+L/ XF912idvtKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkYgAKCRCPgPtYfRL+ ThKzB/94/Ax3Aq+EhF1eAa0+/BxZXi3JwBr2XRoweGi9T1083yVRzfoS8tFl1Q23Ez69e/Z8sYD 7KiLZ5tprjeU0utGcs1jon7+ysvoD7Kzm6RaL6cSiCJPCQ7wjrlemFvfUsTViE5Ev3RCoubib2V bfE9sB4y4qPFJTHdm5fm1zoT0cCFvFaOR4ic0KSnxnq9ZwxjbC1Ylg160+bFvOr9sEBlp9x8P3l ZKdWePxLPgScwk7Un7vsRCad3LILqv3zZMG/qZ5oKYmSJlRg6sCNH/xuVfXR+Kfywy8U0a1AzGK twvQttfSz4m5vuTXI87y7HItA2L0iwS52sAfoT1vjfbnvkyT 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 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 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:08:48 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778266430556208601 X-GMAIL-MSGID: 1778266430556208601 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 Reviewed-by: Florian Fainelli --- drivers/gpio/gpio-brcmstb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c index bccdbfd5ec80..a789af4a5c85 100644 --- a/drivers/gpio/gpio-brcmstb.c +++ b/drivers/gpio/gpio-brcmstb.c @@ -371,7 +371,7 @@ static int brcmstb_gpio_sanity_check_banks(struct device *dev, } } -static int brcmstb_gpio_remove(struct platform_device *pdev) +static void brcmstb_gpio_remove(struct platform_device *pdev) { struct brcmstb_gpio_priv *priv = platform_get_drvdata(pdev); struct brcmstb_gpio_bank *bank; @@ -395,8 +395,6 @@ static int brcmstb_gpio_remove(struct platform_device *pdev) */ list_for_each_entry(bank, &priv->bank_list, node) gpiochip_remove(&bank->gc); - - return 0; } static int brcmstb_gpio_of_xlate(struct gpio_chip *gc, @@ -757,7 +755,7 @@ static struct platform_driver brcmstb_gpio_driver = { .pm = &brcmstb_gpio_pm_ops, }, .probe = brcmstb_gpio_probe, - .remove = brcmstb_gpio_remove, + .remove_new = brcmstb_gpio_remove, .shutdown = brcmstb_gpio_shutdown, }; module_platform_driver(brcmstb_gpio_driver); From patchwork Thu Sep 28 07:06:47 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: 145801 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3125028vqu; Thu, 28 Sep 2023 00:10:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMVQkGDBWgZMhJaPEPw24m2v4yIPWn0ubLcaSdH48Sp+kssJ6LemS6nshKOarNSCo9jY4F X-Received: by 2002:a17:90a:2e05:b0:274:8249:a85f with SMTP id q5-20020a17090a2e0500b002748249a85fmr355258pjd.21.1695885025347; Thu, 28 Sep 2023 00:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885025; cv=none; d=google.com; s=arc-20160816; b=MQ7hJYmixO1tudNsQ0q+ASo3TlMRynXQC0j9TGHXmaKTuAgRZrpfd9oglCvPt3In4O yhD7K/Rsjw3cGyl0tgbdUZpCxuPyNc7wZvJP3a77V8djfsfEjaIbzsMa8ArtaGs1hjz5 D2tfnw3MyHFJCGyoqq1gVQ9hkxA2hq+7JLV7WRAhnMSzWcHQ/3hG2HfvDHylpLZd6Vgp AzbozECRYkcOxOJv3eFBDrtEcTb2yT1W4OrcL1Qv1P3gzPtsHl2AIOqYE9avTYpxkY6D DQbO5aKm3mbtQG+7ChBwc6fy3ThplSEHsZJPvTqZpVb38PfUVWJE6VDtTl99p60RF2ai VTuQ== 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=rZWzmcu0xzSac4P0Xvb8i+5uAc83rNr670ln744novQ=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=NBZr6mizsSYMzRWOm2+cnH8qafeiIFZtFRGjkqJ/qMhncPRBk0VVNuKvd/cIMs8TyL 0+Mhal326NGCYeKLx5orSTFPeHQ5e84RgBKMnwxsf12goPMO0c8JeC+vnHfvi/VwgU2g ikWcfZxegdBHCfWE8Wm9H5aoULuB3MKGnSnfFgyfaASrYoCpz/GWpu750A1tZFUBHiQl VMX66/u8/Xbiy0igmAwVn3IgXzzAqDlfp5XXCPq/e4kBNFNrf4sidbwKX2o7PPlRdv5o Q0wtNuT3S/0ybWJlE7Q0T/OdOKJpH3jQdFD/LlZ1ML+gSHKaQlB7GRK1FKnp80Y/4wKl 0CfA== 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:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id my18-20020a17090b4c9200b00274274bf0ecsi20239861pjb.61.2023.09.28.00.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:10:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 9918181CCD84; Thu, 28 Sep 2023 00:08:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231339AbjI1HHl (ORCPT + 20 others); Thu, 28 Sep 2023 03:07:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231176AbjI1HHT (ORCPT ); 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 E63111B3 for ; 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 ) id 1qll77-0002OW-L2; Thu, 28 Sep 2023 09:07:09 +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 1qll77-009WBW-7v; 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 ) id 1qll76-005ZX8-Ue; Thu, 28 Sep 2023 09:07:08 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/23] gpio: cadence: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:47 +0200 Message-Id: <20230928070706.2290137-5-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1778; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oKB2MvZnK5i5YvDvXExUfueCuB3cMnfUrlLE9KkO6PE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRjE6GHo6kiT+SPmfCopcirXBDOR5xosW2WD KoSz0Gby6SJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkYwAKCRCPgPtYfRL+ TleQB/9U5RlRSkPYnDK+Vo6oCiJ690SIuygN0YVI2ElazMOwPo+aNMdwzGyb53qEJEXnKbwK5I6 ZhDa+emBITxnKTeLPeE+JwFqMfRRdKGVfgU/36ZRVAB+JcVKzqVnFcF3PJtDfHlicY1PAXD/+uC +N+Q3K+3vK2L7ED9usX3Zn+mGBoq5ckrCaO3rTVFPLCzKAVhOj76Jzz04/s26OsDMTv34mnga4v SmTsiVc7t09Xj4e1MXcjUtJkVM+2fJuxCBXZAutTyevjew3Jb8XSRjqPvijSTpvWtJOnkAQ0GDT DRB+4GVV5ve9kG77b6koWiUCQOtWShiAmQNlcF6IFHECEoBX 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=-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 pete.vger.email 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 (pete.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:08:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778264336355711972 X-GMAIL-MSGID: 1778264336355711972 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-cadence.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-cadence.c b/drivers/gpio/gpio-cadence.c index 3720b90cad10..6a439cf78459 100644 --- a/drivers/gpio/gpio-cadence.c +++ b/drivers/gpio/gpio-cadence.c @@ -268,14 +268,12 @@ static int cdns_gpio_probe(struct platform_device *pdev) return ret; } -static int cdns_gpio_remove(struct platform_device *pdev) +static void cdns_gpio_remove(struct platform_device *pdev) { struct cdns_gpio_chip *cgpio = platform_get_drvdata(pdev); iowrite32(cgpio->bypass_orig, cgpio->regs + CDNS_GPIO_BYPASS_MODE); clk_disable_unprepare(cgpio->pclk); - - return 0; } static const struct of_device_id cdns_of_ids[] = { @@ -290,7 +288,7 @@ static struct platform_driver cdns_gpio_driver = { .of_match_table = cdns_of_ids, }, .probe = cdns_gpio_probe, - .remove = cdns_gpio_remove, + .remove_new = cdns_gpio_remove, }; module_platform_driver(cdns_gpio_driver); From patchwork Thu Sep 28 07:06:48 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: 145813 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3129663vqu; Thu, 28 Sep 2023 00:21:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzBkypArB2ToCg1rv0A/uQM8YpAqoePKDcgD8cYD4NH4t7zDsHzw9flRCL00NDoJEB77eR X-Received: by 2002:a17:903:456:b0:1c4:62a:e4a with SMTP id iw22-20020a170903045600b001c4062a0e4amr340400plb.64.1695885703723; Thu, 28 Sep 2023 00:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885703; cv=none; d=google.com; s=arc-20160816; b=sH3/P//aZJ76tcmf4cfrXwhucatFOzGnUiQEbVOIE0hrxIkP/tksmDDitGmScw13hK 0ElsVDT1RVikhBMMhwGk4epZm6E5XQtnfKAcqYRqEPogXTWYlgom5qzQQhsiE/QHLKpQ dzNwuXHPrMkdZdwv3pzn5jI0Ci2OuXOI/BzN7VB5C/D2jxuwO1VTj2Jd9q0U7uDJ21xX aQP5pyaPDpNLlpKwBfm/A7Ql6A5piuwxcU4R97aq2zZqYj4fU0Mr4virnzLJ5SXhyFrm S5mfNPN+G7qTdHFAeHTxPo9JSN6TFVW0u/Gn9AMbTa4OyufLaXRa6Vt/3NNI/hC+pP8b kPCQ== 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=2fUGSAazIGj6xa3D4MK+/mXcxD9U98qsjkFjkgu/CNg=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=IypywkdqYGUCVoPv4bdCHLuBGyciF4b4/qTfOxw6Ia21tXG52+wm73Stbd2p0MvfV9 cSCOheaN6jn9iXxAQY52bOM2mMACC1PKMs8EPuX/3NY6d7EKt6i0a0p+qFrb/Ha0scsG 108vGRhPMln5LWvsIt8wsbWdl1qgkMFI6GOeVzO090wttWFzc7+yaCOeS5kdrXwEnNBK 9hHlAldqQHFzUj20Ykf/8rSLFogLO7ROLBeLC2OOdi0ze4l0fqi0HrY3ESgzUvSIyamw E/hHLclQc6L60Coxziqhrm3QEbHw6u47XoVTxz26oG7sad0GP1riCVWEGEmdgxt1OATV hIlg== 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:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id b1-20020a170902d50100b001baff05d890si4832344plg.313.2023.09.28.00.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:21:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 628AF807E794; Thu, 28 Sep 2023 00:07:57 -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 S231218AbjI1HHj (ORCPT + 20 others); Thu, 28 Sep 2023 03:07:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231166AbjI1HHT (ORCPT ); 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 E58361B2 for ; 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 ) id 1qll77-0002Ov-QA; Thu, 28 Sep 2023 09:07:09 +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 1qll77-009WBa-DB; 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 ) id 1qll77-005ZXB-3v; Thu, 28 Sep 2023 09:07:09 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/23] gpio: dln2: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:48 +0200 Message-Id: <20230928070706.2290137-6-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1569; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=biqDfI9M7d3E1sFhGRzLi5Y0K0g1VMmj7HWgBhC3W9A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRkLzXqHoQJjWHt1lfdVX0FRrTmSSk1IIHRw IuKg+Yszm6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkZAAKCRCPgPtYfRL+ TktVB/sFfvb39bvdNhkC1dp4L71giJ5S/rWTMATly8q6Tn0Uog8MdoXTgAqbtPtlJeOCGZvDlj6 cYxsjm9nu4n74vlPVCABpp6kSKdz5sec4BMudfu8v1W7/NYpV3vU+mZgO/AzER34BxBrSbT0bf4 j6HwRaRAk5QeVyJexTupnY5EPgs/ZOLUJLjsS5YXWY4zBI8ldHmqj3+pGkkBUFOThAA4dhMt5EB 1d+rbQICjy0FTyILgIps0q/wkhJzuqoQvd32DvAJ71+nxpTWqmUrcWwfphDlb+aXj+SLZHN9igb QCjSd7+CdO0u6hPNhaOV95bpAVP38zsrEv5kq23cWyl/AZlA 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=-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: 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:07:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265047916943406 X-GMAIL-MSGID: 1778265047916943406 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-dln2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-dln2.c b/drivers/gpio/gpio-dln2.c index 71fa437b491f..7ead1f51128a 100644 --- a/drivers/gpio/gpio-dln2.c +++ b/drivers/gpio/gpio-dln2.c @@ -504,17 +504,15 @@ static int dln2_gpio_probe(struct platform_device *pdev) return 0; } -static int dln2_gpio_remove(struct platform_device *pdev) +static void dln2_gpio_remove(struct platform_device *pdev) { dln2_unregister_event_cb(pdev, DLN2_GPIO_CONDITION_MET_EV); - - return 0; } static struct platform_driver dln2_gpio_driver = { .driver.name = "dln2-gpio", .probe = dln2_gpio_probe, - .remove = dln2_gpio_remove, + .remove_new = dln2_gpio_remove, }; module_platform_driver(dln2_gpio_driver); From patchwork Thu Sep 28 07:06:49 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: 145816 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3129802vqu; Thu, 28 Sep 2023 00:22:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGlaV1p+dSOtiBVJtC713/9WotLC7+KGc9YmFaAIB7tJq0PXlk0dpE7ZbyyPor6gB3SAo/E X-Received: by 2002:a17:90a:d254:b0:271:78a0:8ab2 with SMTP id o20-20020a17090ad25400b0027178a08ab2mr678965pjw.24.1695885723367; Thu, 28 Sep 2023 00:22:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885723; cv=none; d=google.com; s=arc-20160816; b=mrrMqu/Stdm03ex8T3ugJN0ieOZqqNqBuXJs0I/FtRzIoP+kTbmz8lZqNOLs748lfq icLEqTEJYX29ntU76yHcfSpVJidTYmUHHBH9P54hyWxsI8KjuhARKudzgrWHMX2yRaKe W2l81TL/xbblLuoQjRtfcrsMKuqqvJjd0nTXQ+gCO4UpEFMA5VrnBUBdzubsEdqXizZQ IC4Lw5CKtfNET69W5d+FYT2T8NzC9WWImvpE8nSHsFeWVfXp4FoRKTrM+s0PIq8OHRt7 mW2xmzL/XtCw3OE98Iz07Fc+tli25wLWjSw9avykxpl70SpOteRo17OKTbuBSdIv5LsE bStw== 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=hIEYxpe2ALQOk670RY/VW+FyS4wzr5Dp+hLviwpSFJ8=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=YPsbjoJfaZjQLxgRJayt3vfNm+eJUDqu3oO5LH0op8eSY/ZoBCny3ML6FGKeC/J+FN 75aaQt0tAdUauXIaylB2lzTYUPnE/YjyMFftDIm/KGdvtl9izabMAcwg9VyKqt1ing+u QMogaC8cTXsAjn9Vg7kAiNTs/bBOgZNnOD4FPgnM2IoDx7ruOs0dPCetgMvMcAwXDXOO iMOmYj6X1E5Xlp8jxHJkrSnZEmdk5xiZ6ZB16P32xFAM+DjxJEAmsJ+ONRJf1YqOetAV B19EK/H94Pw+6e8DRHNhbp/DM3sm85LwJymdcqVIoscIhOpPbbsRcLST3fL1TEytGGbt EGJw== 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 l12-20020a17090a850c00b00273f1cd73b2si6621428pjn.75.2023.09.28.00.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:22:03 -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 EF1B48295BCA; Thu, 28 Sep 2023 00:08:50 -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 S231136AbjI1HHp (ORCPT + 20 others); Thu, 28 Sep 2023 03:07:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231196AbjI1HHT (ORCPT ); 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 EF9BF1B5 for ; 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 ) id 1qll77-0002P7-VU; Thu, 28 Sep 2023 09:07:09 +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 1qll77-009WBe-IX; 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 ) id 1qll77-005ZXF-9M; Thu, 28 Sep 2023 09:07:09 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/23] gpio: ftgpio010: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:49 +0200 Message-Id: <20230928070706.2290137-7-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1737; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=l45A4QRi1f0y2FEP2IUoyR7fsQQnLWR2bOHoquRkF04=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRlaO92/QIUiLLMq9THmGFZLYQRcRkTVcpNb lUZrMHWXJqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkZQAKCRCPgPtYfRL+ TohVB/9NkW6LhKL0SbUO0m8ugQc7XQh+ipkYLG9n57q7CkOOh/ur3tH2nqMLiZm++b+l3n/WyQZ +uZdivrDmS3sBZ8HloBT49RCI2YGun98Jfv0BuY/eGohrhzZM+QDkBceYqLBMqpNJz2DNU2BSqc tNqpOvfvP4IAVCaswIXoXaY5NHgA19ZnCN9NeTym59xZluVSNfW4ras9iqYyZMPkEsAYt2SVZfu Asb1KoyOL+kUK2uYPi1R7SUiZerxN+fAvIOO81HotEkNJcXUonIt6lANDGZgMmW5kUchwkT+pbu qIVjsG+30yD2FOkh1TLFDqMA/SVE9g+mLntlDQ19GblpdaE8 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=-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: 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:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265068201792596 X-GMAIL-MSGID: 1778265068201792596 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-ftgpio010.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-ftgpio010.c b/drivers/gpio/gpio-ftgpio010.c index 5ce59dcf02e3..97d345b59352 100644 --- a/drivers/gpio/gpio-ftgpio010.c +++ b/drivers/gpio/gpio-ftgpio010.c @@ -324,13 +324,11 @@ static int ftgpio_gpio_probe(struct platform_device *pdev) return ret; } -static int ftgpio_gpio_remove(struct platform_device *pdev) +static void ftgpio_gpio_remove(struct platform_device *pdev) { struct ftgpio_gpio *g = platform_get_drvdata(pdev); clk_disable_unprepare(g->clk); - - return 0; } static const struct of_device_id ftgpio_gpio_of_match[] = { @@ -352,6 +350,6 @@ static struct platform_driver ftgpio_gpio_driver = { .of_match_table = ftgpio_gpio_of_match, }, .probe = ftgpio_gpio_probe, - .remove = ftgpio_gpio_remove, + .remove_new = ftgpio_gpio_remove, }; builtin_platform_driver(ftgpio_gpio_driver); From patchwork Thu Sep 28 07:06:50 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: 145814 Return-Path: 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 + 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 ); 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 ; 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 ) 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 ) 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 ) id 1qll77-005ZXJ-Eq; Thu, 28 Sep 2023 09:07:09 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , 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 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 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: 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 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-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); From patchwork Thu Sep 28 07:06:51 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: 145805 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3125883vqu; Thu, 28 Sep 2023 00:12:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9thbRTjY0ReqT9H3kpCEhfdZ14r3DSQOk9eMWAZGqf6dp3ngz/6vNxi2fKzD2jY4FtFOY X-Received: by 2002:a17:903:41c1:b0:1bf:22b7:86d with SMTP id u1-20020a17090341c100b001bf22b7086dmr444655ple.3.1695885145192; Thu, 28 Sep 2023 00:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885145; cv=none; d=google.com; s=arc-20160816; b=UeGQ5PJDpqKPJUB5RorGOHDSjzl4MEg/VJFqGdR7vhRb+QxOzk6OQKrljdOTwHbajs oO4r9X4kxlnN6i3ttQggGFhXVGGbzlAhwQk5zA6glxh5hi8MHyjlNO5LjTcUZ0uHkH8D axWmDhVBqjZCFc43b23YIBZtzSR2dgh9bPfV4chgjrv78xQoTHk5sQoMUHNpWM6+1ZQt rHHWsU3yQVIC9Luze5iLVrSH2UkpiuvNfwdGFqBKN5npvBFaLhu1hvmYX2OhP9HYEHOu iMZiEtkKVXafVb/gLiTHs1fIVgcnQ/Rd4uPWsB11FDCxmlcBkmmx4e6dlQdWydqfHNX4 WZ7w== 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=+hbtL7K8CIppZAiILciAkUvGAkT1ckR12evI4sC1F3Y=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=VCdpmNGsVTf5jEpe78uQcG69LXYyRn2t+cQ619TRO9u6Zm9yXRrgk/VkpLfTLObUwF kl9ojZBiqWQN7HIfgO01Uy8FxJ5K+/N7s9fQkmAYPgT+vfBv/+CXP3KE77PowWXED752 0EH1Tbtf1Rp51+qbxcq+ACDlWSDA9DvqscBpOlxFc2EkGTu5R9lfUGtKwKgiqi9fS93z lPcH7xzMX2Rx2Ei1F3DVgGbNyKx08FSvhY3qrXD4s0lxxI7Q4OnV5elsalLRMLdAOLyS jMuWOfvwfKmREkLdXOp7F1mwXqreuLyDSU6YKARaBEzhh2LBAbcthqSKcdfxZvbCaMRx Tm8Q== 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:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u7-20020a170903124700b001c724cd1125si4623818plh.203.2023.09.28.00.12.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:12:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 7A06883746B9; Thu, 28 Sep 2023 00:08:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231441AbjI1HH5 (ORCPT + 20 others); Thu, 28 Sep 2023 03:07:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231183AbjI1HHT (ORCPT ); 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 4FCDE1B8 for ; Thu, 28 Sep 2023 00:07:15 -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 1qll78-0002PP-A6; 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 ) id 1qll77-009WBl-TY; 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 ) id 1qll77-005ZXN-KF; Thu, 28 Sep 2023 09:07:09 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/23] gpio: ljca: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:51 +0200 Message-Id: <20230928070706.2290137-9-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1900; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=O5RheHuuuyYsWyRibPBNQY9XJKwZ/Al0AGKS9Y0bJLM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRnTU9g1tvdKqYIlPSGMuvVMb7c843MQyWqD ZtRkvV5eKuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkZwAKCRCPgPtYfRL+ TjL9B/95CyQdlBR0263hEPruOveU6oJ15c5ZJU58TShADPK7w95fS2FWL9Vga4nxik4zqF9F01q ebPip0V17ByPN35InOlmoIEIGdekf2a7edauEvzkGss4heS9PAdOn+1f0ZoG+PcQan3cswHy0nS IGqXSh30Rc7JOUN778J74X8sh6G+L5o4/P7j3NdTven++/wbE9yqrB+s2wpLqqGFh3tdAUXwIjx 0heUCzou+RuZreGh7VLJ9PrZ6X1OrvRGYaTj1Lto6+7b9F/7DYBjKBvPHTH7q75CWLZ/g8/oH/i 9II0ogwA1esU3fC0tkG4bv0d6/hcGpXLLpp5dorcMJveTAhQ 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=-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 groat.vger.email 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 (groat.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:08:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778264462115092417 X-GMAIL-MSGID: 1778264462115092417 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-ljca.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-ljca.c b/drivers/gpio/gpio-ljca.c index 87863f0230f5..aca69329455f 100644 --- a/drivers/gpio/gpio-ljca.c +++ b/drivers/gpio/gpio-ljca.c @@ -421,7 +421,7 @@ static int ljca_gpio_probe(struct platform_device *pdev) return ret; } -static int ljca_gpio_remove(struct platform_device *pdev) +static void ljca_gpio_remove(struct platform_device *pdev) { struct ljca_gpio_dev *ljca_gpio = platform_get_drvdata(pdev); @@ -429,7 +429,6 @@ static int ljca_gpio_remove(struct platform_device *pdev) ljca_unregister_event_cb(ljca_gpio->gpio_info->ljca); mutex_destroy(&ljca_gpio->irq_lock); mutex_destroy(&ljca_gpio->trans_lock); - return 0; } #define LJCA_GPIO_DRV_NAME "ljca-gpio" @@ -442,7 +441,7 @@ MODULE_DEVICE_TABLE(platform, ljca_gpio_id); static struct platform_driver ljca_gpio_driver = { .driver.name = LJCA_GPIO_DRV_NAME, .probe = ljca_gpio_probe, - .remove = ljca_gpio_remove, + .remove_new = ljca_gpio_remove, }; module_platform_driver(ljca_gpio_driver); From patchwork Thu Sep 28 07:06:52 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: 145819 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3129923vqu; Thu, 28 Sep 2023 00:22:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHx0DK/PFc7kfUDtGdCVbxH6iWteYDbaPIMRPADGhf8e6OJraoQlfUjSMpQerNuF+Ks1f2C X-Received: by 2002:a17:90a:fc8d:b0:268:5575:93d9 with SMTP id ci13-20020a17090afc8d00b00268557593d9mr383060pjb.10.1695885740144; Thu, 28 Sep 2023 00:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885740; cv=none; d=google.com; s=arc-20160816; b=itM9KBqETyXyAFuejd/DdrqLthb0eG0lslSO3BdtsZ+U5XaMyleTN/uY0hSSpZMrG6 VXF598nTap7GWwc9mayq1pVsnim3UiHH7I1Kgs4rmV7FrtLK+bmfaxQyJYHC/unH0f8W lpywvJDiswaFsaoeosiaCr9EVNtkTKlQoG7MJfcnhfqn8zHXRsm2G3jzKJUIXenY+YTt 4Haix6pp0zK2pNTASsJ0WZBhRX67ufQYZC37jEXCE+nrc9kB5w2gGX2eUs8gAJLFE5xp IeuXMh/idYUEtp0rycURyGY3QGN1RpjrDhVOl/Z2UQttbmZoUlrxTqaE++pSJqxKMiKf QzxA== 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=d/yrGTXlbNSmrzKJUPs1rmDDY73+/g564hPDmh1hH7w=; fh=I16MXgU9/F1F/O68IINu5g0q3bpOVKiW8gROJtl8jvo=; b=amELkB6ODcM4Yj5p4tdJdABQ5TCkbzrBRb61IjEtGnM/lZslp/sZTkgM9pgrvHM/fd 7FyYaouGe7zRjcx2uDIfurtKKJl1vqhf7AoPW7PPP2BFSrd6cGJjPjStraqMwhAGptz8 Uhh8eAu+DqFofTdzDJos8kkFxC0DlqmaFOLweK6tHuOJqgs9yZyIjTO0BgVCeJ+uRjMP DMjwtn5t6sed/m17OUJMZQ2AFa7nMETFTTajsP2o/EhqyjGR+j6O9pKfSGxvi0beljq6 SEFA8HbBW5JYwnlxLxtbzl0j66Mwp9BSYzqvu7xDv+a1ua9io6zh0+HMrD45OikPCFT3 h2Kg== 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 u9-20020a17090adb4900b0026b502223cbsi11686235pjx.10.2023.09.28.00.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:22:20 -0700 (PDT) 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 C480082C120C; Thu, 28 Sep 2023 00:08:36 -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 S231403AbjI1HIZ (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231271AbjI1HHY (ORCPT ); Thu, 28 Sep 2023 03:07:24 -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 C3C6EC1 for ; Thu, 28 Sep 2023 00:07:19 -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 1qll78-0002Pi-IO; 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 ) id 1qll78-009WBq-5A; Thu, 28 Sep 2023 09:07:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qll77-005ZXR-S4; Thu, 28 Sep 2023 09:07:09 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , Vladimir Zapolskiy , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/23] gpio: lpc18xx: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:52 +0200 Message-Id: <20230928070706.2290137-10-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1898; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=r6gSrBD5louss3Pb3GEhi8iDF5ZJsJp/xHMLIjEPUXI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRoPPwhAHeunrGSHzBaqKYVPL7fpeFT8pED+ BnfUsDk0tmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkaAAKCRCPgPtYfRL+ TheCB/95/GzZjoA8Q8L9sPtKA+hptDBPpeF5lihSAoaiMRz/uH3/D+E8LgTG4QzrMkHqT7w8RP6 t9giJS2C73ja7I/bnZOTKYdBAnr8ES9SBPKI9vrnTsTOa4k9L7PBGTDrkUoPkSAqlXJUv09s6H5 V8At5Qfsf60TBp2xjXqosU/a7iv2MCfjF2ETHgIuBZ4DVWx9vv44tFvQpG883c3P3edp74ZUuRE 6UQwnhielvT+qJC0rSw7g9ewBtBA40Xr6x5aGlYHmXh4WiV9jClrEo8vUKXt0f7zC3+AKa7KP3r /IKK8HgIuZMZY+oHw1JzvIrYkHR7ab1a9OHmfhyK1xroJgeu 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 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:36 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265086204889590 X-GMAIL-MSGID: 1778265086204889590 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-lpc18xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-lpc18xx.c b/drivers/gpio/gpio-lpc18xx.c index ed3f653a1dfc..5c6bb57a8c99 100644 --- a/drivers/gpio/gpio-lpc18xx.c +++ b/drivers/gpio/gpio-lpc18xx.c @@ -381,7 +381,7 @@ static int lpc18xx_gpio_probe(struct platform_device *pdev) return 0; } -static int lpc18xx_gpio_remove(struct platform_device *pdev) +static void lpc18xx_gpio_remove(struct platform_device *pdev) { struct lpc18xx_gpio_chip *gc = platform_get_drvdata(pdev); @@ -389,8 +389,6 @@ static int lpc18xx_gpio_remove(struct platform_device *pdev) irq_domain_remove(gc->pin_ic->domain); clk_disable_unprepare(gc->clk); - - return 0; } static const struct of_device_id lpc18xx_gpio_match[] = { @@ -401,7 +399,7 @@ MODULE_DEVICE_TABLE(of, lpc18xx_gpio_match); static struct platform_driver lpc18xx_gpio_driver = { .probe = lpc18xx_gpio_probe, - .remove = lpc18xx_gpio_remove, + .remove_new = lpc18xx_gpio_remove, .driver = { .name = "lpc18xx-gpio", .of_match_table = lpc18xx_gpio_match, From patchwork Thu Sep 28 07:06:53 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: 145803 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3125244vqu; Thu, 28 Sep 2023 00:10:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHa00n911MZu9sBlI0aj91kkLIJu4fszyk8/NRIxNmiIGWJhQxVL0/fRKBRyGCp8IUfdLyw X-Received: by 2002:a05:6a20:3c87:b0:15e:bcd:57f5 with SMTP id b7-20020a056a203c8700b0015e0bcd57f5mr426052pzj.3.1695885052118; Thu, 28 Sep 2023 00:10:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885052; cv=none; d=google.com; s=arc-20160816; b=m0yBGqrdSKIlFT4EBnbIDEL8vNQ1WR6S4PKKgpGXL3mP98JUp3+m64VmkiOLIgb2BH wKd2twd7aiTtI29xCP/27Zq83LmANPtrrbqEXFZ1WRbGsdIR29I435eF5ntYVM52G9gT Qq2/6BCso+19m5pW4oMjTsidZRst6UOM11sAXVQB5OLogFQsdReqkW6cF7E/cVhNsYdy 21ZeGYxi0ZLgU8U9cYscwxmIauJGJ0zEnGBE5j2HGe5cg5i7uFWp0NdUju2r3ki4aHDJ e8M28+VXK5isRUcbf3nBSJkK+EPLHSbzknQRjH+Cz9HTRyC9amVqtWcOhzwNen+52ibM sm1A== 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=0PPkf40gS0OqUBZdBL7wCnCuWCKuOnpyXfAUMdq9M0E=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=0P9sZFUHOP7NvQKjiTdSUpqsTfKUPa4mmxCUQQGNXdRTuk0djci5bcVau5+lbzSPAI AZA4Iu+WxXrRKU633UxcIjOoGKfW3/gnoh6DE93D4FdUU0Q9Ha+wROLncXZM8xPL+8Yf WunNKckQDWwKgHmzRuUnyvhRCJOUo3fE+s1Z0qoQAI22T8hbuVjhWYjOY6hGovBeTuX7 N1GMx9dohrTh9t0s1SHIk4Pj7f+hyg+vqT2Jf2c8XWGLsjqcmgANgyDvdImbipTW5VAR c3H1oWcLW8HX1XTX6G35oCLJaXTTka8pk0N/Ros3bjpaaL4IAgAF8LS/FE21gxWOHn5A QoAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id j8-20020a170903024800b001c1e1fe16cbsi19504201plh.255.2023.09.28.00.10.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:10:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id BEABC8021B2B; Thu, 28 Sep 2023 00:08:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231409AbjI1HHs (ORCPT + 20 others); Thu, 28 Sep 2023 03:07:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231199AbjI1HHU (ORCPT ); Thu, 28 Sep 2023 03:07:20 -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 9EB621B9 for ; Thu, 28 Sep 2023 00:07:15 -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 1qll78-0002Pr-NZ; 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 ) id 1qll78-009WBu-AS; Thu, 28 Sep 2023 09:07:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qll78-005ZXW-1M; Thu, 28 Sep 2023 09:07:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/23] gpio: mb86s7x: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:53 +0200 Message-Id: <20230928070706.2290137-11-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1839; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=WPcDIjpmyzu/jlqFKeLdgoc1fiE6YSUTS+0IHvir+Ow=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRqf4S9RdTk3Q3vhF0e9LUO0JOBOrWkbuHhq 9c0as1k9giJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkagAKCRCPgPtYfRL+ TnoiB/928vsCsni4kOWZ4UadomEZI2aY26oH+s3dV0sdTV9DHAnFCdL/a+GIkr1oedvp5QZLdSz 1UxVEN5smKMWfOzv2kA2hWxbg6FqPiiYb3n4fkmrLdAxDk6cVBDzd08U6vLmPDcZU0utTZsVSnd J36y+MKsrAvFo3IUboLzCh6ECrRd7+em1NqdmdQlHWYT02bganpFFKufwUhujSizfwz+va/hjTE oXePogmzX1VMBv9Ccex4LoaRrB4Y0LC8/l2oVVU5zQuebK+E5TbLj2AWiDMUmVjC0/ipU/3LOFC WNoq4czfd7HrBKXwXZjRWL/atX5fh7kX9tR/T/w4BOpn2KWZ 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=-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 morse.vger.email 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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:08:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778264364509164619 X-GMAIL-MSGID: 1778264364509164619 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-mb86s7x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-mb86s7x.c b/drivers/gpio/gpio-mb86s7x.c index 248df657c38e..7fb298b4571b 100644 --- a/drivers/gpio/gpio-mb86s7x.c +++ b/drivers/gpio/gpio-mb86s7x.c @@ -204,15 +204,13 @@ static int mb86s70_gpio_probe(struct platform_device *pdev) return 0; } -static int mb86s70_gpio_remove(struct platform_device *pdev) +static void mb86s70_gpio_remove(struct platform_device *pdev) { struct mb86s70_gpio_chip *gchip = platform_get_drvdata(pdev); acpi_gpiochip_free_interrupts(&gchip->gc); gpiochip_remove(&gchip->gc); clk_disable_unprepare(gchip->clk); - - return 0; } static const struct of_device_id mb86s70_gpio_dt_ids[] = { @@ -236,7 +234,7 @@ static struct platform_driver mb86s70_gpio_driver = { .acpi_match_table = ACPI_PTR(mb86s70_gpio_acpi_ids), }, .probe = mb86s70_gpio_probe, - .remove = mb86s70_gpio_remove, + .remove_new = mb86s70_gpio_remove, }; module_platform_driver(mb86s70_gpio_driver); From patchwork Thu Sep 28 07:06:54 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: 145817 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3129827vqu; Thu, 28 Sep 2023 00:22:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHexWUTtaKCwun7h5uBktiLG1poNq74rPrNys9H9SuW6DCtbTG8EESh9qyqMtYkFYPofqrn X-Received: by 2002:a05:6358:786:b0:13a:2b5c:84b4 with SMTP id n6-20020a056358078600b0013a2b5c84b4mr360776rwj.4.1695885727428; Thu, 28 Sep 2023 00:22:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885727; cv=none; d=google.com; s=arc-20160816; b=ezPTJ8As9USIIkwzB8ZnKD007/qbIIzQvYI97n62XNpIavS7abeCEgvsJx7smJTDch dbbEBUZdpHb1oGQwAWBHLnM07FrXtpLN21rINKQcdEhjM2rRJYwcMknoy7BDDqWlJjaP 5qWosQDU/GPen3IrsnbisqnLO4Q87xmmukZGOOVmEsIoML0nWA1gWjYQ0yOORU3Tjzdo m+stZyp5UUiD6YBZYOTyD+TtSlzWCROXN79TwAUCzcTStz79CQRZ1t5wVmCz4yfnZIyQ mUg17EQK3xUAuZL30l2PuSbguLaJ++XJB7jB10YAtLiYlXSZBHiGQqueoH0Xrj5d2ym1 N7eQ== 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=hLgTdwn4qZXC3JAFPz246LNK69S93j4YDwly07hGOdI=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=BI7ZNgJFxcLF1AdQTMJToJL0BVJ15vnXjK/0YZd5MEk8wl+EgaGYFJa14vBXWxiTXz xK54jaoHz6gBFNAJ9SfpjDbafQIJEh3PywITUzyeoD9qPspFcBYpogpnNJQueoZ4gGsx 5exRuElFulddBmJGVu15fa99o/pu9W/NhCGBdm1DYXV97HZ409DoAzeQWeR5rXIRQR20 gr4E5NuvL+KgAcmdiS6mLvkOCvrLbJnY1C7/OEVa8zy60vRcJJ5j3RI6YI/fyFaqORyx HysswjZLE0PeYT8YGYgG6/ux/W4quKoENiU19gx6CmQvG/kOESsILr6umr5VK8ZJ1f3e 3iIg== 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 s132-20020a63778a000000b005649893593dsi7004934pgc.880.2023.09.28.00.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:22:07 -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 86AB78296F04; Thu, 28 Sep 2023 00:09:08 -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 S231422AbjI1HHx (ORCPT + 20 others); Thu, 28 Sep 2023 03:07:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230403AbjI1HHU (ORCPT ); Thu, 28 Sep 2023 03:07:20 -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 C427C1BD for ; Thu, 28 Sep 2023 00:07:15 -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 1qll78-0002Q0-T7; 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 ) id 1qll78-009WBy-Fc; Thu, 28 Sep 2023 09:07:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qll78-005ZXZ-6b; Thu, 28 Sep 2023 09:07:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/23] gpio: mm-lantiq: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:54 +0200 Message-Id: <20230928070706.2290137-12-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1779; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=n5tiuRCZj+BI4ArBL1amsTPNue/ACzoBE2dS/KHIXLs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRrWhba52Fylm7LFemgwnPLaJRVq+zUqKPqv OWYJQCLyxCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkawAKCRCPgPtYfRL+ TpCWB/9iGudW5Pk35ZktG7pTbbs8Uohfe6WU7C2v7LbHdrnJFYoyEx/B8EtE3xt2ZzFmXC/mRZN 8bNtV2KaTSAVDQYbWp2vzW708oSn9H285Mjh3rRS5OtP2oaX1TbGZZKg7cCpXTyIbiG1xbVboVc 3lhREAsWNG+5cmVK8+MHhXPTpVZ+2M0V9VYICvyGJGjXGtS4HRcVTWQX+LpDRODXn51oxiTDaB5 ggcCmP88teX0WcTozvX0PIkw+BW6VM7nB3AhMycLcaX3t8qzzNxhLtjvMv5RZ50kSoF/pxkT21X ZcPaHnQSxIlLesCQ0kJsp0NMUBG/KOfVqQbtW5NhPCEeTVyW 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=-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: 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:09:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265072494582521 X-GMAIL-MSGID: 1778265072494582521 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-mm-lantiq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-mm-lantiq.c b/drivers/gpio/gpio-mm-lantiq.c index f3c158259636..e855c68c981b 100644 --- a/drivers/gpio/gpio-mm-lantiq.c +++ b/drivers/gpio/gpio-mm-lantiq.c @@ -121,13 +121,11 @@ static int ltq_mm_probe(struct platform_device *pdev) return of_mm_gpiochip_add_data(pdev->dev.of_node, &chip->mmchip, chip); } -static int ltq_mm_remove(struct platform_device *pdev) +static void ltq_mm_remove(struct platform_device *pdev) { struct ltq_mm *chip = platform_get_drvdata(pdev); of_mm_gpiochip_remove(&chip->mmchip); - - return 0; } static const struct of_device_id ltq_mm_match[] = { @@ -138,7 +136,7 @@ MODULE_DEVICE_TABLE(of, ltq_mm_match); static struct platform_driver ltq_mm_driver = { .probe = ltq_mm_probe, - .remove = ltq_mm_remove, + .remove_new = ltq_mm_remove, .driver = { .name = "gpio-mm-ltq", .of_match_table = ltq_mm_match, From patchwork Thu Sep 28 07:06:55 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: 145808 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3126900vqu; Thu, 28 Sep 2023 00:14:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5eIoV7TSf03bGFK363ipOciD6EJdl9cirlP0flp+JU1EnvsvQcMMFLb+Y93Ec7gdxH4eG X-Received: by 2002:a05:6871:80d:b0:1d6:51aa:139b with SMTP id q13-20020a056871080d00b001d651aa139bmr465497oap.19.1695885295235; Thu, 28 Sep 2023 00:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885295; cv=none; d=google.com; s=arc-20160816; b=k0JKQiQnpFtevKsPTEVdsVSduyuvt+y23nkjh9EQW673T9L+4SGrIjvTerUTJYPv0z XybdnwvTuf38q7oYFGalws/T3YDh8Oy6yx39iIC6XlaUPLgG6mriR+B6uiR/Cb4fGRra 5tiDaaaCpN1SNsMgdZaUvPClyaZ6NvsYA5pabqzNhgnH53gEWUW49rAia2KOQGzbeA1j KyReVEVaK4HTYB6LWIkllhLuoV1e3LwhDwRV5Q7Vt/g1PFi+iXas6g8BnLW9Ds2IsRrW dHEl430VFH9rC3RKv/Q2YpJXdczrzAMSWfqv9YxKtjb66zNSdWVMCJjyLl8WoiSR8IpQ RA2g== 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=msheAVaz1X2AVfROiknk9e8UBv+cREKY69Zlzrr/Ibg=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=yMAHxBo0Bd1EOF0gnRPyA5JvR8/wE+GMDRSqGz6A+Pq2OnWkd/lZWrEA09LfFEYheR DM6ayunmTPGUqycPzZQND48SD/YcNBR4U4jGvFIqZ6kSoywN3vyI9bqpyEBPyJhar9ky XZQnFMIc3e5HGc5jQuK5+T8Epmj2YYp49sOFXiWpaj+MNaBfOCLtVoL8piYyUqUculfv 9xnV0MtVGCpLYXSAtwo7uobXI+4W30oNLkz/wRtTi5n82l/pX4qNbA2h1lmidqf2WFRy D2m1C8MKEpDWsdZXqp84xzzZaijjITnJthAKO7xIMMVTg7TQ/6TkFD8MRGqFuX2UQQPL zSTA== 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 n13-20020a65488d000000b0055be9543340si17324274pgs.872.2023.09.28.00.14.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:14:55 -0700 (PDT) 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 5A97F822CF35; Thu, 28 Sep 2023 00:08:06 -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 S231324AbjI1HHz (ORCPT + 20 others); Thu, 28 Sep 2023 03:07:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230441AbjI1HHU (ORCPT ); Thu, 28 Sep 2023 03:07:20 -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 1DDF4CC0 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-0002QC-1t; 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 1qll78-009WC2-LF; Thu, 28 Sep 2023 09:07:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qll78-005ZXd-Bn; Thu, 28 Sep 2023 09:07:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/23] gpio: mpc5200: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:55 +0200 Message-Id: <20230928070706.2290137-13-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=2101; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zmgUfSKQdCVTn8R3yT+ExDBT2pKzswgrwKMQchT/9+w=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRsPE9N9aetn2FJ2he52w0YP2cqBNLx7tI5j 5dsuyqX92yJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkbAAKCRCPgPtYfRL+ ToZMB/9yLWW6JUJdo8x9wXhN+yAwH4sgUpCYI99iJix+SieoJshz3IKPq0lUDSwGymVONezHNHZ yLV1+XifKo5VFx1JGRQ6z315BMWhRI1Amj11CoGZhPE1PdTtVQ3oQn7jed/CQ+J0tsPw+W0DjWq dHDpNgaZ5EO+rHczvHfKSejNzbSunkSZoDvfyU+y6kME4xdW0j/ociKE5NHYPMqfVSYFlXXXDav cZulsr8eNlNF4nWkRO/+0OgyU5zuDZ8uJXjnDozfZaA3JdjKPOrmputEDrT1N+eyUFS8RcBTGOo 9GDpjZBa/OfKPGStK+Tg/ajV0D+WEzj3N7PigCRDeWk6lErm 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 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:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778264619246413643 X-GMAIL-MSGID: 1778264619246413643 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-mpc5200.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-mpc5200.c b/drivers/gpio/gpio-mpc5200.c index b49e3ca64015..a199dce3394a 100644 --- a/drivers/gpio/gpio-mpc5200.c +++ b/drivers/gpio/gpio-mpc5200.c @@ -165,13 +165,11 @@ static int mpc52xx_wkup_gpiochip_probe(struct platform_device *ofdev) return 0; } -static int mpc52xx_gpiochip_remove(struct platform_device *ofdev) +static void mpc52xx_gpiochip_remove(struct platform_device *ofdev) { struct mpc52xx_gpiochip *chip = platform_get_drvdata(ofdev); of_mm_gpiochip_remove(&chip->mmchip); - - return 0; } static const struct of_device_id mpc52xx_wkup_gpiochip_match[] = { @@ -185,7 +183,7 @@ static struct platform_driver mpc52xx_wkup_gpiochip_driver = { .of_match_table = mpc52xx_wkup_gpiochip_match, }, .probe = mpc52xx_wkup_gpiochip_probe, - .remove = mpc52xx_gpiochip_remove, + .remove_new = mpc52xx_gpiochip_remove, }; /* @@ -338,7 +336,7 @@ static struct platform_driver mpc52xx_simple_gpiochip_driver = { .of_match_table = mpc52xx_simple_gpiochip_match, }, .probe = mpc52xx_simple_gpiochip_probe, - .remove = mpc52xx_gpiochip_remove, + .remove_new = mpc52xx_gpiochip_remove, }; static struct platform_driver * const drivers[] = { From patchwork Thu Sep 28 07:06:56 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: 145830 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3137681vqu; Thu, 28 Sep 2023 00:43:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0AYAgQ+Xo86evNGxDWEaPuE9CQelGl7JoIiQsEDMla4zIIdaloHfzHaqg5l8JCrkZlnzu X-Received: by 2002:a54:4086:0:b0:3af:583d:3c5d with SMTP id i6-20020a544086000000b003af583d3c5dmr418375oii.52.1695886983767; Thu, 28 Sep 2023 00:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695886983; cv=none; d=google.com; s=arc-20160816; b=diUjOnZ+lhv/p1zMCXM0tG86tC1rZOD2NTzIUYzNXZCcsR1FP6i4DqgdhF2TIvlPBc 9KOor2BpYWfleTtkQ5L5KfcJq6TWX6IhruMkjfxTUhpmY82btzCik9VfcEMYRTBHGB9W 9Svcj1z+ENEGGUx8nc6LNjWE67bYto9/WcccjaMe0MEUa/KGcuuvuZQ4yobXNWC1cTAK 6sBvm4XyJEjI6pakTzt3SUwhGVhgfqPREqxcFIrCa2BbMXPccF3F2R4ebR4PDjbB8q5A INJzN1C7Z5p6OKP2/MY5jG8ASoFcthAiv9g63dZfn6CvrrHHbo6MltYHrpeZJ7rYMXx2 tNJg== 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=f65VLpQdJxtxqWCFvaKCJMHc3aDAVi9g15eaI5HkdcY=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=leIB4ex1YzMY0lZDeMAY3JWdXGs2ZSqUJUmrHuQKBn1OWFEeTzxHiNIxawc5yXLTdA 8QoG1QZimyUTty5+tzQIdi533oK9DRQyi0/CRqCRxexP5S3s+1b2R3r+MS18/QkRcfft 4/RgvULnEMDBqUTRKClBbkXDJstp4ESEQsZAw+/ttX19vRtOAEgbwJvzgnK/6mIrO/t9 lNsmfYCfXHBepZrqEiol0CxNOJMeHTrMiwSqUnWXX2NzUqUQ/+khoY03wOvCwcy++wLw 3y8QyIquIw+ytiRxMEAmeKY9fHeP4R/QyPVzqRzTa4B8vYQGuXmzEduaoZoNlYBxfvLg gLpw== 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:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id f20-20020a056a00229400b00690daa48517si18951182pfe.200.2023.09.28.00.43.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:43:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id ACFC8840B7DB; Thu, 28 Sep 2023 00:08:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231310AbjI1HIT (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230487AbjI1HHW (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 9F412CCB 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-0002QO-6q; 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 1qll78-009WC6-QT; Thu, 28 Sep 2023 09:07:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qll78-005ZXh-HE; Thu, 28 Sep 2023 09:07:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/23] gpio: mpc8xxx: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:56 +0200 Message-Id: <20230928070706.2290137-14-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1863; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Jl41cOt7+Lv9JbkVXP3DWMA0yt63VqWt5+gjigiRDOg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRtx7bDmd79vKN6bzdwsQxQsN6SAjHD3+1pI KhejWJqu7qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkbQAKCRCPgPtYfRL+ TvrdB/4nqoqozrSwD19oFZgtMtd/oH7H9w0TmDzyaMqL9WZExdF4GZRBYQIE8Il+hTgu/bFbHMW doEf3zmZ877nRP8PjdxNXU2/6cAqoi2QKHycIc8HtkPFpr43FMiCvVSBzL6GSO32CmNymsDUJtv 0+N0M+iFPb3IsBUYRzp+syaq6+V8P4gLo+5/9fs8yJMzM3mDta9eK2LRmqtOyEe7ug6saInv5lV D37SGeV/Yxdhn77ou2d2t8TdXzc4a5PrzVao4g7/owwdP5girmgxsFEj7erUnDgK0sbaF7Jtgnw Wv4gjke//rQVi9Qm6UZfxG5P37P69lQTrFgb/EpVnSNcAPeI 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 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 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:08:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778266390062396990 X-GMAIL-MSGID: 1778266390062396990 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-mpc8xxx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c index ebf2f511df59..c0125ac73906 100644 --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c @@ -419,7 +419,7 @@ static int mpc8xxx_probe(struct platform_device *pdev) return ret; } -static int mpc8xxx_remove(struct platform_device *pdev) +static void mpc8xxx_remove(struct platform_device *pdev) { struct mpc8xxx_gpio_chip *mpc8xxx_gc = platform_get_drvdata(pdev); @@ -427,8 +427,6 @@ static int mpc8xxx_remove(struct platform_device *pdev) irq_set_chained_handler_and_data(mpc8xxx_gc->irqn, NULL, NULL); irq_domain_remove(mpc8xxx_gc->irq); } - - return 0; } #ifdef CONFIG_ACPI @@ -441,7 +439,7 @@ MODULE_DEVICE_TABLE(acpi, gpio_acpi_ids); static struct platform_driver mpc8xxx_plat_driver = { .probe = mpc8xxx_probe, - .remove = mpc8xxx_remove, + .remove_new = mpc8xxx_remove, .driver = { .name = "gpio-mpc8xxx", .of_match_table = mpc8xxx_gpio_ids, From patchwork Thu Sep 28 07:06:57 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: 145822 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3129954vqu; Thu, 28 Sep 2023 00:22:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqE2sA9zcHq/yDSQeZahirXvmxv8jM4Vk/+GG+/P7MolZ4yfV5jnfIVuiaHeA1nMNgwXSz X-Received: by 2002:a05:6a21:778b:b0:160:e394:ff79 with SMTP id bd11-20020a056a21778b00b00160e394ff79mr412545pzc.53.1695885743545; Thu, 28 Sep 2023 00:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885743; cv=none; d=google.com; s=arc-20160816; b=F2kSK2kT4+ZTUqZ27Poz97QIPoJ2ijBxJfX+8qIae/JC30hu8sQcsBvDT3ffUDxEKN YLRXqITfV4nU+94BkP5UyQdUs/OPBEF5X/vReIP74Xd4FaKo31c0mxlkLIVYdgAqZ1Nm 5METmORqDgl+3uVmY2xShnuPUj1RlGFqw2IbYoM/SLKWUGPeMgRXNeFzIaZVGkr3stp0 FH02d1dhHmywgXnHj/XU404dk4xcMqomP1i0lcK4L2sJDWbyL61Qe3WgPRJyL/4gUCLd Sr4NH05If/MiGGPpy40OrdaVCtdxIM+k3lPamWzDlt8MKi6TfivFO8J3d1HJFF+7lE+1 I4hw== 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=tSRtJaCHjw1G+yvenY5K9/VKUij9fCpyUoJDtrXSoDM=; fh=Hpnc0w6gyISbyCdE2W3MRFUu4SZVY6186ODeDtMIGaQ=; b=Zn2M1HTK3BGKNt3cClF3/aTMI0nKep3oGaTdT352497oU1nxMtvQDzdQPFvXARKJe4 PMhHxobV5i322KngDQ6A8rkXl1QWBVYtim25Rka54IcVKSpUHcxUqNXPhNk5bhlwfRiD kSi0KUBaux0bN5tnOWOmdt8SoprKXkadFOxsONhRxgMG3dPGPJ5ML0W1N3z+kKz1htfB wHBUjeH/MifAmy2QVOg/0HQQYmCDKRHXn+znSBUtJQ386ZVTRDSAmuPSMpJb+BWySpdo LiA1TvexAI5Bt3CUogHxYXUr6ZsrZ+Abv9LeZ/uEwg1yU5GpbxUTKmpqRRUj1Nmy2cPA KQcg== 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 Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id kf16-20020a17090305d000b001b02e8d8976si16364100plb.300.2023.09.28.00.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:22:23 -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 4003182C122E; Thu, 28 Sep 2023 00:09:03 -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 S231460AbjI1HIz (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231300AbjI1HH3 (ORCPT ); Thu, 28 Sep 2023 03:07:29 -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 AD6C81B0 for ; Thu, 28 Sep 2023 00:07:23 -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-0002QY-Cf; 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 1qll78-009WCA-Vy; 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 1qll78-005ZXl-Mq; Thu, 28 Sep 2023 09:07:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Andy Shevchenko , linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/23] gpio: omap: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:57 +0200 Message-Id: <20230928070706.2290137-15-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1865; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=wEFMqOEsGUYaZ8PzVi4YAslK/wtyEnoVwyh+B2QiGHA=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlRRlbxIu50W+V/ltro6/2PTeD3tldWFTbvbFHTcvRYZd bsc327XyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBEgvey/5XzVPASU7Hev/Dd bF3v2MSlW/OyTILeFl82ebjl0eb/nle1Fy62YhBU2mQkGPDwcMbv+g039OKkP+dXr0hdqpTfqrF PUrFQ8fH61E2mn/6fYUr6wts00/zEktWuv+6etOyVmf+hTVN+q+Sac5rPO+/o53Ue59MJ+Vj/SS XLZLbzUZ/VqeVlClGLa5krvbwVOXidN3uJr0qLb3+UK898Jex5qKjo86m3sxosaqKKtXeseTuPx SlILWRzd2pRbJ3L6l+aLRtfpj3xv8th2f5n5TXPedGvjF5uc/EIqOPvZnNIdf0q9T84ek2vgqW7 15tyu+LZNeqpftMimYI3WanuKyxPz59jwKyWmu0RORkA 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 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:09:03 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265089042634199 X-GMAIL-MSGID: 1778265089042634199 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-omap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index a927680c66f8..8889755e2d03 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1489,7 +1489,7 @@ static int omap_gpio_probe(struct platform_device *pdev) return 0; } -static int omap_gpio_remove(struct platform_device *pdev) +static void omap_gpio_remove(struct platform_device *pdev) { struct gpio_bank *bank = platform_get_drvdata(pdev); @@ -1498,8 +1498,6 @@ static int omap_gpio_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); if (bank->dbck_flag) clk_unprepare(bank->dbck); - - return 0; } static int __maybe_unused omap_gpio_runtime_suspend(struct device *dev) @@ -1560,7 +1558,7 @@ static const struct dev_pm_ops gpio_pm_ops = { static struct platform_driver omap_gpio_driver = { .probe = omap_gpio_probe, - .remove = omap_gpio_remove, + .remove_new = omap_gpio_remove, .driver = { .name = "omap_gpio", .pm = &gpio_pm_ops, From patchwork Thu Sep 28 07:06:58 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: 145825 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3132060vqu; Thu, 28 Sep 2023 00:28:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzZgppPhIKE7RlKboiNGnUjWCHxa0x3xZkj+Ifq45w/FkibDLEIZR03CwKMtVwygRRtOTt X-Received: by 2002:a05:6358:7252:b0:135:a10e:1ed0 with SMTP id i18-20020a056358725200b00135a10e1ed0mr412732rwa.23.1695886119203; Thu, 28 Sep 2023 00:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695886119; cv=none; d=google.com; s=arc-20160816; b=AvQ2AzUZ8JBrQyZI4sI911G3w5+43nfBYiwvxZ40hQEo/Qm6llYmjdgIs4GFIPzEiU Ji7+Cqn62/MByWGbxaYb0EKur9Vy+IfUB3kV1YgXX3+Un3xFurqTESFg+9taL7TjHnf9 /JEGgjBZljZHmWn7BVm6IenRtB7GUhPB7QUwJMNJ3xGbovB8sUVkcoAEG3INQRGjYeez g8JlFdyb0nGPXZRiWa36d1mumHqhIwiMii6GZriDp6XFkzGtq8JZdNV9YNZnmu/0r/0V le6gUC6UIQh6ifLX9knJKHIEmtFwqXK2aHUCx0iLQN4mIKYSJHXFy16OzmHVDP/GiHQH Bh+A== 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=ry+lH+q2CKB3icnC2UhPPCgHiJdAH5Aemfdya66D0l8=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=NYkkcIAQJntwZPnCJUu8ad01I9mqX0M9INU9PoZ8BQeXd7y5g+1ccY601lfFiVJEgv RAmdi26vadsaXAwegajj29FuuHkNROC7k8QTSAOTNG8z2HiAU6s2h70TR3jlRr9gELJt r2Zc5rug8ftaQl8wxZZ5d/OrmD5zT1XZ8BmpuMs4N/o1oF987AWhtGnlyJM8C22ghqMs pHqOUSS8mm1dgH2v373k1EDzVyTmpEFcYCrcIrfzeWbFLv0F70o8f1vvNKNkau2NSZxL gwdi4CAcfrsjFXRR7FJsU1CtuMs9Ra85Oheifd44vTzycubqAHlPvQz3U2ss0mQuqwyF EEZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id x185-20020a6386c2000000b00578fc70f905si15694943pgd.315.2023.09.28.00.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:28:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 12E6483F38D1; Thu, 28 Sep 2023 00:08:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231280AbjI1HIA (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231207AbjI1HHU (ORCPT ); Thu, 28 Sep 2023 03:07:20 -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 6A303CC9 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-0002Qk-I2; 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-009WCE-58; 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 1qll78-005ZXp-SF; Thu, 28 Sep 2023 09:07:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/23] gpio: rcar: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:58 +0200 Message-Id: <20230928070706.2290137-16-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1766; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Ay9kWyB6abspraaPQ5cec6g7U9rHlg0IHUM7h+ij45M=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRvrf0OhUQXD+kVLyl4LB75U9bmlgMjc3CfM gEYoQsarw+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkbwAKCRCPgPtYfRL+ TtcuCACmxcTgTS5QxSUl6LmwQuKilenikaPH0tjk91UC92LPMnefPtj6QZHVSkgFWAn0T7TIlbn yEFebB+Oh4SaCl8IzTBpygfErIhP1qhcALpnizTkdWCHR6xtd7kRfKmOnw6xY2MGyfVsOetVKhy PScnOKw7XMxPvI0a6XbijcOLNXc/RCHhsu9g9fzovoHx9kbYnZy+9AmzCxcrsoL2KpNUuZx3PYK 1wGsUpwakGWzalqfFX3vnJQsqrfFWe+KK6ZejTLt3aoEUFhR34EFlNqXm7A+870a2+rKi317wJH 2aHvhlt4WLbywx0wpoPsxmhaHRqgTTU2eylbBj9SkAHfS7Ga 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 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 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:08:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265483199793342 X-GMAIL-MSGID: 1778265483199793342 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-rcar.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 86e69cde04da..d8b1baae6357 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -583,14 +583,13 @@ static int gpio_rcar_probe(struct platform_device *pdev) return ret; } -static int gpio_rcar_remove(struct platform_device *pdev) +static void gpio_rcar_remove(struct platform_device *pdev) { struct gpio_rcar_priv *p = platform_get_drvdata(pdev); gpiochip_remove(&p->gpio_chip); pm_runtime_disable(&pdev->dev); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -658,7 +657,7 @@ static SIMPLE_DEV_PM_OPS(gpio_rcar_pm_ops, gpio_rcar_suspend, gpio_rcar_resume); static struct platform_driver gpio_rcar_device_driver = { .probe = gpio_rcar_probe, - .remove = gpio_rcar_remove, + .remove_new = gpio_rcar_remove, .driver = { .name = "gpio_rcar", .pm = &gpio_rcar_pm_ops, From patchwork Thu Sep 28 07:06:59 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: 145820 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3129946vqu; Thu, 28 Sep 2023 00:22:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHq8rGuprCGXOZkfbuKfAAZcT9/PxfgBBYsIG+IUpotcgm4N7CiQo0r6L9eOehalb6eagtX X-Received: by 2002:a05:6a21:78a2:b0:15e:1486:1e08 with SMTP id bf34-20020a056a2178a200b0015e14861e08mr533343pzc.19.1695885742869; Thu, 28 Sep 2023 00:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885742; cv=none; d=google.com; s=arc-20160816; b=Z6YtDGLQNaB1cvlFmtFfYw3AVDXZLu01Jy+lJMdxfl38WLvUEfQ/Ss1wvfYCEHltpn g+mFCMhL/UsYEQ88GjBMGjuq+omTUpXX4Gx1ozxO/hA44BvFWQElu9RwexUYyx8dCjXj 1i3CXimqOYbd5Qdfeup9r8pfZM2PKOSNlkX1yskdGHFasiIdYb0OdSXlqIuhcw2yA6X9 v74WWRorLfhhxyj52pWJJP2euq4LxWymBtBFXlIm3BG6uV/ZXhzWU4HpBBhVs0WQ7AGj 7SxEX0raNgffhiiI0LA1RtnAtlpqZqFZ9oycJjC86ncCjluEcDW3SxeH+NQBiALgpNA2 MpZg== 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=+z6AZmnW9BlZg/rpJQ6bmeOsp9SjfTxhFoWc3kan6NA=; fh=KEurCoRRJzcYYpmeQv7zLfPusO2Q0ycKk31vJLXe7a4=; b=xbhYsfZ+WmfzHi9MeOwN2CrFMG0o2pJf7YwB33O5lX7hzIw//gi8XNl5T+cRRIQeCF pb5HdJ+U2SLCToXGg9hJe2TuQEaRbjQDqpvCvYpkAnS0A8FVT8VaELWD/ukDBDiE4qjp kdlwaV6PW68s7wJJXiGeWvGmkdt5J992X53cVAl+t6hxlgbWTSi+/n2nJP4GF/irzu15 Mv9fjDVVjU2rD0sEN3FgeDVlqFy8tHpuTcWlAovmOQo+vohWS1z9vSRw3MpklYFZbcVO PW6Y1EmWmWaPNqAmtFqFWxOQvJJSxWyUHRtdcPZk7/uecfx/XOa49yiOepMfKtundEiY b3Rg== 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 Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b2-20020a170902650200b001bc92dc57bbsi16297711plk.633.2023.09.28.00.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:22:22 -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 1660082C1221; Thu, 28 Sep 2023 00:08:40 -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 S231359AbjI1HI3 (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbjI1HHY (ORCPT ); Thu, 28 Sep 2023 03:07:24 -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 E4578121 for ; Thu, 28 Sep 2023 00:07:21 -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-0002Qw-Nj; 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-009WCJ-AP; 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-005ZXt-1D; Thu, 28 Sep 2023 09:07:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , Heiko Stuebner , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/23] gpio: rockchip: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:06:59 +0200 Message-Id: <20230928070706.2290137-17-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1845; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/JLr4SMPsCZBTD/SLWvssmlD+6BeWoxGgRK3cfWhYFs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRwp8TO2fD5SYns9E6Kt3lGHfikwBVk3nEgE c2ujARGr8eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkcAAKCRCPgPtYfRL+ ThCBB/9GGMGnIv3R0ikL7rxHVHWdlAQxJ093w/Cjj1PDwYrmn6YN8qn1j/kbyX/QoErQm676zv3 YFk4SoO+F6cD3xDM0LDXo/cAvspHBGOg1wIEOtTNjvLEYjST/UfVkFTR6w6tZWylGPOO+bh6/f6 Q64M8I0lBnwv/z+z6jdhSVZNFki+iVgXiuJijg2r02fR6Mz0KZTvqqQA175SKaas9uRdgBmvx1u Xyxx75rLm6avnZ2iZASmP44wpOSE/BWNO+qG/e17AzZ3CbjLxGxepXYxV1BIEBQHwh0ueMYdAAT OW34nOZ8ZkuzJS1WYJT3iDR9mEUvoi/KxwOZnQTCzvusgZ2k 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 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:40 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265088848286025 X-GMAIL-MSGID: 1778265088848286025 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 Reviewed-by: Heiko Stuebner --- drivers/gpio/gpio-rockchip.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c index b35b9604413f..23040a8cea34 100644 --- a/drivers/gpio/gpio-rockchip.c +++ b/drivers/gpio/gpio-rockchip.c @@ -778,14 +778,12 @@ static int rockchip_gpio_probe(struct platform_device *pdev) return 0; } -static int rockchip_gpio_remove(struct platform_device *pdev) +static void rockchip_gpio_remove(struct platform_device *pdev) { struct rockchip_pin_bank *bank = platform_get_drvdata(pdev); clk_disable_unprepare(bank->clk); gpiochip_remove(&bank->gpio_chip); - - return 0; } static const struct of_device_id rockchip_gpio_match[] = { @@ -796,7 +794,7 @@ static const struct of_device_id rockchip_gpio_match[] = { static struct platform_driver rockchip_gpio_driver = { .probe = rockchip_gpio_probe, - .remove = rockchip_gpio_remove, + .remove_new = rockchip_gpio_remove, .driver = { .name = "rockchip-gpio", .of_match_table = rockchip_gpio_match, From patchwork Thu Sep 28 07:07:00 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: 145818 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3129910vqu; Thu, 28 Sep 2023 00:22:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZC+ZIymfpf2+hZUg6OwD3NPHj+lWa6JszMUiC8G/G9eUhAfKFex9Prehxc+WmZwo7wSk/ X-Received: by 2002:a17:902:7441:b0:1c5:6199:ed95 with SMTP id e1-20020a170902744100b001c56199ed95mr408738plt.39.1695885739507; Thu, 28 Sep 2023 00:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885739; cv=none; d=google.com; s=arc-20160816; b=KIqMgcBfrA6/0zW5jH0kemi9OxmEDQyaXGgMyX2L9nvJEJittRLlFqdEYGf5rkNysy 9PE/eiCds5/AiCeMMkNVj2rY9sp4kB5GyoSq1zCScq45Q9tTWJLeUKFx80i12r4iKAbY Sblx+vFXyqK88pyDHiUD5ujgocWM6UG3t5fZpTEgADZrT6mT9zXUqwLjUdt30ALx+RGq fj97+50hVfawNL9Z1eULg1KDG9b+OImC0AgQapy9d6HrMOzV6RS3oF0IUoF9Z3TXxn/w 0Uksto2vz7CSPjQXX33sprk1lhrJkjnBHSgE7+arjOlM7Harp1jth6O0xOitMkwxbTdZ rBDg== 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 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 kv11-20020a17090328cb00b001c3cbccf116si16809958plb.403.2023.09.28.00.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:22:19 -0700 (PDT) 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 3C23F82AB465; Thu, 28 Sep 2023 00:08:29 -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 S230415AbjI1HIR (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:17 -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_Kleine-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 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 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:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265084976792267 X-GMAIL-MSGID: 1778265084976792267 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, From patchwork Thu Sep 28 07:07:01 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: 145804 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3125880vqu; Thu, 28 Sep 2023 00:12:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFKV7HedQ2T0KjHjJgQcIV74Vn8iJMIxWiGTlZf/J2/IVx0cO0gckSnKpg7acUGwDsltbjZ X-Received: by 2002:a9d:6a50:0:b0:6bc:b80c:bd53 with SMTP id h16-20020a9d6a50000000b006bcb80cbd53mr383939otn.38.1695885144454; Thu, 28 Sep 2023 00:12:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885144; cv=none; d=google.com; s=arc-20160816; b=zbvwMEzvjbXbmnswe+fC+exHJ6LOhZFQUB8ubc6D3HY7hGb7oi+pagJNu00g2y8On9 riOi+uEQ/X+o84XzZtZUngPP0vgQr0gvlaSP+mvm3KCSGq483ln3Rm9ejKb3AM8uQhF2 0fDGx2YSeWFUYu3MOoXk4I4+YC/xEzL9yI366kue0lxAx2DxIwEZl6uXgNtMoxIk+itX 2hOuOMuZPHs9uVm/186xruGSgwkqfEgs3KeQDduVuKo9aHTdnZMTQ3v/z09ueHc1fKyo 8Y91xV+c3vdBmflSjE7JENtGUfOrsMz3Fdww27IOyuQMWuvmn9BuHv4qkXbKeOOM2RF3 VEuA== 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=CDOhWRWtOtWTlVSdUu1k0171HXaS73StT4Nj5XpTGw0=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=TpcegfvBMhcUnsMzRhsl677Dnd1muMjrv0jnp7mjXRk53SfitKNBsvzaL6kGtar9tG sCcYYFsiJwBaIbU3X22ZKR++o7zpkzDKJsnKGpZHxg3eV3HhvhRJcoA+xSKYgaV+vd3e 1tjHO+P7T4v7vhhwv47GBd5ToEDUR1FmApYPI6YqM+G5iafDmk6uxG3Dbb04e59cG0hG nZUtqaRiEOun7/v9h3o7an3JW1WxJnPn4zAi0dyqXNSaYAsPYZHu1fOBRtWlpz1xHMyg S4M18jOMSeb6dzsEQ7tuZOKhvfjFq7sscxGA4tqNxdwy+d77kw/WwAvn22qT/uSVhgNM aI3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id eh9-20020a056a00808900b006901c3079c7si18129421pfb.268.2023.09.28.00.12.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:12:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id D0F658374690; Thu, 28 Sep 2023 00:08:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231502AbjI1HIL (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231260AbjI1HHW (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 13254CD0 for ; Thu, 28 Sep 2023 00:07:17 -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 1qll7A-0002RL-2r; Thu, 28 Sep 2023 09:07:12 +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-009WCR-ME; 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-005ZY1-D8; Thu, 28 Sep 2023 09:07:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/23] gpio: ts5500: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:07:01 +0200 Message-Id: <20230928070706.2290137-19-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1680; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iw7ZWGXZvP/QIT4+jRzjsvk/ZtvTr2U/nxvNwmbgPAU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSRz6+CzebKd761NACqJZ1kdWEq/3NjORnf2n NtFLBz9iYaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkcwAKCRCPgPtYfRL+ Tj8wB/9ErREPyl2iDDwolD80XRrR8pe5lQokZ37nIrWxoN9GdkTAgHvqoeiFS+hcZTFta5cANBJ 87frTN1jWmuT7Q/0+rOr1HzPy23ruqXIgVIGKI/O0EvrsXh088uI5sdjd1OgySWhov0eqkQs4h0 OAj7kj8lilOZ24sdBra0cz0q1D9l6+xOxyIqSQY8t1xQu/+GfLi/BpJZc1bb3bVLfdEhnziQZ++ pLIOOtaI8eUzTg59mIiqNVx5TByiKhxon8MH7Qn4NL2CgOhNR85L864RXyK1LXCRdWRPbJC7lrd UPqJXN6zEzJ9DZAtR0MuYms8wXftJPJPF0VoR7JlSF6u5k7c 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=-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 groat.vger.email 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 (groat.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:08:39 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778264460982479180 X-GMAIL-MSGID: 1778264460982479180 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-ts5500.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-ts5500.c b/drivers/gpio/gpio-ts5500.c index 8e03614c7a24..90f8e9e9915e 100644 --- a/drivers/gpio/gpio-ts5500.c +++ b/drivers/gpio/gpio-ts5500.c @@ -412,13 +412,11 @@ static int ts5500_dio_probe(struct platform_device *pdev) return 0; } -static int ts5500_dio_remove(struct platform_device *pdev) +static void ts5500_dio_remove(struct platform_device *pdev) { struct ts5500_priv *priv = platform_get_drvdata(pdev); ts5500_disable_irq(priv); - - return 0; } static const struct platform_device_id ts5500_dio_ids[] = { @@ -435,7 +433,7 @@ static struct platform_driver ts5500_dio_driver = { .name = "ts5500-dio", }, .probe = ts5500_dio_probe, - .remove = ts5500_dio_remove, + .remove_new = ts5500_dio_remove, .id_table = ts5500_dio_ids, }; From patchwork Thu Sep 28 07:07:02 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: 145824 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3130728vqu; Thu, 28 Sep 2023 00:24:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5MlnR4701lXaoGlSiniK0sg6wly2d1+HRJX3C+s1RfBlrlU06IrzBfpdg3Va4iS0+Jfp8 X-Received: by 2002:a05:6358:4408:b0:133:b42:69ca with SMTP id z8-20020a056358440800b001330b4269camr464168rwc.18.1695885875894; Thu, 28 Sep 2023 00:24:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885875; cv=none; d=google.com; s=arc-20160816; b=BESZ3sN08uZrz9DW0aO0qzpjpO7RR12cQ9x+v/TkazlvtaV01dXkUFJVWj2riWXWlQ czpaDEY2w6A4dUzAphvdJIx0/RyFBL3Pv1eTHRiqDsi5BBdAKWrnHMAEReWGw5Bk9FUG QhfkpTQMWV6TRZhO60cSK+2mAnyLgCuZC7vePr4JYnJOuHep+FF3F2R8VDaUh5aKZcem 1kC7JhvGvuA6P+clrzZYZYUCLo9S29A6AqPE0WprzdNBnFZ2rWCru7V7J/KBf5YsT1xf kmBRRSwl3G56Q4WYs7ivJllUoib2uR4S1Y5hEotatqwNF3juS/gklqqigDGGIXMK8Uvn iUTA== 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=LlXuHK9kcLHcypqSUolXYKSCVk3V7UmX6TIjRtjpO2k=; fh=G3TjGsTNcU/RV59T8Fgp8tfEwrcIOw1YqmWL8q9wcKM=; b=z5dTs6/xZR25fsE/Yiu/ZBvYaDWxh07AUnoPEk8ckShi4ZllsNBzXh5ouZ8obox3JT HnC5z15/JYenUmLXSChlxmdqgSEB8hb/3Sq9ulpWuI7WC4l+QYm9qdOAUvFZz0NCucaG lsZSyIBosk1X5KL/xPz4tTL9RAYm/JUXKcq3xuOSHNkH81noUsfRsjcuqDMCyZaPgaca AHxqI9NXOunlE+MV3rzOnyNS/B7zBnI44wt0HkaRQFpyqgJ8e8hbXnuuxwqTHHyPezNA vRJ6WVLHHwgDkqsOLmpKuDf5sON1WKrF3LF/aEos3ekmYj2Z5pf1ld44MtS4s/rU++CU r/fQ== 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 u11-20020a6540cb000000b0055fc5e67d56si17359921pgp.7.2023.09.28.00.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:24:35 -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 3307D82976A1; Thu, 28 Sep 2023 00:10:04 -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 S231447AbjI1HIt (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231289AbjI1HH1 (ORCPT ); Thu, 28 Sep 2023 03:07:27 -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 5DE281B4 for ; Thu, 28 Sep 2023 00:07:23 -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 1qll7A-0002RU-9D; Thu, 28 Sep 2023 09:07:12 +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-009WCV-Rf; 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-005ZY5-IM; Thu, 28 Sep 2023 09:07:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , Kunihiko Hayashi , Masami Hiramatsu , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 19/23] gpio: uniphier: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:07:02 +0200 Message-Id: <20230928070706.2290137-20-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1800; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=bkApXA01tGfNfpgysiyQC1mURMZijlgXCXcOlH9/CzU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSR01UED8lLvKL6iw0a22cHMHwxZe73TV5XEy qPw1w8wUVGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkdAAKCRCPgPtYfRL+ TjaUB/oDdhtr2klL8tb2/jjDA3Phmu8XHMX0ezozOjCI3s+9jWvfkcwPhUwYfhKNwP2AIpgOpgl 9mryeO06YcomQz75MNGhiJiuRvwwZRysefF1qIWxxQagBKmsMqnlvRS71vfZvrqfko4NJeh3mJI jkSLhF+l4L/Nhdzqy5i1pv3aWi43CRXrwi5aS3d9F5EdagiEruSHHA73y0pM1HVjlNd9StccwII 77pCaJ2HmlwiZkrsAqjB2oaY9MiRNdApl+vLlB6PHX6YX5v7pV7RAHBekHtjAV8tqgXXbDOhuRW BzbehJClDmrpiRJQGK7BtJK6hwV2YB89aVMHgGV781FS9h6Q 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=-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: 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:10:04 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265228030299894 X-GMAIL-MSGID: 1778265228030299894 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-uniphier.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c index 9725b7aa18a7..1f440707f8f4 100644 --- a/drivers/gpio/gpio-uniphier.c +++ b/drivers/gpio/gpio-uniphier.c @@ -414,13 +414,11 @@ static int uniphier_gpio_probe(struct platform_device *pdev) return 0; } -static int uniphier_gpio_remove(struct platform_device *pdev) +static void uniphier_gpio_remove(struct platform_device *pdev) { struct uniphier_gpio_priv *priv = platform_get_drvdata(pdev); irq_domain_remove(priv->domain); - - return 0; } static int __maybe_unused uniphier_gpio_suspend(struct device *dev) @@ -482,7 +480,7 @@ MODULE_DEVICE_TABLE(of, uniphier_gpio_match); static struct platform_driver uniphier_gpio_driver = { .probe = uniphier_gpio_probe, - .remove = uniphier_gpio_remove, + .remove_new = uniphier_gpio_remove, .driver = { .name = "uniphier-gpio", .of_match_table = uniphier_gpio_match, From patchwork Thu Sep 28 07:07:03 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: 145815 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3129708vqu; Thu, 28 Sep 2023 00:21:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQiCHx0AM9ksKYEbNIFPURi+Y2xzqI0K0NGF1WGxQ4QBpkru+ZsDAdk+tU5JEI03UJ0MtA X-Received: by 2002:a05:620a:f81:b0:775:66c1:7f94 with SMTP id b1-20020a05620a0f8100b0077566c17f94mr336760qkn.39.1695885707604; Thu, 28 Sep 2023 00:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885707; cv=none; d=google.com; s=arc-20160816; b=VFmMJ1cSu2+e4kgEl484tIUgzQoxXL0bsEcbFDZegJcQ9sramJuHfVHdeGWvszuE1x P8pKU6pPDzyoAJOJ++hAGWzqTUrAsn5pJHoxTescekp6+2T7tD917nMvptgY1ac6kNaV uHHZJZ3GOiYQI2C/QWSbODnQg41a1KjW2tYG+2ExciF/+K8ZpTHa7UcUp/Eoa3p0FDNe okLKsb5C9FWXiatVVl0LXFGiz3HdIyXYHRdo2ZiDHM+9F4i8HjnjAHIRrq86oQ/8Y1RC GMPWOF6gdBRlpS2USXMKkHhkW2oBR0nq/kY22DGKo3mPucbBqOhEhoA6sJVK/UPWEfFJ eZQg== 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=u7a5TuQ45jjLduhmMZ8zhkVLPMFdStdBirlk42culC8=; fh=hE8RZEl4zRiTgA+bHwnTIKk09Ak+rg7v0J21GCLr1H4=; b=neMJJytWmIlrsPeLHhCGCRtNRo+ma5o6Zs/JBhLV0C8A7AfX+0wAaMtdUUZwkrkDc4 1IdU45+za4ra687NxJWZppCfn7zUwo5dQJLF1NmfSJo6v8aoyxNACk9cG6bYQtRL0dmF HRU7WdwXKEY/IpSYMoGzDxfFXWLB9FZXHrOZVNdYC9cMM8jX4UturDMozua+62Kvgmd/ HPR2NflWSPkzt7kUt/jRdyOC2F+giwRFH3YNjwebTQOhAxHZbbcfNdUW8c9qDJodr36T CjiIvdcXVu3lltGMInGwxUyi8mCO6SuAI5CWsJlhcl6uMQ3PAybCx1dwCqAGetmeTDSd Tj4A== 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 Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o2-20020a056a0015c200b0069344f0eda3si2778104pfu.5.2023.09.28.00.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:21:47 -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 079E2823CE83; Thu, 28 Sep 2023 00:08:23 -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 S231477AbjI1HIH (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:07 -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 S231262AbjI1HHW (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 293AACD2 for ; Thu, 28 Sep 2023 00:07:17 -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 1qll7A-0002Ri-Dh; Thu, 28 Sep 2023 09:07:12 +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 1qll7A-009WCZ-0Y; Thu, 28 Sep 2023 09:07:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qll79-005ZY9-Nn; Thu, 28 Sep 2023 09:07:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 20/23] gpio: xgene-sb: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:07:03 +0200 Message-Id: <20230928070706.2290137-21-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1834; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zztpnxsZEJDFZIm9qSZPjBEfzvjHiZRS9y3gnRLWgew=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSR1nubBXr+coH9eBOJNEo6aa+yPeQ4YMVMX0 ZDw574HLTiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkdQAKCRCPgPtYfRL+ TiI2B/oDOUHb6ePdR5VqbUCgMJZxnP2/lZT7ygDZ/Mk5rREx7XWdA4p48ExDku2v8O99ZhRT8LV ro1ex9HnLOUhOV1fnXUal5mJpd1cKZ1sSphE28nBtiGGb/kfc5ICJUS3uIb579J7LJFhMzIfn/h W+5xj1dW+8cwJc2ZFilC7jOaY+Eh5Rgs9JjwYm1Jp9SljkPqhYRpM6B2kBeLiTPdcVnillrR+Qy 3IiAa2cahJbwOPaS3OOOpQyUs5LXfr6CjnmYXFNVzZAipoiIfVO0ubzXeyfde+2CJhLO2Z4ocvI DK9B/ptJuv8oqaFwM2WaNOBS47iGDwy/97cr8oC9/d+0jXtr 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 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:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778265051466223813 X-GMAIL-MSGID: 1778265051466223813 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-xgene-sb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c index 453bf9338ac4..bd5befa807c3 100644 --- a/drivers/gpio/gpio-xgene-sb.c +++ b/drivers/gpio/gpio-xgene-sb.c @@ -295,15 +295,13 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev) return ret; } -static int xgene_gpio_sb_remove(struct platform_device *pdev) +static void xgene_gpio_sb_remove(struct platform_device *pdev) { struct xgene_gpio_sb *priv = platform_get_drvdata(pdev); acpi_gpiochip_free_interrupts(&priv->gc); irq_domain_remove(priv->irq_domain); - - return 0; } static const struct of_device_id xgene_gpio_sb_of_match[] = { @@ -327,7 +325,7 @@ static struct platform_driver xgene_gpio_sb_driver = { .acpi_match_table = ACPI_PTR(xgene_gpio_sb_acpi_match), }, .probe = xgene_gpio_sb_probe, - .remove = xgene_gpio_sb_remove, + .remove_new = xgene_gpio_sb_remove, }; module_platform_driver(xgene_gpio_sb_driver); From patchwork Thu Sep 28 07:07:04 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: 145802 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3125038vqu; Thu, 28 Sep 2023 00:10:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHti09jZHbdRzuzzlWyMV1FUZS6Qg+blkspzBnRYST1RFNH5PfVEBq76mOM1pEZJTJ9e4aU X-Received: by 2002:a17:902:ecc3:b0:1c7:36a7:e14a with SMTP id a3-20020a170902ecc300b001c736a7e14amr414811plh.27.1695885026354; Thu, 28 Sep 2023 00:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885026; cv=none; d=google.com; s=arc-20160816; b=ckGo8YhzNtpJ8A3yzfyLHk9LddfaS7N9F6dYbmm7BeAzRgf/skwf/A1KQXPkIcbFbG Y4FJ/D7WUVasFL/oOsDSnb7ENwpy4404yW/+mU7r3SXhwUrPd6txQO9SkHMg6rK41ZR3 BbAIAAFW4fg7ZDJkuDMmyvkQOTArlg2QjJpLHNdrs+ECUVNW1YJ5wEbTv7abkZg5Xc+p 3/yzZg+e0jMaIFSUtW//slMXyDFAezfyVfImHkZXTTq+GzwQbcIlvTuaPw3F7WUDDFLw w/+Ib6D1vp0zj/ZUIbN8g4k+Uxv33fE2dyIs2K6Zcl8OwwQzOM83I3OF+m9t4DDMODOn ppzw== 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=UWkNu4WoFtqyBIkLPGyaStKi6Cugcqtf3QpagjlKE0I=; fh=M2abgOI47fl+S+HNV3aTGpSTRfegxJAYTM3DKVrBiiM=; b=gsjjxIAOey+82MHT73OTVz9VdaEhKVwvoLjC/vkdL8vB+8XM08BF7g9yVzz375eCyu HTW74no91pDrGcnrNI02Rig4RflqKHIq6tZ9ljIWcT65ccPfo/SrIRViLmNBJxhT2Y6Y Ab1Kbbq4+V7dcjxqaQhRaFw1ZQ1v6lE1HYcXtpf27F6E9/PssOY5CL1tqo4yQgvhwv1g wXhcAPm1TS83Y1BwIvFV6yISY2RzNR5BF2ThQOmr0gATgpujuxgM91WbMjCWw7mi5jGB EBPBVQktsUS7bMIoE2jssKfF/I15erbzgu/ayTELCc8jmSVBD1dbTluwgyYy3Cdbw9hy qCuQ== 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:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id f12-20020a170902ce8c00b001bdd35033efsi8093082plg.374.2023.09.28.00.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:10:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 2640B81C98DE; Thu, 28 Sep 2023 00:09:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231435AbjI1HIi (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231286AbjI1HHZ (ORCPT ); Thu, 28 Sep 2023 03:07:25 -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 8A1F6F9 for ; Thu, 28 Sep 2023 00:07:18 -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 1qll7A-0002S1-OQ; Thu, 28 Sep 2023 09:07:12 +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 1qll7A-009WCd-At; Thu, 28 Sep 2023 09:07:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qll7A-005ZYE-1T; Thu, 28 Sep 2023 09:07:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Andy Shevchenko , Ray Jui , Scott Branden , Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 21/23] gpio: xgs-iproc: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:07:04 +0200 Message-Id: <20230928070706.2290137-22-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1894; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=sxVA/y9La9BszqNJ1kefMBOoUDJPzAiVmTfSV9IJ0JA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSR2BwmVtukbBUIT0Q7riLSWhpIQXFAcUL8Xe /erPkcOP9KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkdgAKCRCPgPtYfRL+ TrgRCACAq8rdQ3J84HD06lj45/F9HM5kh4c/f6N4opMI4Vpuz8SLDowUZjgND18d/Owi2psX+v6 RRTZCyYYfa02VY+OE6dBs+GaZAznYofBLpgDVsbveIs5pZVL40sOKw0XB7D2+L8rA4LXKe7JXab q/eBsGDxgTAzizqJCczMq6vBUVIvvvHlQrhYfQngnruhV/cvW+a3qZRfXQRqB2FdHCLL9WQ2RgL H7LFec0WxjIQXP2sk+D5w0ZyU6AQkCkawzfdLRwLBE+9Bmd+vOucGzzudh0e86mN3BI9G2iqdht hNDwK+sfO9aYhiNkmdG5qvdwVhVrTFVG/1WGKxkR6ZGeTbpZ 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=-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 pete.vger.email 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 (pete.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:09:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778264337743725446 X-GMAIL-MSGID: 1778264337743725446 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 Reviewed-by: Florian Fainelli --- drivers/gpio/gpio-xgs-iproc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-xgs-iproc.c b/drivers/gpio/gpio-xgs-iproc.c index 2d23b27d55af..d445eea03687 100644 --- a/drivers/gpio/gpio-xgs-iproc.c +++ b/drivers/gpio/gpio-xgs-iproc.c @@ -291,7 +291,7 @@ static int iproc_gpio_probe(struct platform_device *pdev) return 0; } -static int iproc_gpio_remove(struct platform_device *pdev) +static void iproc_gpio_remove(struct platform_device *pdev) { struct iproc_gpio_chip *chip = platform_get_drvdata(pdev); @@ -302,8 +302,6 @@ static int iproc_gpio_remove(struct platform_device *pdev) val &= ~IPROC_CCA_INT_F_GPIOINT; writel_relaxed(val, chip->intr + IPROC_CCA_INT_MASK); } - - return 0; } static const struct of_device_id bcm_iproc_gpio_of_match[] = { @@ -318,7 +316,7 @@ static struct platform_driver bcm_iproc_gpio_driver = { .of_match_table = bcm_iproc_gpio_of_match, }, .probe = iproc_gpio_probe, - .remove = iproc_gpio_remove, + .remove_new = iproc_gpio_remove, }; module_platform_driver(bcm_iproc_gpio_driver); From patchwork Thu Sep 28 07:07:05 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: 145829 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3137018vqu; Thu, 28 Sep 2023 00:41:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGN3QJC4vmTUzVlLqjYhYGp1z9ntWaTT0of+GuV5Akxu1I+523uR8iNraGHEoYhVhiEGzM1 X-Received: by 2002:a17:902:f804:b0:1c3:188c:a347 with SMTP id ix4-20020a170902f80400b001c3188ca347mr419160plb.54.1695886866800; Thu, 28 Sep 2023 00:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695886866; cv=none; d=google.com; s=arc-20160816; b=nvlv3PkSc5pY60+W9Bw2/ps5gHoAZ6vpNQ8fzzwv+Z5HH0IvJT6fpiDQk17foQeEwW Ev1B1ucxG3ZkZ0zAi48oLcTgLjFQ6CrF/8le/1ZuDm2tZfuFCLAhMOnsrqGL9bcVVPDo FEYHcIbCcnEqDo597FIbdi0Aa6ESaa1No5EzXDc+thtHkO4hdP6P02UIBM+/qTN4sDXr k102FIg1I/6Bt6uj+Hh8c3CNtQSLhQfylpykZAcm7haEM0b4ZyzN8Ch0VYdIBMFHwVyg 3xtN1OPWVWnamFbmmFJUl0CGBag+ErAjH3gBMqa7b2Bf6jIdgavjDhov0GwrDHcQZNAK gbPg== 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=5VxIUetHUTbIgVUPmY2ygeDI9lygqbMz2/Ljtw8chs4=; fh=cAyRiaK3IJ2bBHCE7Fx1qcCHVnZYAp+cWXd1BpuS6EM=; b=v2p9VQtV4MAusEtWeQIjoM/mcNhi3+c0YpObVSPqrsL7NUlpNmFhsFlaeyEnomlW/k b+7x/uI+Yhw72d86gQWABNkzt8D2Ui9KnKcIS5O6Ioz1gM8Qr4FDMwp3luzKpWJ+qSkw FEldLobID1OFn4rhgLeQGMzlgq7EgazAknywJq6UP1sjrx1N25RpMcWUiwbQq4Kws+OU RzGA4GhTSMUZ0M3BadVch77g2091JoPI58f84R2RwQBj3G28YqcSyDcz1p39Gzee5Nna oCznMiSQTasOGeZ75vy8m76oU/0DlEaey6yrJIkrX6xEr0prKGrH3iJUTKuA1l8lD+V0 FinQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id c4-20020a170903234400b001bb3406a5f7si885894plh.11.2023.09.28.00.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:41:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id C80288411D44; Thu, 28 Sep 2023 00:08:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231289AbjI1HIw (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231295AbjI1HH2 (ORCPT ); Thu, 28 Sep 2023 03:07:28 -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 E1B861B5 for ; Thu, 28 Sep 2023 00:07:23 -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 1qll7B-0002SH-4M; Thu, 28 Sep 2023 09:07:13 +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 1qll7A-009WCi-Mf; Thu, 28 Sep 2023 09:07:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qll7A-005ZYI-DN; Thu, 28 Sep 2023 09:07:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Shubhrajyoti Datta , Srinivas Neeli , Michal Simek , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 22/23] gpio: xilinx: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:07:05 +0200 Message-Id: <20230928070706.2290137-23-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1831; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OCUSDDDlpZowRKqn3i2KYETfeDiSoQ+fcaqhgCGW9E4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSR3juZR4QyyPw/qwux7zvp19nI7Skn/j7o6l tjat0CcGDyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkdwAKCRCPgPtYfRL+ TnvSCACTk10j0dDCUwbMK8QsXCHKp6qMtMBfB69H00zn5h7bKfGDtOapxGbJmv0Vn9Prjfu+7Ua a6nKdghGiNXaYoeXGsL9g/fJVk4oWOnhXJ50bd3Hy+vNaCYRn/5WhvoXcajvyxLEjlQONXcddF/ YrMo75AayD4Bi0GED4bj4At8pU0UYawkjPjF63IgENPmHrYXvmFIoPn+WmU7hPO1i6IMbtoWRix DSdLPtF59wHjXS+7j1o9vYadzthGsZ0Q2rqhcxz3+f59FaPAnM2mqv3HMEUtTKPPLOPZXP6eHOu lEi0VbqeosVGRbsPmWgGUwBVP04FqZCUGjQSzCqtcVesEBpt 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 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 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:08:59 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778266267133417742 X-GMAIL-MSGID: 1778266267133417742 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 Reviewed-by: Shubhrajyoti Datta --- drivers/gpio/gpio-xilinx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index a16945e8319e..823198368250 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c @@ -332,7 +332,7 @@ static int __maybe_unused xgpio_suspend(struct device *dev) * * Return: 0 always */ -static int xgpio_remove(struct platform_device *pdev) +static void xgpio_remove(struct platform_device *pdev) { struct xgpio_instance *gpio = platform_get_drvdata(pdev); @@ -340,8 +340,6 @@ static int xgpio_remove(struct platform_device *pdev) pm_runtime_put_noidle(&pdev->dev); pm_runtime_disable(&pdev->dev); clk_disable_unprepare(gpio->clk); - - return 0; } /** @@ -715,7 +713,7 @@ MODULE_DEVICE_TABLE(of, xgpio_of_match); static struct platform_driver xgpio_plat_driver = { .probe = xgpio_probe, - .remove = xgpio_remove, + .remove_new = xgpio_remove, .driver = { .name = "gpio-xilinx", .of_match_table = xgpio_of_match, From patchwork Thu Sep 28 07:07:06 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: 145806 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3126050vqu; Thu, 28 Sep 2023 00:12:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH99h1C1JYh7tjnxJrhhriG/BoceMQ+qt8qqNakXrUbFWG4ai9wHbmfQ38FT8kISB3hbbuW X-Received: by 2002:a05:6358:290b:b0:143:788c:2560 with SMTP id y11-20020a056358290b00b00143788c2560mr506911rwb.15.1695885169804; Thu, 28 Sep 2023 00:12:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695885169; cv=none; d=google.com; s=arc-20160816; b=W1NTYCbaO9zIc8dfQP5dfrahMYErlLxy2iCko5NE/+ITg6oGGdNXlKhEBQjnUVSkvh T+S3WFWoiL+E00b8EuVnp90ozbe49gT9qvBbuiBy7whTTZFd1uWMFlYzZ7s3OsIfweyI X0YJQG2WJI8YFKHPIM5lyo4Oyxhh9dy38MC85VDOpdyI4G488qrR6nTDQbkg60OZMRkH 9fWimkkElkUI3zwxUNfAeCESSkYT8eQcJsHleTsr8KtplmPxLAnST6TZOMJ9KWyjCrvN kGlJvliAz2w61K8Lp8hqCXJNRpgfS2M2HgmL+h9Ibr1R9hkutrHCMvt4gvn2GhM+FDyG zIjg== 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=ntrVaE/TgfvsYmix7TGfVdZbZ8Zap93TRJWEAN/os+k=; fh=cAyRiaK3IJ2bBHCE7Fx1qcCHVnZYAp+cWXd1BpuS6EM=; b=CTpjwBJJ1KHSfJ0Yc9XuGSn+n6qIlYPKYtggkn6CebvL9iyB767HhXpr0u5/FaPezv KLfymRQYOQISe08XqbI+qUNRtanl+lROAWlEt6LfT6bAHR41ehT8KbVnXW3w9denIK+R 2PlrM+q975gTC5qpYDPAY6u2Sbnn+1HhQxNn4u/lO45NXXvIv3BprGN91yfM/Vg6wOev NH44mefNEksvjyjogtuWlq6gw4T8543bz0SfcRLvl8jT3OcOe6i61hrxufihSpAdTdT+ 8mBrOJkzpWNuwy5AgkEAkzNjiB/wGRuQMeHirfmebMlUG3JsDe4p8Scd84sfViaQyhMP AkcQ== 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:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id cp24-20020a056a00349800b00690ca3d66bbsi17596382pfb.262.2023.09.28.00.12.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:12:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 062EA83746B7; Thu, 28 Sep 2023 00:09:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231322AbjI1HIo (ORCPT + 20 others); Thu, 28 Sep 2023 03:08:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231294AbjI1HH2 (ORCPT ); Thu, 28 Sep 2023 03:07:28 -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 758E41B8 for ; Thu, 28 Sep 2023 00:07:23 -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 1qll7B-0002SM-8i; Thu, 28 Sep 2023 09:07:13 +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 1qll7A-009WCl-Rv; Thu, 28 Sep 2023 09:07:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qll7A-005ZYM-Ih; Thu, 28 Sep 2023 09:07:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Bartosz Golaszewski Cc: Shubhrajyoti Datta , Srinivas Neeli , Michal Simek , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 23/23] gpio: zynq: Convert to platform remove callback returning void Date: Thu, 28 Sep 2023 09:07:06 +0200 Message-Id: <20230928070706.2290137-24-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1870; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=96k0kAmXLbqfVn+TrjpQXRYXe0bAG/EB7eGn8jOevJ4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFSR4vNTmHvbNJyAE3nH8cjTQVbb/2RGswimTr 0m+7AOa+0qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRUkeAAKCRCPgPtYfRL+ TvERB/9pENxPs7T+w2jw8MK2hBTIIJ5XfvoU/aqUYTUhDWsLBp/YIPkysQMnczpOCEMt7acRljX /BvcajQuvhsIDyPM82Ig7qC37kwr4cKk0E8BcEHGKYPrk4BnRVgoJpi8olM7A3eDE51tvDNsMOE VWVt2W1XHlXzkdQst3NXxkZ7XozMFh3OQFpAT3LeEFnkJQHGOrybr7vbCa5AEhq3wi7tZngpTQk MUjZNt1F0SVaB6APLwVf0RxI5yknWFEKOk9jZvDd0XAAiKqZUCBg3e94BZX7KPetDKmLhDgP3d8 pxbnrV3jLIEm18kFQbyDOUkvPx0MlXecw9ngkVkKkYPRaw6K 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=-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 groat.vger.email 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 (groat.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:09:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778264487824549705 X-GMAIL-MSGID: 1778264487824549705 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-zynq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 324e942c0650..466e23031afc 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -1010,7 +1010,7 @@ static int zynq_gpio_probe(struct platform_device *pdev) * * Return: 0 always */ -static int zynq_gpio_remove(struct platform_device *pdev) +static void zynq_gpio_remove(struct platform_device *pdev) { struct zynq_gpio *gpio = platform_get_drvdata(pdev); int ret; @@ -1022,7 +1022,6 @@ static int zynq_gpio_remove(struct platform_device *pdev) clk_disable_unprepare(gpio->clk); device_set_wakeup_capable(&pdev->dev, 0); pm_runtime_disable(&pdev->dev); - return 0; } static struct platform_driver zynq_gpio_driver = { @@ -1032,7 +1031,7 @@ static struct platform_driver zynq_gpio_driver = { .of_match_table = zynq_gpio_of_match, }, .probe = zynq_gpio_probe, - .remove = zynq_gpio_remove, + .remove_new = zynq_gpio_remove, }; module_platform_driver(zynq_gpio_driver);