From patchwork Mon Oct 9 08:38:37 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: 731214 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAA25E95A9A for ; Mon, 9 Oct 2023 09:22:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345695AbjJIJWn (ORCPT ); Mon, 9 Oct 2023 05:22:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345742AbjJIJWk (ORCPT ); Mon, 9 Oct 2023 05:22:40 -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 D822FA3 for ; Mon, 9 Oct 2023 02:22:38 -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 1qpmTD-0006sV-83; Mon, 09 Oct 2023 11:22:35 +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 1qpmTC-000NWN-5W; Mon, 09 Oct 2023 11:22:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTB-00C4op-Sc; Mon, 09 Oct 2023 11:22:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Maxime Coquelin , Alexandre Torgue , linux-gpio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/20] pinctrl: stmfx: Improve error message in .remove()'s error path Date: Mon, 9 Oct 2023 10:38:37 +0200 Message-Id: <20231009083856.222030-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1448; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oQvuwpLV6jEvG8nPX5IRlTZZ5eR2ugHk+8EMhpV4SKQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wAB8YUxAlLBbwC7CIKjUbWm11DxuAGLQFuF PnKvZq8Ol2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8AAAKCRCPgPtYfRL+ TjJjCAC4Tdc4fTfh4VtpKisfvbBZZ0D+fqAmRlGB0zNqfrv706XALbviXa7gthDeHwPd4lv8wKr Ite+awd5fMyaGbl9XHLZ5gAHQ3JEjV6lPNk8v0CuXjFzEW82fkKMEJSL1Z+1aUG3IFE70SUBZDf 2Od7RaLozqLEEOO+6oerRQDP9UycvcJGkfXOwZ5ZZYOExGr51w3ex6RuIsYMEbniwO7//3JHVdP ZQpEEZvabqVPS+mx/fuF07qQlbpItj0UzV6FspmOKyC1ZVkXk+KMLjbrCzGEcYD5CzrbaKN3daX Yvrtl6ebPOFQICKlYIpv7t5owBQhbumI9X3ZqpTeaTE879qF 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-gpio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The driver core has no handling for errors returned by the .remove() callback. The only action on error is a dev_warn() with generic error message that the returned value is returned. Replace it by a more specific and useful message. Then returning zero is the right thing to do, the only effect is to suppress the core's warning. This prepares the driver for the conversion to .remove_new(). Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/pinctrl-stmfx.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c index 0974bbf57b54..d7ab82432a52 100644 --- a/drivers/pinctrl/pinctrl-stmfx.c +++ b/drivers/pinctrl/pinctrl-stmfx.c @@ -737,11 +737,17 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev) static int stmfx_pinctrl_remove(struct platform_device *pdev) { struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent); + int ret; - return stmfx_function_disable(stmfx, - STMFX_FUNC_GPIO | - STMFX_FUNC_ALTGPIO_LOW | - STMFX_FUNC_ALTGPIO_HIGH); + ret = stmfx_function_disable(stmfx, + STMFX_FUNC_GPIO | + STMFX_FUNC_ALTGPIO_LOW | + STMFX_FUNC_ALTGPIO_HIGH); + if (ret) + dev_err(&pdev->dev, "Failed to disable pins (%pe)\n", + ERR_PTR(ret)); + + return 0; } #ifdef CONFIG_PM_SLEEP From patchwork Mon Oct 9 08:38:38 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: 731206 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 411FBE95A9E for ; Mon, 9 Oct 2023 09:23:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345998AbjJIJXK (ORCPT ); Mon, 9 Oct 2023 05:23:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345819AbjJIJW4 (ORCPT ); Mon, 9 Oct 2023 05:22:56 -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 71994CF for ; Mon, 9 Oct 2023 02:22:43 -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 1qpmTC-0006sX-Q7; Mon, 09 Oct 2023 11:22:34 +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 1qpmTC-000NWQ-Cy; Mon, 09 Oct 2023 11:22:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTC-00C4ot-3k; Mon, 09 Oct 2023 11:22:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Tony Lindgren , Haojian Zhuang , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/20] pinctrl: single: Drop if block with always false condition Date: Mon, 9 Oct 2023 10:38:38 +0200 Message-Id: <20231009083856.222030-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=844; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YKE8P7L9V9D6eghladkosJamRCKd+b5UoH3TDoc6yRM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wBrRbKaWaukJeLRndrn6pB3LKccfQJKwli0 16nUYkI9b6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8AQAKCRCPgPtYfRL+ TtW7B/44yeQT6igw9tEP+D9fYA4PIKhJQgpUdOWoUs5fL0toneQALi3dmosp2c8vp33KXbG5Qgy 32gKGzf+3CTTwDt4cl8xQcZ70/Ohz/PcYkTUd7Gme7xu1aGLLK6+pkvaM3M52rKR34eRxypSYuy Ggkb4fFk0wsixK9fBpS3NiGHaMdNNUayaaHIBZJq86t8k95H9pAAQQwMds9td8bpVGZGGQuib89 TQUfrhk0wiNBGU4To6RwoELEpyMcGS5Pfa3TTeFMKp772k/RPGsfnCAUXWrc69WdEsJo+uASphm tAHS1lcCvheZbsA4qNTYqdhYXVk9XyCBDHT/GhiyL/tEioH4 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-gpio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org pcs_remove() is only called after pcs_probe() completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so platform_get_drvdata() won't return NULL. Simplify by removing the if block with the always false condition. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/pinctrl-single.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 461a7c02d4a3..f6c02c8b934d 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1929,9 +1929,6 @@ static int pcs_remove(struct platform_device *pdev) { struct pcs_device *pcs = platform_get_drvdata(pdev); - if (!pcs) - return 0; - pcs_free_resources(pcs); return 0; From patchwork Mon Oct 9 08:38:39 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: 731213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CA7BE95A91 for ; Mon, 9 Oct 2023 09:22:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345697AbjJIJWo (ORCPT ); Mon, 9 Oct 2023 05:22:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345758AbjJIJWl (ORCPT ); Mon, 9 Oct 2023 05:22:41 -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 3A6E097 for ; Mon, 9 Oct 2023 02:22:40 -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 1qpmTD-0006sZ-By; Mon, 09 Oct 2023 11:22:35 +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 1qpmTC-000NWT-JS; Mon, 09 Oct 2023 11:22:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTC-00C4ox-AX; Mon, 09 Oct 2023 11:22:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Yangtao Li , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/20] pinctrl: ti: ti-iodelay: Drop if block with always false condition Date: Mon, 9 Oct 2023 10:38:39 +0200 Message-Id: <20231009083856.222030-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=917; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ADcuWWwkM5/gkoFp6FtBWjwsKB9USL1JlIZt0PCZ89o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wC2UY8AHx4VUIV+FUuHGT44H9qCxr8Sw/dU 8c6tnLh2GmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8AgAKCRCPgPtYfRL+ TurFB/4kLIvktU36dHpqh45SEy0RA6rK+k31xiIn3waWC0qcGft0HgOWYcEVNw2TagvASbL80vz 4E0xrh2Op0jCl7twlM2P1nZvBV+9w26vr9EaVmSsjmfFEp5Grbde0adN03TW7CRCatfAmZsHDEm USTx3+8PNV537PLm8qrQ8bDHlTSdvaRsHd4Wa5caZ7+m9Y7kJLkqKddC7XASpiqY0J2zqOtdNk2 Bzk6lQLrMgZluxPjOJHU6hDq/hE/hJrRkbM1m0YZxm2PxIZoNdoBv1mnJZTGojOBhGJS+MYUVq3 0G0piGTFwOmz0p8cvRXZqjXs579tszkrgkXAg/A20Uub/e2M 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-gpio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org ti_iodelay_remove() is only called after ti_iodelay_probe() completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so platform_get_drvdata() won't return NULL. Simplify by removing the if block with the always false condition. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c index c1477f657839..f3a273562095 100644 --- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c +++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c @@ -903,9 +903,6 @@ static int ti_iodelay_remove(struct platform_device *pdev) { struct ti_iodelay_device *iod = platform_get_drvdata(pdev); - if (!iod) - return 0; - if (iod->pctl) pinctrl_unregister(iod->pctl); From patchwork Mon Oct 9 08:38:40 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: 731211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC34CE95A9B for ; Mon, 9 Oct 2023 09:23:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345941AbjJIJXA (ORCPT ); Mon, 9 Oct 2023 05:23:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345800AbjJIJWs (ORCPT ); Mon, 9 Oct 2023 05:22:48 -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 C9860C6 for ; Mon, 9 Oct 2023 02:22:42 -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 1qpmTD-0006se-M8; Mon, 09 Oct 2023 11:22:35 +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 1qpmTC-000NWW-QH; Mon, 09 Oct 2023 11:22:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTC-00C4p1-HB; Mon, 09 Oct 2023 11:22:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Charles Keepax , Richard Fitzgerald , alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/20] pinctrl: cirrus: madera-core: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:40 +0200 Message-Id: <20231009083856.222030-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1757; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=26z5dwfBVv8uNLLkaBoXVqJ2/KKNhn+09EFI0ePmRQg=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTlPcyLrj76ufie/uJEWe5rEaxxUsbXZzfNSbtxO+Gg6 uwSm+M2nYzGLAyMXAyyYoos9o1rMq2q5CI71/67DDOIlQlkCgMXpwBMRFKe/X+hyM/6vsxPDw62 hMcmBvn6BOm82a06IVqFne2v4o0vCR+qM6dmZ/mvC00K3xc6QWnKrvbXRVaW9dK9j17p23wsuDP HbvGzpVmrIjIXSTYeyjvs+WZv1L3q3bpVjVlrTCPdbtq8eKkXf+Rp1LQvGnM6uJPPdTNfrLT1M0 sSm6D3iPF6rrmLwMtvdRNuWihMm+NYmPzUybBvVQAb3+LMk2ItuRWHb9zwMAqSNjcQf6he43MpM FLKRaDXLH22XIGMwOIovzdSfRZWzhNnq72sMOsK333QX6vpQUKZ4ZOJKpcMJs8pufn2yjrhHHE3 J5GMfoHbX8OiZj/RutK/Xa3o5hynl3ziendCZNtCNNcCAA== 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-gpio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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/pinctrl/cirrus/pinctrl-madera-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/cirrus/pinctrl-madera-core.c b/drivers/pinctrl/cirrus/pinctrl-madera-core.c index bb589922d8c5..898b197c3738 100644 --- a/drivers/pinctrl/cirrus/pinctrl-madera-core.c +++ b/drivers/pinctrl/cirrus/pinctrl-madera-core.c @@ -1084,19 +1084,17 @@ static int madera_pin_probe(struct platform_device *pdev) return 0; } -static int madera_pin_remove(struct platform_device *pdev) +static void madera_pin_remove(struct platform_device *pdev) { struct madera_pin_private *priv = platform_get_drvdata(pdev); if (priv->madera->pdata.gpio_configs) pinctrl_unregister_mappings(priv->madera->pdata.gpio_configs); - - return 0; } static struct platform_driver madera_pin_driver = { .probe = madera_pin_probe, - .remove = madera_pin_remove, + .remove_new = madera_pin_remove, .driver = { .name = "madera-pinctrl", }, From patchwork Mon Oct 9 08:38:41 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: 731212 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87BB4E95A97 for ; Mon, 9 Oct 2023 09:22:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345891AbjJIJW6 (ORCPT ); Mon, 9 Oct 2023 05:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345798AbjJIJWs (ORCPT ); Mon, 9 Oct 2023 05:22:48 -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 41D5697 for ; Mon, 9 Oct 2023 02:22:42 -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 1qpmTD-0006sf-Fw; Mon, 09 Oct 2023 11:22:35 +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 1qpmTD-000NWa-1L; Mon, 09 Oct 2023 11:22:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTC-00C4p5-Oh; Mon, 09 Oct 2023 11:22:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Mika Westerberg , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/20] pinctrl: intel: cherryview: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:41 +0200 Message-Id: <20231009083856.222030-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2108; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=S4F/Ao6mCu0ElcleKD+S+Fk5DRAS/72HcfKe390NuvY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wE53vDr7UBK47ldXgIYZev2MHpu1X7uKNaB LRlAJOCz5qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8BAAKCRCPgPtYfRL+ TrrlB/0cybM0pgGOwafLmSvV1Kuw38n2Xm2s8vDDjzm6cesAP4fVfeiXo7xwu1xOdRy45Xwr+G5 abP4ExhcNV8VZ1jdoZmBLZ5CIDHWJsRY2bJ6h3qKCEsZlp7ykzhAuxjqkyHR7INf++qDqNup8T+ h/pBWAIGXSlW+KZV1kxBC8Y0sLNrqc1omys7HzYK8a9KXu2TliWtA0oQ83JTOTVMemXygIke9B6 ZWFPGYI/CNF2Xis/9Z1xD1D4urmYWN/vvFapXov3kVisLWVrvOfbMm5qkOK4uJgaJ96Mqfiecbg zg2HkJf3RLXXXNK+DMLN5dvoHOtZ55iyU6wIy17EN5Iwy/n9 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-gpio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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/pinctrl/intel/pinctrl-cherryview.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index 81ee949b946d..1f923a895987 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c @@ -1728,7 +1728,7 @@ static int chv_pinctrl_probe(struct platform_device *pdev) return 0; } -static int chv_pinctrl_remove(struct platform_device *pdev) +static void chv_pinctrl_remove(struct platform_device *pdev) { struct intel_pinctrl *pctrl = platform_get_drvdata(pdev); const struct intel_community *community = &pctrl->communities[0]; @@ -1736,8 +1736,6 @@ static int chv_pinctrl_remove(struct platform_device *pdev) acpi_remove_address_space_handler(ACPI_HANDLE(&pdev->dev), community->acpi_space_id, chv_pinctrl_mmio_access_handler); - - return 0; } static int chv_pinctrl_suspend_noirq(struct device *dev) @@ -1835,7 +1833,7 @@ MODULE_DEVICE_TABLE(acpi, chv_pinctrl_acpi_match); static struct platform_driver chv_pinctrl_driver = { .probe = chv_pinctrl_probe, - .remove = chv_pinctrl_remove, + .remove_new = chv_pinctrl_remove, .driver = { .name = "cherryview-pinctrl", .pm = pm_sleep_ptr(&chv_pinctrl_pm_ops), From patchwork Mon Oct 9 08:38: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: 731215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5281EE95A96 for ; Mon, 9 Oct 2023 09:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345719AbjJIJWl (ORCPT ); Mon, 9 Oct 2023 05:22:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345715AbjJIJWj (ORCPT ); Mon, 9 Oct 2023 05:22:39 -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 180BCB6 for ; Mon, 9 Oct 2023 02:22:38 -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 1qpmTE-0006td-KC; Mon, 09 Oct 2023 11:22:36 +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 1qpmTE-000NWw-7o; Mon, 09 Oct 2023 11:22:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTD-00C4pP-Uy; Mon, 09 Oct 2023 11:22:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/20] pinctrl: as3722: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:46 +0200 Message-Id: <20231009083856.222030-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1797; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=MPWtYbMOQgZR7mlnb/mgL+Kp5Cn22AjikhRP10lPHcU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wKE74xmYD8QqeyqKDdAd0aRFg6ar601wE4U 3O0gprgCImJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8CgAKCRCPgPtYfRL+ TigkB/0ezfjZNnv82AK92u26hpU28QyX4rIKqnS5KQojWwblAi+52ppN5+EMlbRRrFGYY5wSBn4 TnVuCrRpr6YUxKBV7pz7p490x5ndIbSoG2wc3Y0AXYrp9XbqC4bqPLq4mQ+9jfG3MKEC25+WbyF /N4Q5VRsfG5fuV5jlzoXjNzTr97EzrLIVmpy8UTVLLBHJl9lz1SpLYObXzJPtPwtcrBAg5KLuWn hIb4IhnvbcAahYVYJOl+49L09sxhggWJFA1jqK1ZQCSJN46A4o0WbeL0RKpHJ2srBnCTvjJZuvO tM6KKRWDc4dB+lNZ28YbuKUFaS09UNJJsveOHajkwX6taoPs 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-gpio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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/pinctrl/pinctrl-as3722.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c index f0e5d87ac50b..84b47a6cc3a6 100644 --- a/drivers/pinctrl/pinctrl-as3722.c +++ b/drivers/pinctrl/pinctrl-as3722.c @@ -587,12 +587,11 @@ static int as3722_pinctrl_probe(struct platform_device *pdev) return ret; } -static int as3722_pinctrl_remove(struct platform_device *pdev) +static void as3722_pinctrl_remove(struct platform_device *pdev) { struct as3722_pctrl_info *as_pci = platform_get_drvdata(pdev); gpiochip_remove(&as_pci->gpio_chip); - return 0; } static const struct of_device_id as3722_pinctrl_of_match[] = { @@ -607,7 +606,7 @@ static struct platform_driver as3722_pinctrl_driver = { .of_match_table = as3722_pinctrl_of_match, }, .probe = as3722_pinctrl_probe, - .remove = as3722_pinctrl_remove, + .remove_new = as3722_pinctrl_remove, }; module_platform_driver(as3722_pinctrl_driver); From patchwork Mon Oct 9 08:38: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: 731210 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9333EE95A97 for ; Mon, 9 Oct 2023 09:23:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345958AbjJIJXB (ORCPT ); Mon, 9 Oct 2023 05:23:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345827AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -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 17117F0 for ; Mon, 9 Oct 2023 02:22:44 -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 1qpmTF-0006uH-DO; Mon, 09 Oct 2023 11:22:37 +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 1qpmTF-000NX9-0B; Mon, 09 Oct 2023 11:22:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTE-00C4pb-NE; Mon, 09 Oct 2023 11:22:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Maxime Coquelin , Alexandre Torgue , linux-gpio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/20] pinctrl: stmfx: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:49 +0200 Message-Id: <20231009083856.222030-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-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=PgpMnVQndSD56U26Qe9f+HDWSOr4u9++3LxM4ikfokI=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTlPXxTYpbahPY0vU5SKpNnd1LLWngypTvykl6VQwL3b 92rOS87GY1ZGBi5GGTFFFnsG9dkWlXJRXau/XcZZhArE8gUBi5OAZgI71T2/0mqOXml5U71y83+ 5QtO/ybMIN1Q/Kpu5roQhzqhieruz96ncFc1unAsXL7/9ZeuytoWT9YvaomGezbrXRT6GFx2SzK obD/Pu6MeE1gLZtddeOywgHm6cXzLnb7939X3c9SFmK8u+2y4dNI8rq9326eoLDs553hjocupl2 wOjZueGDy4rr01LSjIoFf1uYzRLcFplSeYInlNag5XeAULK37gnn7gtu+D8oBEo/sq3YdXXP5f8 CG9M6bqq17Km+wl3j36FV5nDjT/LuuyMnfaxP7qtt8jkRdy59P23uadXGjZ0GAv/KCq+j77Amfz tv5OgYNz1+fss0pU19aLbv3yod8ibzbHf16OQDVTkb0A 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-gpio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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/pinctrl/pinctrl-stmfx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c index d7ab82432a52..6313be370eb7 100644 --- a/drivers/pinctrl/pinctrl-stmfx.c +++ b/drivers/pinctrl/pinctrl-stmfx.c @@ -734,7 +734,7 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev) return 0; } -static int stmfx_pinctrl_remove(struct platform_device *pdev) +static void stmfx_pinctrl_remove(struct platform_device *pdev) { struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent); int ret; @@ -746,8 +746,6 @@ static int stmfx_pinctrl_remove(struct platform_device *pdev) if (ret) dev_err(&pdev->dev, "Failed to disable pins (%pe)\n", ERR_PTR(ret)); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -856,7 +854,7 @@ static struct platform_driver stmfx_pinctrl_driver = { .pm = &stmfx_pinctrl_dev_pm_ops, }, .probe = stmfx_pinctrl_probe, - .remove = stmfx_pinctrl_remove, + .remove_new = stmfx_pinctrl_remove, }; module_platform_driver(stmfx_pinctrl_driver); From patchwork Mon Oct 9 08:38: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: 731209 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B833DE95A91 for ; Mon, 9 Oct 2023 09:23:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345879AbjJIJXD (ORCPT ); Mon, 9 Oct 2023 05:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345671AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -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 BA223107 for ; Mon, 9 Oct 2023 02:22:45 -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 1qpmTG-0006v1-9I; Mon, 09 Oct 2023 11:22:38 +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 1qpmTF-000NXO-SC; Mon, 09 Oct 2023 11:22:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTF-00C4pr-J3; Mon, 09 Oct 2023 11:22:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/20] pinctrl: qcom: ssbi-gpio: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:53 +0200 Message-Id: <20231009083856.222030-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1791; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=28+bfS44N/MplXkQ7tL5fBHkxWSovei9m4bBOfdvZTk=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTlPUJPvnCdeSfEnPErd++MeYkb5cx7z6wPNfmsceZA8 sJ5TXWBnYzGLAyMXAyyYoos9o1rMq2q5CI71/67DDOIlQlkCgMXpwBMhDuNg2H6bZ/Lv1JijevK pfJzzhk94p528L3dxQ5T+TPMi0riq9kPCdm8LcwxKS1g6Wt3uWB3l9PFvz1i/7p53CLxmSxP5+3 weM2bNH3OMlOZSebbTTnWFU8P7Dn/cvnGdOEEAY98tkQ36YCXdiK9Lq+q1Ux+TH/kar6VLfKTQu TTJ5sn31bOuuUzz5O5VIfTuKGsT6e+IfrLxAQVcfMn5SnTNJ5IK6TU/T4xq0VbuKU6v3OmTG5r/ ox+u0V9Si+51QNK2Bp7w364uTMWvNJIrTKdcslrWv9DnVO7/HpPbih9zXb3seDPQv7PfQdO1bvM CZz8PUo+6NDvrT9zIpl/CfxdI/pUcd/Vzhz72T/M1i0FAA== 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-gpio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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/pinctrl/qcom/pinctrl-ssbi-gpio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c index e0d43d076c01..9cd5247ea574 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c @@ -853,13 +853,11 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev) return ret; } -static int pm8xxx_gpio_remove(struct platform_device *pdev) +static void pm8xxx_gpio_remove(struct platform_device *pdev) { struct pm8xxx_gpio *pctrl = platform_get_drvdata(pdev); gpiochip_remove(&pctrl->chip); - - return 0; } static struct platform_driver pm8xxx_gpio_driver = { @@ -868,7 +866,7 @@ static struct platform_driver pm8xxx_gpio_driver = { .of_match_table = pm8xxx_gpio_of_match, }, .probe = pm8xxx_gpio_probe, - .remove = pm8xxx_gpio_remove, + .remove_new = pm8xxx_gpio_remove, }; module_platform_driver(pm8xxx_gpio_driver); From patchwork Mon Oct 9 08:38: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: 731207 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C168E95A99 for ; Mon, 9 Oct 2023 09:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345921AbjJIJXI (ORCPT ); Mon, 9 Oct 2023 05:23:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345838AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -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 CF7B2FB for ; Mon, 9 Oct 2023 02:22:44 -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 1qpmTG-0006vI-I4; Mon, 09 Oct 2023 11:22:38 +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 1qpmTG-000NXS-4q; Mon, 09 Oct 2023 11:22:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTF-00C4pv-S1; Mon, 09 Oct 2023 11:22:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/20] pinctrl: qcom: ssbi-mpp: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:54 +0200 Message-Id: <20231009083856.222030-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-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=SsYV2sgsr7TRLETWckrWLWBbUnJpb3Z9p/eiCeOFjYo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wT3rSpr1DOqqnrcxvuvs6vVTLJ+V1OTMu3R BiQ9k2k4wGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8EwAKCRCPgPtYfRL+ TufRB/9rDhQgknJt/0gZukbSFaLF3GDSd6FbDP4NDJm/W5NtDI6yBh8sVvW+ipkChaYtBTlYuMJ CyRf5hTQyXEJlTUEY2sAvNHTakFfdiD8e9m349Rqec+HJN6Pmt5PAQFrJkwq/ki/+Aodp6pr9wG /sjglQ4RUhcpcbsxaAZs5HR9FG6twy1HJ53gx5cIipuOvnNjow1WVxoUIBMLHDN3jBC52VjvL+h 0sVOeA5d8EDbHJ+AdWHFSzR5Y0iLTX6gGTPstwJvjaZ4SKxyrcH2hxGKb33DeeQYFECAe2c5F0f H4Cvqij42TB0aicPrqkL2C3Gg2inW3TtF2K/vaR10wZ31rEO 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-gpio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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/pinctrl/qcom/pinctrl-ssbi-mpp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c index 985d1a0ee8f8..3aee6835a2de 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c @@ -936,13 +936,11 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev) return ret; } -static int pm8xxx_mpp_remove(struct platform_device *pdev) +static void pm8xxx_mpp_remove(struct platform_device *pdev) { struct pm8xxx_mpp *pctrl = platform_get_drvdata(pdev); gpiochip_remove(&pctrl->chip); - - return 0; } static struct platform_driver pm8xxx_mpp_driver = { @@ -951,7 +949,7 @@ static struct platform_driver pm8xxx_mpp_driver = { .of_match_table = pm8xxx_mpp_of_match, }, .probe = pm8xxx_mpp_probe, - .remove = pm8xxx_mpp_remove, + .remove_new = pm8xxx_mpp_remove, }; module_platform_driver(pm8xxx_mpp_driver); From patchwork Mon Oct 9 08:38: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: 731208 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D391E95A96 for ; Mon, 9 Oct 2023 09:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345878AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345799AbjJIJWs (ORCPT ); Mon, 9 Oct 2023 05:22:48 -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 7DB73BA for ; Mon, 9 Oct 2023 02:22:41 -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 1qpmTG-0006vN-Nr; Mon, 09 Oct 2023 11:22:38 +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 1qpmTG-000NXW-B7; Mon, 09 Oct 2023 11:22:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTG-00C4pz-21; Mon, 09 Oct 2023 11:22:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Geert Uytterhoeven , linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 19/20] pinctrl: renesas: rzn1: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:55 +0200 Message-Id: <20231009083856.222030-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1830; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=whu1K3F7uiPsNXc85/ItXxw8lSWdHF4ifU6FSRE1eb0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wVKp/h4ZmXafNql0+fn8GJ8n3xLvUqunKyn 9hjgl1/LeSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8FQAKCRCPgPtYfRL+ Tno+B/4x6SoP3sqUW0skGY4krgmujz6/rJAcDeQTwBv7ti5toHbjFhYFTeyZWzj7JoS+XzO+pru EtVB6g8xRdV8pO8+t8pgjnNzHsNl8yZazWPyuye9g5D4pmKhH+yPlMBQtX3bua5Mqznb4tcc7nK R9I449F3w0NToI7rCRiNt/eEs1One16x8nDJfjH68YDJA7OsXH5Vi4k9m6tYwQxkpwOl1sGMxdh S/va6B43w9zNhP8dfWM/7q7Rpy9P9FAUfhAo4DYnwm5eMSUdXaKbeRSkiJT+pGtSv5o9PyTZPSY ewklrqHyUZK9oPohr3mtuZFOdwBYbxwipnmeVxla9eKGD+PB 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-gpio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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 Acked-by: Linus Walleij --- drivers/pinctrl/renesas/pinctrl-rzn1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/renesas/pinctrl-rzn1.c b/drivers/pinctrl/renesas/pinctrl-rzn1.c index 374b9f281324..4b2f107824fe 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzn1.c +++ b/drivers/pinctrl/renesas/pinctrl-rzn1.c @@ -920,13 +920,11 @@ static int rzn1_pinctrl_probe(struct platform_device *pdev) return ret; } -static int rzn1_pinctrl_remove(struct platform_device *pdev) +static void rzn1_pinctrl_remove(struct platform_device *pdev) { struct rzn1_pinctrl *ipctl = platform_get_drvdata(pdev); clk_disable_unprepare(ipctl->clk); - - return 0; } static const struct of_device_id rzn1_pinctrl_match[] = { @@ -937,7 +935,7 @@ MODULE_DEVICE_TABLE(of, rzn1_pinctrl_match); static struct platform_driver rzn1_pinctrl_driver = { .probe = rzn1_pinctrl_probe, - .remove = rzn1_pinctrl_remove, + .remove_new = rzn1_pinctrl_remove, .driver = { .name = "rzn1-pinctrl", .of_match_table = rzn1_pinctrl_match,