From patchwork Fri Nov 10 15:29:29 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: 743344 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 EDAC0C4167B for ; Fri, 10 Nov 2023 17:44:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234746AbjKJRom (ORCPT ); Fri, 10 Nov 2023 12:44:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235160AbjKJRn6 (ORCPT ); Fri, 10 Nov 2023 12:43:58 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A7103A8AD for ; Fri, 10 Nov 2023 07:30:52 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TSz-00065S-Bj; Fri, 10 Nov 2023 16:30:41 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TSy-0083Ih-2G; Fri, 10 Nov 2023 16:30:40 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TSx-00Gnun-P1; Fri, 10 Nov 2023 16:30:39 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby , Tony Lindgren Cc: John Ogness , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Thomas Richard , Arnd Bergmann , Thomas Gleixner , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 01/52] serial: 8250: omap: Don't skip resource freeing if pm_runtime_resume_and_get() failed Date: Fri, 10 Nov 2023 16:29:29 +0100 Message-ID: <20231110152927.70601-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1318; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=jhxKH06aKU7oNg7h3QPQ9KuF9O89H8Ag15BPAaTV/K4=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQ/n0iTd1dLRA8dVb/RzW+1/C/bK4/8CeK1iw1cu2yDO p/qTkvoZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAiGms4GGYaqbRLvZ0z6YtL vVlu3fP1u/a8+jZZOfTGDovpQne/vHRNmiSsv8/RfMK7SOeaV7ujBXgL8iW3zVRNqU1hlZR9kVe 5afFaqT+FO/frv7ktHr3iZ0vh6/d5Dpo9/gUu3d+uaTYIsPb6cm5wvsulI2Hm3vC5JW+W69GX4Z 38Ezb3+xkXXq52WeUz8ZzSji3dD+8IGD53Z7FPNXxxrcLC/aOPw/uC+RmL2uonTNG8/EsipWeuV xEPb3nIvYmRSxl22a6uMGmYxL9iVfH/iUqX0wov9h8UqFyQKr2KTaXqp87pmfwWZgv2fMvstlzg bNHDO/cyZ9C7Sce5lVMEz+aln3G32XPpna2fhLH1p6bdAA== 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Returning an error code from .remove() makes the driver core emit the little helpful error message: remove callback returned a non-zero value. This will be ignored. and then remove the device anyhow. So all resources that were not freed are leaked in this case. Skipping serial8250_unregister_port() has the potential to keep enough of the UART around to trigger a use-after-free. So replace the error return (and with it the little helpful error message) by a more useful error message and continue to cleanup. Fixes: e3f0c638f428 ("serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove()") Signed-off-by: Uwe Kleine-König --- drivers/tty/serial/8250/8250_omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index 2d42f485c987..661a83dbc11b 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -1592,7 +1592,7 @@ static int omap8250_remove(struct platform_device *pdev) err = pm_runtime_resume_and_get(&pdev->dev); if (err) - return err; + dev_err(&pdev->dev, "Failed to resume hardware\n"); up = serial8250_get_port(priv->line); omap_8250_shutdown(&up->port); From patchwork Fri Nov 10 15:29:30 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: 743333 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 3F2CAC04A95 for ; Fri, 10 Nov 2023 18:07:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbjKJSHM (ORCPT ); Fri, 10 Nov 2023 13:07:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234983AbjKJSFY (ORCPT ); Fri, 10 Nov 2023 13:05:24 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57D833A8AA for ; Fri, 10 Nov 2023 07:30:50 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT0-00065v-Ai; Fri, 10 Nov 2023 16:30:42 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TSy-0083Im-7w; Fri, 10 Nov 2023 16:30:40 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TSx-00Gnuq-Uv; Fri, 10 Nov 2023 16:30:39 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby , Alexander Shiyan Cc: Richard GENOUD , Christophe JAILLET , Yangtao Li , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 02/52] serial: sccnxp: Improve error message if regulator_disable() fails Date: Fri, 10 Nov 2023 16:29:30 +0100 Message-ID: <20231110152927.70601-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1140; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=kBg/MDlr2mx1OX55pin6DcW9PLUaM0+0RakV/R8miMU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkxaEBLfHNY+5POSOi7cywgDOncYCsmUv7Rft kqdNAtYYTiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MWgAKCRCPgPtYfRL+ TqIqB/0dhjU2coVu1IhF1huBtkAuwO5F9zMrySYwuoTPj0M3p8rv49TMmDeitt/nTK2wyqbMVN2 xA3Of+iWDZtTq7L6OKDeCJ+SszjK/CFrreCvtZQdTv7brLtxQ/0VOSWpbCWgQysZAwNx0VxarbK mIXv7w0ctDi8xHyH+HSf/RlCSq08JwmrzCUQaRv2GQgZC1vdnh0xvGwUnFjxRpnm0BU97iiOGcx JHJmnUimTLIWiGuJyb9LLAYzteJr+9uCXIYHGZTdRX1G19Sv9ioUycsnQR41GXQFKKwFhVr2cm2 CD/9K/yJn2beUp+tJkVYRHTISwFf4p2/OXmyDQKQq+3Tvbny 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Returning an error code from .remove() makes the driver core emit the little helpful error message: remove callback returned a non-zero value. This will be ignored. and then remove the device anyhow. So replace the error return (and with it the little helpful error message) by a more useful error message. Fixes: 31815c08fc90 ("serial: sccnxp: Replace pdata.init/exit with regulator API") Signed-off-by: Uwe Kleine-König --- drivers/tty/serial/sccnxp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c index 2be2c1098025..8269b0fb3083 100644 --- a/drivers/tty/serial/sccnxp.c +++ b/drivers/tty/serial/sccnxp.c @@ -1036,8 +1036,11 @@ static int sccnxp_remove(struct platform_device *pdev) uart_unregister_driver(&s->uart); - if (!IS_ERR(s->regulator)) - return regulator_disable(s->regulator); + if (!IS_ERR(s->regulator)) { + int ret = regulator_disable(s->regulator); + if (ret) + dev_err(&pdev->dev, "Failed to disable regulator\n"); + } return 0; } From patchwork Fri Nov 10 15:29:32 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: 743328 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 018EEC05032 for ; Fri, 10 Nov 2023 18:17:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344978AbjKJSRW (ORCPT ); Fri, 10 Nov 2023 13:17:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345083AbjKJSP2 (ORCPT ); Fri, 10 Nov 2023 13:15:28 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C6ED3A8A3 for ; Fri, 10 Nov 2023 07:30:48 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT0-00066c-1o; Fri, 10 Nov 2023 16:30:42 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TSy-0083Is-NE; Fri, 10 Nov 2023 16:30:40 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TSy-00Gnuz-E7; Fri, 10 Nov 2023 16:30:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Tobias Klauser , linux-serial@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/52] serial: altera_jtaguart: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:32 +0100 Message-ID: <20231110152927.70601-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1971; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VJZPg4mx2iepXKT++BWY1RbdwAvgGhomdjPozeajAtU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkxcNk0G2oTKY4Mg5SgBwW/IubsoJmKTs1Op+ GuJnBW4J1+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MXAAKCRCPgPtYfRL+ ThPGB/wOzNYecm5LB2B4Li4HgeysGKRWyadCYYT7Z2iUNViw55OTWEDv/SEGQzuWo0unpks2lIY TZn3U8pTkkdBH5hldObgbVI0Tc+Ip7zQkhfknUnJgcLdecMs/Ct1e1zknBdP7ptkznPy1hHd+kY SiA+NudaYPAmj1MTgMyFbmGrt1d5HImqKvtQ143oDKC7p5htm+gbUagZDPYtBsrw+ghSuI14JSB MPhtaPxSLlADEfbkPgoaCu4NyrZotKd0vi+Ab+yj4CwN2dGFhW1GS3svA9eA3Z0yn/V2lUKcAXW Rzlz1tMJfn87pjJkOXXqTD71QzH+SU0YYMHAXIr5XO3MWeaY 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/altera_jtaguart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index 7090b251dd4d..effcba71ea77 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -425,7 +425,7 @@ static int altera_jtaguart_probe(struct platform_device *pdev) return 0; } -static int altera_jtaguart_remove(struct platform_device *pdev) +static void altera_jtaguart_remove(struct platform_device *pdev) { struct uart_port *port; int i = pdev->id; @@ -436,8 +436,6 @@ static int altera_jtaguart_remove(struct platform_device *pdev) port = &altera_jtaguart_ports[i]; uart_remove_one_port(&altera_jtaguart_driver, port); iounmap(port->membase); - - return 0; } #ifdef CONFIG_OF @@ -451,7 +449,7 @@ MODULE_DEVICE_TABLE(of, altera_jtaguart_match); static struct platform_driver altera_jtaguart_platform_driver = { .probe = altera_jtaguart_probe, - .remove = altera_jtaguart_remove, + .remove_new = altera_jtaguart_remove, .driver = { .name = DRV_NAME, .of_match_table = of_match_ptr(altera_jtaguart_match), From patchwork Fri Nov 10 15:29:34 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: 743343 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 0FF07C4332F for ; Fri, 10 Nov 2023 17:45:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345618AbjKJRpX (ORCPT ); Fri, 10 Nov 2023 12:45:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345963AbjKJRoJ (ORCPT ); Fri, 10 Nov 2023 12:44:09 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D3463AE26 for ; Fri, 10 Nov 2023 07:31:23 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT8-00066e-J9; Fri, 10 Nov 2023 16:30:50 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TSz-0083Iy-1k; Fri, 10 Nov 2023 16:30:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TSy-00Gnv6-Oq; Fri, 10 Nov 2023 16:30:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Russell King , Rob Herring , Thomas Gleixner , Lino Sanfilippo , Jiamei Xie , Hongyu Xie , delisun , Fabio Estevam , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 06/52] serial: amba-pl011: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:34 +0100 Message-ID: <20231110152927.70601-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1838; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=qIzmcIen7yGDlsOI2P9BNrRmie9HvCljuto2gnKfaaQ=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQ/n7gjr+bx8c1tDdvDuVuzY3LXkafJG22n7uq4c+HBz b7FAh/6OhmNWRgYuRhkxRRZ7BvXZFpVyUV2rv13GWYQKxPIFAYuTgGYyMR09r+STOelzio4z50X q5Ix93jKmSuhgeaezYGiUqrna1tnXjCOrlrI+LV/58OZmxz6SlUVlJebL1Zp2+rvl5qfL7l8k1I 4W4T2ycM6H+L5A4x+JQXIzexXvWp2ed76Cib3m0963H5bxa9xdnusLpGg/On/3jV5UqUFsp8L3N n5Yyt+dE/y+fLhZ6Z1k53sP8tOj/Oc//IcX67Vfi+7hk2c/WueD0tGg2EfqwavgpTS0nnsMiaPo hsKvRf/+cn5qahtS0aCrd3bcLfbqmbr4vd2br5RvTTVUvJFbdLK79mPK9XbVO38zjx5cMG8lFXY ffahrScX/nhw1pFF8MnSDZZ875ZHrtIQfC14bP6XkrRQAA== 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/amba-pl011.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 61cc24cd90e4..374b4254e39b 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2939,13 +2939,12 @@ static int sbsa_uart_probe(struct platform_device *pdev) return pl011_register_port(uap); } -static int sbsa_uart_remove(struct platform_device *pdev) +static void sbsa_uart_remove(struct platform_device *pdev) { struct uart_amba_port *uap = platform_get_drvdata(pdev); uart_remove_one_port(&amba_reg, &uap->port); pl011_unregister_port(uap); - return 0; } static const struct of_device_id sbsa_uart_of_match[] = { @@ -2963,7 +2962,7 @@ MODULE_DEVICE_TABLE(acpi, sbsa_uart_acpi_match); static struct platform_driver arm_sbsa_uart_platform_driver = { .probe = sbsa_uart_probe, - .remove = sbsa_uart_remove, + .remove_new = sbsa_uart_remove, .driver = { .name = "sbsa-uart", .pm = &pl011_dev_pm_ops, From patchwork Fri Nov 10 15:29:35 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: 743330 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 4E691C4167D for ; Fri, 10 Nov 2023 18:13:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345224AbjKJSNM (ORCPT ); Fri, 10 Nov 2023 13:13:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345851AbjKJSLa (ORCPT ); Fri, 10 Nov 2023 13:11:30 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71D413A8A2 for ; Fri, 10 Nov 2023 07:30:48 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT0-00066i-An; Fri, 10 Nov 2023 16:30:42 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TSz-0083J1-8c; Fri, 10 Nov 2023 16:30:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TSy-00GnvB-Vq; Fri, 10 Nov 2023 16:30:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: John Ogness , Yangtao Li , Thomas Gleixner , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 07/52] serial: ar933x: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:35 +0100 Message-ID: <20231110152927.70601-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1887; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=AS+2U08CvMoMeR1jTWo5UvWPRwWQXhe1jsvKSp6+81A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkxf+V2Ya432yrWcjyAbILSO/zI6Mm0fl280A UdFahfzuseJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MXwAKCRCPgPtYfRL+ TuC4CACT6zVa3d7sN5CvWWH0cA9wD3oindmMOgvP+ccAz8nYHBMv2NSGZLP+HuGcUG3dtAscojm 7Efjaudn7OpasfiZW5to4rI95I3cSqmXD+m5tzaXY+79ociRtq2kjD1KMPpUbqEYIRtvLMwmc7Q UXgguY1JuNzvCn89BgTfqQp7T/wJe/8IPTJLsMTDAU5m5MEzdU6+I/BrO1oeudsYODz0TSXqwJJ Y6ECnsLoHhRLshCm9XeQxnrDWRYsEFE6Nw25SfVp/R0GGBFLCHRqwYxNbgusmpPkZGWc9bQcwgg Kpsak+d+Nl3y2HmystEy6BUZX0BvkkCavo5KxxBsB0Rz9vbf 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/ar933x_uart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c index ffd234673177..8d09ace062e5 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c @@ -818,7 +818,7 @@ static int ar933x_uart_probe(struct platform_device *pdev) return ret; } -static int ar933x_uart_remove(struct platform_device *pdev) +static void ar933x_uart_remove(struct platform_device *pdev) { struct ar933x_uart_port *up; @@ -828,8 +828,6 @@ static int ar933x_uart_remove(struct platform_device *pdev) uart_remove_one_port(&ar933x_uart_driver, &up->port); clk_disable_unprepare(up->clk); } - - return 0; } #ifdef CONFIG_OF @@ -842,7 +840,7 @@ MODULE_DEVICE_TABLE(of, ar933x_uart_of_ids); static struct platform_driver ar933x_uart_platform_driver = { .probe = ar933x_uart_probe, - .remove = ar933x_uart_remove, + .remove_new = ar933x_uart_remove, .driver = { .name = DRIVER_NAME, .of_match_table = of_match_ptr(ar933x_uart_of_ids), From patchwork Fri Nov 10 15:29:36 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: 743327 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 14E94C4332F for ; Fri, 10 Nov 2023 18:18:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345537AbjKJSS1 (ORCPT ); Fri, 10 Nov 2023 13:18:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjKJSRR (ORCPT ); Fri, 10 Nov 2023 13:17:17 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADDBF3A8A0 for ; Fri, 10 Nov 2023 07:30:47 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT0-00066p-1W; Fri, 10 Nov 2023 16:30:42 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TSz-0083J5-GY; Fri, 10 Nov 2023 16:30:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TSz-00GnvK-7O; Fri, 10 Nov 2023 16:30:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Richard Genoud , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , kernel@pengutronix.de, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 08/52] serial: atmel: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:36 +0100 Message-ID: <20231110152927.70601-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2139; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=u0ZhdeTOBj+D3C418vMkM9Jw94t5Dl9Hy+aVn0jANZs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkxgMjgxStUfcgGlCx9LW1adPB6LE7z3p53BV C4k6JzJVoaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MYAAKCRCPgPtYfRL+ TsL9CACKYZ6USkyN1ixlUND/aJPmfvUMsU+CsCrLSGOp0on5sxXA11KtgWH/gbrFyf5+QlpDFV5 OgppDTcAUAx8ykx80pBkxUvSOmg7lhST7qXLYbd1Tb95g7tAUTO4nCyw8tYTj60+moHYFk30/VN kPWeBWhQTxs52Dhij5Z4H4of7LHii4hPhx67Z/iGUSOeKNbdn5Wn9zcIbMl0E9Wq6pv4AZpQZbx Q6XAGqNS/XFsVljF33q2id+Q4cV8lSl7Are2OmtSoWjRg7xblWbLkG6jKvlvnYPDrt6cHEGZPZj Ev52sD1I4aOa9B5ReW32ZCTawae6KmO+47HhwOFFr/k72nl4 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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: Richard Genoud --- drivers/tty/serial/atmel_serial.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 1946fafc3f3e..6792680690bd 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -3001,7 +3001,7 @@ static int atmel_serial_probe(struct platform_device *pdev) * protocol that needs bitbanging on IO lines, but use the regular serial * port in the normal case. */ -static int atmel_serial_remove(struct platform_device *pdev) +static void atmel_serial_remove(struct platform_device *pdev) { struct uart_port *port = platform_get_drvdata(pdev); struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); @@ -3020,8 +3020,6 @@ static int atmel_serial_remove(struct platform_device *pdev) clear_bit(port->line, atmel_ports_in_use); pdev->dev.of_node = NULL; - - return 0; } static SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend, @@ -3029,7 +3027,7 @@ static SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend, static struct platform_driver atmel_serial_driver = { .probe = atmel_serial_probe, - .remove = atmel_serial_remove, + .remove_new = atmel_serial_remove, .driver = { .name = "atmel_usart_serial", .of_match_table = of_match_ptr(atmel_serial_dt_ids), From patchwork Fri Nov 10 15:29: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: 743319 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 4149CC4167B for ; Fri, 10 Nov 2023 19:46:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235888AbjKJTqM (ORCPT ); Fri, 10 Nov 2023 14:46:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346664AbjKJTpy (ORCPT ); Fri, 10 Nov 2023 14:45:54 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E528D3A8A4 for ; Fri, 10 Nov 2023 07:30:48 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT0-000674-Kf; Fri, 10 Nov 2023 16:30:42 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TSz-0083J8-M3; Fri, 10 Nov 2023 16:30:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TSz-00GnvO-D0; Fri, 10 Nov 2023 16:30:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Thomas Gleixner , Florian Fainelli , John Ogness , Arend van Spriel , Yangtao Li , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 09/52] serial: bcm63xx: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:37 +0100 Message-ID: <20231110152927.70601-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1893; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cO15aM//X7ULU3bdbFLv2UCPcCGjR1XLDbWHcubCt18=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQ/n6Q9RxvreAXa3+QGFx3f5ufXnh+j6y1+WPfmLs55b 3odLq/uZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAilUns/4MY2TXfi2kZG0zM 2mp1mGffkjTLvXoqsWLHUv6baMkbbNWJ15vp/OyPr43OUck/O+7N1t9aNMuhbmqO7b68Ck5/y6m 3BWZsqSho0eC51FLJrmexSLjtX9ODtxZLZbj+lXfqpNhPaK4U9Ou7a6JTaffC2S3+YyZHfcGk5J Va5akn29Ws1jusf30mvKmmulvdaIbipqWxQq/Tfu/iuZSRt7Ra80XMlEUWH08LKgS+nzRdK/hVd NlXdQaH9QJmC77ZC7yfpbW/dOnRv4KfBHn9tjx8/74+R+WjZvUp5dkTxd0vrrb//Mduw/vWA1sD LbZs+KaefVxPxf7iQ56E9b6pO1tWhfNuZtDo+T8/8ukXAA== 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/bcm63xx_uart.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c index 4a08fd5ee61b..a3cefa153456 100644 --- a/drivers/tty/serial/bcm63xx_uart.c +++ b/drivers/tty/serial/bcm63xx_uart.c @@ -868,7 +868,7 @@ static int bcm_uart_probe(struct platform_device *pdev) return 0; } -static int bcm_uart_remove(struct platform_device *pdev) +static void bcm_uart_remove(struct platform_device *pdev) { struct uart_port *port; @@ -876,7 +876,6 @@ static int bcm_uart_remove(struct platform_device *pdev) uart_remove_one_port(&bcm_uart_driver, port); /* mark port as free */ ports[pdev->id].membase = NULL; - return 0; } static const struct of_device_id bcm63xx_of_match[] = { @@ -890,7 +889,7 @@ MODULE_DEVICE_TABLE(of, bcm63xx_of_match); */ static struct platform_driver bcm_uart_platform_driver = { .probe = bcm_uart_probe, - .remove = bcm_uart_remove, + .remove_new = bcm_uart_remove, .driver = { .name = "bcm63xx_uart", .of_match_table = bcm63xx_of_match, From patchwork Fri Nov 10 15:29: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: 743339 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 42174C4332F for ; Fri, 10 Nov 2023 17:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229568AbjKJRyA (ORCPT ); Fri, 10 Nov 2023 12:54:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbjKJRwu (ORCPT ); Fri, 10 Nov 2023 12:52:50 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1712B3A8A7 for ; Fri, 10 Nov 2023 07:30:50 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT0-000678-Iu; Fri, 10 Nov 2023 16:30:42 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TSz-0083JB-RP; Fri, 10 Nov 2023 16:30:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TSz-00GnvR-IF; Fri, 10 Nov 2023 16:30:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Alexander Shiyan , "Maciej W. Rozycki" , Yangtao Li , kernel@pengutronix.de, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/52] serial: clps711x: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:38 +0100 Message-ID: <20231110152927.70601-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1802; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zGO14akMC49w4hWUT2FVP0Zn7JKdFIeplvEQPynooZY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkxjnfc+m4POnHiYSF/BMoC+3SURS9VfYyQql AwsdGbvL9+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MYwAKCRCPgPtYfRL+ TjvGB/94QeQhTPLSU4/YEu6O18DGMPuEgHh6J514QoQdI4zA0dqcmIA5IKwVhRZFaIrrjWHwC25 w06aHlc05uZT7xXlyBZ3lwW1cBs6X2N9Rf+0OMJifzXyemsvXgKOm44jWK2ifWjQyGpqG0CJoCw GkNxe7IBOWBdv60CvC+U+i+gsvNB5fnB31fAt0Qp1aCDndITHlbERp/Bp/Uuyw/xAsfiY1H/GVR K0t0jNrePc7zb2mLtXaoLmy0use1ck5q5hDXWulMYCW3A2A9WuaZtcXU6zBcBg8kx9FyH4do6XA +opPckvU+uAfOTNxVZsMAoUdQzRbiWPH0B9NnyIyqPLVgRQt 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/clps711x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c index 55d19937efbd..7927725b8957 100644 --- a/drivers/tty/serial/clps711x.c +++ b/drivers/tty/serial/clps711x.c @@ -510,13 +510,11 @@ static int uart_clps711x_probe(struct platform_device *pdev) return ret; } -static int uart_clps711x_remove(struct platform_device *pdev) +static void uart_clps711x_remove(struct platform_device *pdev) { struct clps711x_port *s = platform_get_drvdata(pdev); uart_remove_one_port(&clps711x_uart, &s->port); - - return 0; } static const struct of_device_id __maybe_unused clps711x_uart_dt_ids[] = { @@ -531,7 +529,7 @@ static struct platform_driver clps711x_uart_platform = { .of_match_table = of_match_ptr(clps711x_uart_dt_ids), }, .probe = uart_clps711x_probe, - .remove = uart_clps711x_remove, + .remove_new = uart_clps711x_remove, }; static int __init uart_clps711x_init(void) From patchwork Fri Nov 10 15:29: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: 743048 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 2AA47C4332F for ; Fri, 10 Nov 2023 20:57:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235735AbjKJU5e (ORCPT ); Fri, 10 Nov 2023 15:57:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229787AbjKJU5V (ORCPT ); Fri, 10 Nov 2023 15:57:21 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E71FA3A897 for ; Fri, 10 Nov 2023 07:30:45 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT0-00068M-Ta; Fri, 10 Nov 2023 16:30:42 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT0-0083JQ-GY; Fri, 10 Nov 2023 16:30:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT0-00Gnve-7W; Fri, 10 Nov 2023 16:30:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Max Filippov , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 13/52] serial: esp32_acm: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:41 +0100 Message-ID: <20231110152927.70601-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1697; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0zkCG7vtEFfPJVH6axZyttIBTTJt/qfiQOul78Bc3qs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkxmkAqoy9cFczX9NB5uWXgcGVK3diZ8fgMn7 pq4k6Wb4xKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MZgAKCRCPgPtYfRL+ TrdTCACrlGxcmZqWht6IypULLXqdsA2/Vx4CCaBQRPg7ExcDH40A23fip4SUHVj7UsubT/2QUXd SHSj2KwZJ0CDWefSmz8OIsqXovGFDkr3Lmo311NkBc8+93cexx+n9Rvc4qIizeiek3u9lx2xPgk f1NxaVAdFD3+oc5U1KXAM8Joa36/jtM/d+YtB13g3AF2ngG2l97QRxTnRsYT25VlnDAdOgdM0W1 WSce302ZpGmkHehAPbM8ZA3UtnveoL1Qdu2XKA9mWX4WvIviv8IrOx1Aijzh6XtkI0SU+LUvqGo Xm5yXnM38RDCVW6VqcCrdsdrQp63d8lPKoGsLqoZnQWzW1Dq 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/esp32_acm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/esp32_acm.c b/drivers/tty/serial/esp32_acm.c index cb28a87736aa..a4cbaedb5170 100644 --- a/drivers/tty/serial/esp32_acm.c +++ b/drivers/tty/serial/esp32_acm.c @@ -413,18 +413,17 @@ static int esp32s3_acm_probe(struct platform_device *pdev) return uart_add_one_port(&esp32s3_acm_reg, port); } -static int esp32s3_acm_remove(struct platform_device *pdev) +static void esp32s3_acm_remove(struct platform_device *pdev) { struct uart_port *port = platform_get_drvdata(pdev); uart_remove_one_port(&esp32s3_acm_reg, port); - return 0; } static struct platform_driver esp32s3_acm_driver = { .probe = esp32s3_acm_probe, - .remove = esp32s3_acm_remove, + .remove_new = esp32s3_acm_remove, .driver = { .name = DRIVER_NAME, .of_match_table = esp32s3_acm_dt_ids, From patchwork Fri Nov 10 15:29: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: 743051 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 B9737C41535 for ; Fri, 10 Nov 2023 20:26:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344581AbjKJU03 (ORCPT ); Fri, 10 Nov 2023 15:26:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbjKJU01 (ORCPT ); Fri, 10 Nov 2023 15:26:27 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32B9D3A8A9 for ; Fri, 10 Nov 2023 07:30:50 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT2-0006B4-67; Fri, 10 Nov 2023 16:30:44 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT1-0083Je-39; Fri, 10 Nov 2023 16:30:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT0-00Gnvq-QL; Fri, 10 Nov 2023 16:30:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Sherry Sun , Shenwei Wang , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Thomas Gleixner , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 16/52] serial: fsl_lpuart: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:44 +0100 Message-ID: <20231110152927.70601-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1909; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cBrZsJaLt+Kv2NP3bg9HZqCIEBEZkMRd+Ohrt9BAuVM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkxqtNdBS1+l0HwWnYUFqOtYENLT80p9xY7GD gBl0RcNA1+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MagAKCRCPgPtYfRL+ Tg96CACgpeZ9hZtHp87jWhDF5a3n4E/8Kyl7vkvLV2HqUO5N3B71ss1jWQAAblFANA/bzA8xTkf OGA37HM8Orh7OayL/Fbqtsza4LiI8qiBt3GsdH+MaPZnEpYPQ/rbvVeVxSt4jcwUct/Lelwx3uB sC7W9gl7sIy7KgUpmd7pk/sNqtRqAx5/9v7pRQVWsDrz4CJpOpOBKVIUDJ5NfL/db4TDVaW0bf7 7GmiTOBh+LObn/TL8WQ/KXBMq32YI/dE7CuBJ5j7aYxnF4VVplHxBi8NTbKTw8qbCc/NzimgXdX h6uSivz254YnwR1PdXww1LViiuO/x6DOESVhq5mpBujCkZDS 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/fsl_lpuart.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 6d0cfb2e86b4..5ddf110aedbe 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -2959,7 +2959,7 @@ static int lpuart_probe(struct platform_device *pdev) return ret; } -static int lpuart_remove(struct platform_device *pdev) +static void lpuart_remove(struct platform_device *pdev) { struct lpuart_port *sport = platform_get_drvdata(pdev); @@ -2976,7 +2976,6 @@ static int lpuart_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); pm_runtime_dont_use_autosuspend(&pdev->dev); - return 0; } static int lpuart_runtime_suspend(struct device *dev) @@ -3210,7 +3209,7 @@ static const struct dev_pm_ops lpuart_pm_ops = { static struct platform_driver lpuart_driver = { .probe = lpuart_probe, - .remove = lpuart_remove, + .remove_new = lpuart_remove, .driver = { .name = "fsl-lpuart", .of_match_table = lpuart_dt_ids, From patchwork Fri Nov 10 15:29: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: 743318 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 91F78C4332F for ; Fri, 10 Nov 2023 20:31:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229519AbjKJUbb (ORCPT ); Fri, 10 Nov 2023 15:31:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjKJUb2 (ORCPT ); Fri, 10 Nov 2023 15:31:28 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EA1F3AE1F for ; Fri, 10 Nov 2023 07:31:01 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT3-0006Du-Ap; Fri, 10 Nov 2023 16:30:45 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT1-0083Jo-Hd; Fri, 10 Nov 2023 16:30:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT1-00Gnvy-8Z; Fri, 10 Nov 2023 16:30:43 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Bernhard Seibold , Rob Herring , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 18/52] serial: lantiq: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:46 +0100 Message-ID: <20231110152927.70601-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1707; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=CF5Oa6PoqYLuMNSgkYDnCcWEdAJvUfAPNJOaH562USI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkxsmHEt0nsNYR/NXFtaRRPgyHMpd1VtI2+Kd WnNlMR9taKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MbAAKCRCPgPtYfRL+ TgzIB/4ij4Bi4GeqVk0OYID6+hdxxvjVe/rS1MlXxz3dTo07Uz8rsbQeeBicTdalRynxBJiv/Fi SqTsmd4SbMewiLmCP6OYT/OPL43f9r163QLUaugwtUaTylE1XqooLdY3zuFVkDmJpbL4dxGV7Zs nA1Ok8hunWyKN7FcSQ19nnPxqeItWKEkcCZLvojiaGI/s3hLw2usB+HIrDtOqulJipI45fyM4t5 ylLr2AzmQbxtHLWo9er53GbLnxtsdgBORmTz+NLVwlMZFEoAKH6NzqsWrYCTza56ef6MCJ2xK/r 6HsSKzsPosPB0QLQw3zc95MtUsRFlwpLnSsqJPcf8vcJc/gO 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/lantiq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c index 3adb60c683f7..a0731773ce75 100644 --- a/drivers/tty/serial/lantiq.c +++ b/drivers/tty/serial/lantiq.c @@ -887,13 +887,11 @@ static int lqasc_probe(struct platform_device *pdev) return ret; } -static int lqasc_remove(struct platform_device *pdev) +static void lqasc_remove(struct platform_device *pdev) { struct uart_port *port = platform_get_drvdata(pdev); uart_remove_one_port(&lqasc_reg, port); - - return 0; } static const struct ltq_soc_data soc_data_lantiq = { @@ -917,7 +915,7 @@ MODULE_DEVICE_TABLE(of, ltq_asc_match); static struct platform_driver lqasc_driver = { .probe = lqasc_probe, - .remove = lqasc_remove, + .remove_new = lqasc_remove, .driver = { .name = DRVNAME, .of_match_table = ltq_asc_match, From patchwork Fri Nov 10 15:29: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: 743326 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 5FE8AC4167D for ; Fri, 10 Nov 2023 18:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344799AbjKJSVX (ORCPT ); Fri, 10 Nov 2023 13:21:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345837AbjKJSTb (ORCPT ); Fri, 10 Nov 2023 13:19:31 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A01D73A8AC for ; Fri, 10 Nov 2023 07:30:50 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT3-0006Et-19; Fri, 10 Nov 2023 16:30:45 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT1-0083Jr-Nn; Fri, 10 Nov 2023 16:30:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT1-00Gnw1-Ed; Fri, 10 Nov 2023 16:30:43 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Karol Gugala , Mateusz Holenko , Gabriel Somlo , Joel Stanley , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 19/52] serial: liteuart: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:47 +0100 Message-ID: <20231110152927.70601-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1840; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=AyGTON2PjykVAQ+BDKhAuTl+omyaBwfxB7p/IcyQquI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkxt7sAR1+q+Nx2S/KOviEpP0/7fj7hqVl2v0 cO6FLQJvYOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MbQAKCRCPgPtYfRL+ TuKLB/0djNE3RTenvgev8Y8LRSxgUs5jBB5X9tIxthXO4jK4hDVDz3H26OANQmyZ4eAuTwgSm5b oOzHt3wvASWLsHjF1p+IC9bbRLwsHSFIUkmt+8tuNFrk3FvzEJ9MybDvkBritG2tkDX0nYe7Tqf hVONMyhoV51+L9JUxXosgcU2COzmdMUKVzzdphe9WOy081CyKY4rw8y6iVqLrClu/L9+z8bBU1h cOvVJtV456PU5mqnHSm6Li0hwIA2YFi1TRbJdhJFNmnnxL9n6MQRj5N1wcdBxOuszkTtllH13R9 VyxzErkH5JlXVm7NgHfwnHsSXDIuCniHKF47tUeNagYAQrzK 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/liteuart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index a25ab1efe38f..3ce369f76349 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -336,15 +336,13 @@ static int liteuart_probe(struct platform_device *pdev) return ret; } -static int liteuart_remove(struct platform_device *pdev) +static void liteuart_remove(struct platform_device *pdev) { struct uart_port *port = platform_get_drvdata(pdev); unsigned int line = port->line; uart_remove_one_port(&liteuart_driver, port); xa_erase(&liteuart_array, line); - - return 0; } static const struct of_device_id liteuart_of_match[] = { @@ -355,7 +353,7 @@ MODULE_DEVICE_TABLE(of, liteuart_of_match); static struct platform_driver liteuart_platform_driver = { .probe = liteuart_probe, - .remove = liteuart_remove, + .remove_new = liteuart_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = liteuart_of_match, From patchwork Fri Nov 10 15:29: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: 743050 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 4E83DC4167B for ; Fri, 10 Nov 2023 20:31:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345296AbjKJUbx (ORCPT ); Fri, 10 Nov 2023 15:31:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345064AbjKJUbc (ORCPT ); Fri, 10 Nov 2023 15:31:32 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 708253A8AB for ; Fri, 10 Nov 2023 07:30:50 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT3-0006G7-CM; Fri, 10 Nov 2023 16:30:45 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT1-0083Ju-UG; Fri, 10 Nov 2023 16:30:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT1-00Gnw6-LH; Fri, 10 Nov 2023 16:30:43 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Vladimir Zapolskiy , Thomas Gleixner , John Ogness , kernel@pengutronix.de, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 20/52] serial: lpc32xx_hs: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:48 +0100 Message-ID: <20231110152927.70601-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1861; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=DVcQQb+CmJ21hxu1PtSgyIcrg3soROBUhSF8wYyvkOI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkxuHUt62+WjZkkOCz3dJvfYHjyd5V700VnXm YZ3G8CchyaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MbgAKCRCPgPtYfRL+ TqLSB/9FYiCtp2pOcz02o4zxja59N/vPJPe3n2K98J6uXdQi7OFr5r3XBfhvLGSLC1sEyRZLEPa rRTGsnniGj+fsyJ7ZFoHYaAz89T2tlmYmnO4O0F5G5VHUl+7WAygI1I+rK21c3Z/LcxDwkYTPwR S7tydzAgd4gpbBErXH6jjyx9LE8TPm5FLJwis4mSIAtF0+5a/b8MDxv5EQEWQ3VEzRiNMknbMmw YCwh9Z95Xe4CYKsnoylLiqQwWo0eXE8PL3iQIqsnsFdlNSylyYlRAQn+ove0F3JMTPURe7DlgbK LmsBk89lzTJV6rVkI2oUFbMwjZ60Pju+1D0h7APSRL/B5NmV 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/lpc32xx_hs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c index 5149a947b7fe..ec20329f0603 100644 --- a/drivers/tty/serial/lpc32xx_hs.c +++ b/drivers/tty/serial/lpc32xx_hs.c @@ -659,13 +659,11 @@ static int serial_hs_lpc32xx_probe(struct platform_device *pdev) /* * Remove serial ports registered against a platform device. */ -static int serial_hs_lpc32xx_remove(struct platform_device *pdev) +static void serial_hs_lpc32xx_remove(struct platform_device *pdev) { struct lpc32xx_hsuart_port *p = platform_get_drvdata(pdev); uart_remove_one_port(&lpc32xx_hs_reg, &p->port); - - return 0; } @@ -702,7 +700,7 @@ MODULE_DEVICE_TABLE(of, serial_hs_lpc32xx_dt_ids); static struct platform_driver serial_hs_lpc32xx_driver = { .probe = serial_hs_lpc32xx_probe, - .remove = serial_hs_lpc32xx_remove, + .remove_new = serial_hs_lpc32xx_remove, .suspend = serial_hs_lpc32xx_suspend, .resume = serial_hs_lpc32xx_resume, .driver = { From patchwork Fri Nov 10 15:29: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: 743320 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 E5D2EC4167D for ; Fri, 10 Nov 2023 19:34:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236093AbjKJTeQ (ORCPT ); Fri, 10 Nov 2023 14:34:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235882AbjKJTdt (ORCPT ); Fri, 10 Nov 2023 14:33:49 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA5803A8A1 for ; Fri, 10 Nov 2023 07:30:51 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT3-0006IC-R3; Fri, 10 Nov 2023 16:30:45 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT2-0083K2-DI; Fri, 10 Nov 2023 16:30:44 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT2-00GnwE-4E; Fri, 10 Nov 2023 16:30:44 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: "Maciej W. Rozycki" , Thierry Reding , Tobias Klauser , Thomas Gleixner , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 22/52] serial: mcf: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:50 +0100 Message-ID: <20231110152927.70601-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1761; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=W4XsmYFJxgg5UoSpd5wt0+1zbZT9b59ZQ4WpnAGkUao=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkxwrpnQWOST4y+GntTBg4/8PS/vtYvUYrtP8 haS4rjvUSuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5McAAKCRCPgPtYfRL+ TkXaCACRAJqMl4tLUT6BsAoU/IIZP8MYFw9Fx2NdvIuughJxa0kyGvPquGnlvxmzETYzQsbqHPE b9w3oJmKgQ9F8XbiPEYMYboNu7yahFbvTM/7hxb4ZxO0L+gGK0g5/bRIfrwilXbU7Fukm0PlQMx T7jfiS68XXmO0WynSI2/pcNQMlwXkL90kpnY/nmUvqh1ZZoEaQwHc/BxaHTDAbJoCcFm9r8+pry MinjDkWT2gTTUvFHHlIfBSBcNw/lA/00qaUDdsrYDSbMTHikZOeJ3U1xLb8dGuABUlXDqbH0Dgc XTC/x7unPrlNIpmYS3qK/XA1AiE408C2c5MWRK6vZMXR11vl 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/mcf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/mcf.c b/drivers/tty/serial/mcf.c index 91b15243f6c6..8690a45239e0 100644 --- a/drivers/tty/serial/mcf.c +++ b/drivers/tty/serial/mcf.c @@ -627,7 +627,7 @@ static int mcf_probe(struct platform_device *pdev) /****************************************************************************/ -static int mcf_remove(struct platform_device *pdev) +static void mcf_remove(struct platform_device *pdev) { struct uart_port *port; int i; @@ -637,15 +637,13 @@ static int mcf_remove(struct platform_device *pdev) if (port) uart_remove_one_port(&mcf_driver, port); } - - return 0; } /****************************************************************************/ static struct platform_driver mcf_platform_driver = { .probe = mcf_probe, - .remove = mcf_remove, + .remove_new = mcf_remove, .driver = { .name = "mcfuart", }, From patchwork Fri Nov 10 15:29: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: 743332 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 83172C04A95 for ; Fri, 10 Nov 2023 18:07:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234618AbjKJSHP (ORCPT ); Fri, 10 Nov 2023 13:07:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230427AbjKJSFf (ORCPT ); Fri, 10 Nov 2023 13:05:35 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58F773A8AF for ; Fri, 10 Nov 2023 07:30:52 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT3-0006Jp-Um; Fri, 10 Nov 2023 16:30:45 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT3-0083KC-0N; Fri, 10 Nov 2023 16:30:45 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT2-00GnwQ-NL; Fri, 10 Nov 2023 16:30:44 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Thomas Gleixner , Rob Herring , John Ogness , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 25/52] serial: mpc52xx: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:53 +0100 Message-ID: <20231110152927.70601-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1822; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=JFWHOoq/ho0+LQeUYKglharLAspxyHElpTvGDhUr+bI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkx0wDwxIF+DVTLJF7o/NhB0JsfkN5KRVbEF8 YabjMg1rQOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MdAAKCRCPgPtYfRL+ TpIdB/452MxS+j2Q4drYd36EWOSPh4MiKv6BNW3dbDQI4bne/spDTQfYtQpnZ//wQ4yS8o/PuqI vzKPz/VhuWWg2V+83oZbJakBuBKKKP1N3L6hO7HzHg7Nj9cPRoOHfvOdNT5SyeElb7G/6ASurBk w/opMQgUYebkx0IkARWSdxszsimCvpDhVjSQ6iFKkf/MlFHHgbwRYFJnB4bRhY3cfsHoCNe/0s8 7hQS7wxmzObxKpgpQMtfOL+gHfFu71zIYotdL9/Occkp7m4w29W4Q/9OxL13olZxwivgtqczU4R EdVS323yWQjJG09mtvk8qn70Boih6shDxbxl89R7GCzxFX+o 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/mpc52xx_uart.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c index a252465e745f..95dae5e27b28 100644 --- a/drivers/tty/serial/mpc52xx_uart.c +++ b/drivers/tty/serial/mpc52xx_uart.c @@ -1765,15 +1765,12 @@ static int mpc52xx_uart_of_probe(struct platform_device *op) return 0; } -static int -mpc52xx_uart_of_remove(struct platform_device *op) +static void mpc52xx_uart_of_remove(struct platform_device *op) { struct uart_port *port = platform_get_drvdata(op); if (port) uart_remove_one_port(&mpc52xx_uart_driver, port); - - return 0; } #ifdef CONFIG_PM @@ -1846,7 +1843,7 @@ MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match); static struct platform_driver mpc52xx_uart_of_driver = { .probe = mpc52xx_uart_of_probe, - .remove = mpc52xx_uart_of_remove, + .remove_new = mpc52xx_uart_of_remove, #ifdef CONFIG_PM .suspend = mpc52xx_uart_of_suspend, .resume = mpc52xx_uart_of_resume, From patchwork Fri Nov 10 15:29: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: 743340 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 F0E71C04A95 for ; Fri, 10 Nov 2023 17:53:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230225AbjKJRxa (ORCPT ); Fri, 10 Nov 2023 12:53:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbjKJRws (ORCPT ); Fri, 10 Nov 2023 12:52:48 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11FE23AE16 for ; Fri, 10 Nov 2023 07:31:00 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT4-0006Ki-Jl; Fri, 10 Nov 2023 16:30:46 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT3-0083KK-Dn; Fri, 10 Nov 2023 16:30:45 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT3-00GnwY-4V; Fri, 10 Nov 2023 16:30:45 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Herring , "Maciej W. Rozycki" , Tobias Klauser , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 27/52] serial: mxs-auart: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:55 +0100 Message-ID: <20231110152927.70601-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1756; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VfpMm7cTlHQjFHazZwl+9YZCmrz3p1Oofs9F/ccNpLc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkx26upryIfvTOAF2rKNwS7uWdwE3LIjoYvzq eGVN81ndzmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MdgAKCRCPgPtYfRL+ TmTkB/9z5mWAlz2uvDmYnpMb2J3eVVtr2bfF1dSnua99obNSNKec2mpLl/zbc3IjHXegGNE9HH6 QhrDxbYJVW+per+b43cXGsT8gSmHs1qzMkrLtShcA97liA5l76de4UrO2OZ+CCQR75IFnEBmhoo 7bxWqWfN+tTlUvz1+qeECXsNTLpcvqsuOTHBAnD/UKyUNBcP8vt6YiExH/KHWQFrDsO0EJVjWsJ Na3iAi8MwYAT1thlsvifcASm6yqgoO183GOWywpjpZ8LM2jfuXzeeYeCoiO5njab7BLLw+V8jT9 OI5bgzCa07yugmYwN5Pl4fqfhukut0yswdW5IUKs4BHI2cmO 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/mxs-auart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index 8eeecf8ad359..2be9546e0e15 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -1686,7 +1686,7 @@ static int mxs_auart_probe(struct platform_device *pdev) return ret; } -static int mxs_auart_remove(struct platform_device *pdev) +static void mxs_auart_remove(struct platform_device *pdev) { struct mxs_auart_port *s = platform_get_drvdata(pdev); @@ -1698,13 +1698,11 @@ static int mxs_auart_remove(struct platform_device *pdev) clk_disable_unprepare(s->clk); clk_disable_unprepare(s->clk_ahb); } - - return 0; } static struct platform_driver mxs_auart_driver = { .probe = mxs_auart_probe, - .remove = mxs_auart_remove, + .remove_new = mxs_auart_remove, .driver = { .name = "mxs-auart", .of_match_table = mxs_auart_dt_ids, From patchwork Fri Nov 10 15:29: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: 743049 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 63BC7C4167D for ; Fri, 10 Nov 2023 20:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235966AbjKJUhA (ORCPT ); Fri, 10 Nov 2023 15:37:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346075AbjKJUgo (ORCPT ); Fri, 10 Nov 2023 15:36:44 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E6B63AE0C for ; Fri, 10 Nov 2023 07:30:57 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT4-0006L8-SU; Fri, 10 Nov 2023 16:30:46 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT3-0083KP-K8; Fri, 10 Nov 2023 16:30:45 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT3-00Gnwc-B5; Fri, 10 Nov 2023 16:30:45 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Thierry Reding , Andy Shevchenko , Thomas Gleixner , Yangtao Li , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 28/52] serial: omap: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:56 +0100 Message-ID: <20231110152927.70601-29-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1934; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=S7IayNuDy+Bdm9n+oVx2ki9SDTzHf1WNibFrPz3lNOo=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQ/n4r4W6em/AkIYZeJfVmwWulNAMP/tGpV3aCsG+KFD 8tkll7qZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAiAUIcDIvfH3Oub5S6zpVh E6/0je2oJuc+08S1H7+zBVrOM5vmY7CVS+zicfnnrnYLijYedF+2sG7jZ5cf95fKqDpEvS+f/TN CMYxzw/u5tbyZzj9nJMjrX9u4bDZ7q6uOrNbmxMwnx2YUGD6baL9e5/niU707fjhP3rwvx5gltY /D8LPsurebLMyC+iuFJoT4CU73nBFQOW39vM6P/eu8Xhm4mBjLzLlfyt+70XqFwprKFQzTTZWYw i54hKwubNeJmR/ww4n9VWOxdpTgroYDN1mm3IjU4OOU0RVXKp+vxrfyeBifyVKzWJmLb6ZGO0qo 7D81J0til9WT56U7HjC+y8nanbIk3uO6ufK2tlaOJesNAQ== 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/omap-serial.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index ad4c1c5d0a7f..730755621879 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1658,7 +1658,7 @@ static int serial_omap_probe(struct platform_device *pdev) return ret; } -static int serial_omap_remove(struct platform_device *dev) +static void serial_omap_remove(struct platform_device *dev) { struct uart_omap_port *up = platform_get_drvdata(dev); @@ -1670,8 +1670,6 @@ static int serial_omap_remove(struct platform_device *dev) pm_runtime_disable(up->dev); cpu_latency_qos_remove_request(&up->pm_qos_request); device_init_wakeup(&dev->dev, false); - - return 0; } /* @@ -1808,7 +1806,7 @@ MODULE_DEVICE_TABLE(of, omap_serial_of_match); static struct platform_driver serial_omap_driver = { .probe = serial_omap_probe, - .remove = serial_omap_remove, + .remove_new = serial_omap_remove, .driver = { .name = OMAP_SERIAL_DRIVER_NAME, .pm = &serial_omap_dev_pm_ops, From patchwork Fri Nov 10 15:29: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: 743325 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 A4E76C05021 for ; Fri, 10 Nov 2023 18:27:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345516AbjKJS1L (ORCPT ); Fri, 10 Nov 2023 13:27:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345830AbjKJSZs (ORCPT ); Fri, 10 Nov 2023 13:25:48 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C976D3A8BB for ; Fri, 10 Nov 2023 07:30:55 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT5-0006Ld-1P; Fri, 10 Nov 2023 16:30:47 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT3-0083KS-Qt; Fri, 10 Nov 2023 16:30:45 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT3-00Gnwg-Hp; Fri, 10 Nov 2023 16:30:45 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Thomas Gleixner , John Ogness , kernel@pengutronix.de, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org Subject: [PATCH 29/52] serial: owl: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:57 +0100 Message-ID: <20231110152927.70601-30-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1736; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=eFPXirCWzRARpKBG0J51+QUrU1/Yw2oEpMHnSR6nLms=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkx6UsWr2gZiT/423mJebwNOZdnhYra5nK732 754KPMpuiSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MegAKCRCPgPtYfRL+ Tl8iB/9D49jmrcFeWRQDwG5bN7uocpjxbIBr8C1xtAE73fM8HgBWaW/6LKf83jknuK2XHoEHwWL QElGnp7UjlNnbJrbMGH9HKz+MjApdP15DhBrpkekBy4WWwdetJ7W+Hvj1eJWo2H36MRrnaqd1o6 abjek944RDK69sK1+h8JChL8OUvlApcdTtIqvwf1rkxtm9TpIg/GtbVF4IO4ufFXiU3XrflwRpD TiYkd391siBwhvjBSeGsNCNc9T50TW8bbDPoWuVbPNwWjTtNkXRNU8BAoMaTQp7a2bsfg9BGJEN SLJ2lu5bWgtzZE3FMFyTcAUIhprDEYTXS5QlCaqtr2Rg3rgA 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/owl-uart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/owl-uart.c b/drivers/tty/serial/owl-uart.c index 919f5e5aa0f1..d9fe85397741 100644 --- a/drivers/tty/serial/owl-uart.c +++ b/drivers/tty/serial/owl-uart.c @@ -725,20 +725,18 @@ static int owl_uart_probe(struct platform_device *pdev) return ret; } -static int owl_uart_remove(struct platform_device *pdev) +static void owl_uart_remove(struct platform_device *pdev) { struct owl_uart_port *owl_port = platform_get_drvdata(pdev); uart_remove_one_port(&owl_uart_driver, &owl_port->port); owl_uart_ports[pdev->id] = NULL; clk_disable_unprepare(owl_port->clk); - - return 0; } static struct platform_driver owl_uart_platform_driver = { .probe = owl_uart_probe, - .remove = owl_uart_remove, + .remove_new = owl_uart_remove, .driver = { .name = "owl-uart", .of_match_table = owl_uart_dt_matches, From patchwork Fri Nov 10 15:29: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: 743324 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 984EFC4167B for ; Fri, 10 Nov 2023 18:27:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345683AbjKJS1O (ORCPT ); Fri, 10 Nov 2023 13:27:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345758AbjKJSZr (ORCPT ); Fri, 10 Nov 2023 13:25:47 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8A173AE12 for ; Fri, 10 Nov 2023 07:30:58 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT5-0006NU-Fo; Fri, 10 Nov 2023 16:30:47 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT4-0083Ka-71; Fri, 10 Nov 2023 16:30:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT3-00Gnwo-U3; Fri, 10 Nov 2023 16:30:45 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 31/52] serial: qcom_geni: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:29:59 +0100 Message-ID: <20231110152927.70601-32-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2137; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=jSi3z2or1rdpGNyOiJdggwaRQkzjjaHHI+qrhcFS8qE=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQ/n/o/xgXSPPabC8Q2PtD8+jPCUyrTzc1iYuyUDi3xL ZXnFnzuZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAiaiwcDB21eRahC5vZfv/R MNTjOqW8p7RS75CRZHtMaEJhZ5hdidxplekqMbrMa3r+FjzVWO0vKsrSM2/Cx7Ou6S5WDvfeFW5 silo06U1Tzu87OzmcemT6ds7b8TlVqU8z/+6LTd8OGW3ee/7K5VAbzi+a1R2nfj/QNwtbYawu7q 02+cT3J6rLHjZ8D9mX3q8XIN1atepy6t75lpy72G6+W/DSKfBrheaCFfWzXggXHqm+eWy3h1O+g RgLK08U2/riCfnxeZLJ79/UxbRYBFd1/mH4fLTm7vzHgdZGTK5sC3TcDVdHW4T6PvN9r6wzv1t3 ifSSfre4ebyRAef4ueY0eYlV9DrWdbtvLaz0n3BOaT8A 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/qcom_geni_serial.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 7e78f97e8f43..e63a8fbe63bd 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1696,7 +1696,7 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) return 0; } -static int qcom_geni_serial_remove(struct platform_device *pdev) +static void qcom_geni_serial_remove(struct platform_device *pdev) { struct qcom_geni_serial_port *port = platform_get_drvdata(pdev); struct uart_driver *drv = port->private_data.drv; @@ -1704,8 +1704,6 @@ static int qcom_geni_serial_remove(struct platform_device *pdev) dev_pm_clear_wake_irq(&pdev->dev); device_init_wakeup(&pdev->dev, false); uart_remove_one_port(drv, &port->uport); - - return 0; } static int qcom_geni_serial_sys_suspend(struct device *dev) @@ -1805,7 +1803,7 @@ static const struct of_device_id qcom_geni_serial_match_table[] = { MODULE_DEVICE_TABLE(of, qcom_geni_serial_match_table); static struct platform_driver qcom_geni_serial_platform_driver = { - .remove = qcom_geni_serial_remove, + .remove_new = qcom_geni_serial_remove, .probe = qcom_geni_serial_probe, .driver = { .name = "qcom_geni_serial", From patchwork Fri Nov 10 15:30: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: 743329 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 AA8B5C05021 for ; Fri, 10 Nov 2023 18:17:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235659AbjKJSRT (ORCPT ); Fri, 10 Nov 2023 13:17:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346164AbjKJSQo (ORCPT ); Fri, 10 Nov 2023 13:16:44 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 927CD3AE14 for ; Fri, 10 Nov 2023 07:30:59 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT5-0006O6-Jn; Fri, 10 Nov 2023 16:30:47 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT4-0083Kf-DF; Fri, 10 Nov 2023 16:30:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT4-00Gnws-4N; Fri, 10 Nov 2023 16:30:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Manivannan Sadhasivam , linux-arm-kernel@lists.infradead.org, linux-unisoc@lists.infradead.org, kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 32/52] serial: rda: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:00 +0100 Message-ID: <20231110152927.70601-33-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1695; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=flPFXpMm9JS4xDTmMEuF+Ivri+U9FPWz7G99KM0If4c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkyBu+R47zw4bBpxNQZ6TuWw60LvlNF/x6AWe /7FT19Yv7+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MgQAKCRCPgPtYfRL+ Tk/0B/9OO/ppzJl1iCig1amhre/TqiGlU4v5ONOM+L9j30oz0nj67lyO+fJ/WGl0hqYoyHBsduP T2SDhT4okmSqQ3y3dP8fwL2Ze81SCv96HB9Hc1K/lhnSCKjJZOcjosGq+X3hcf/SbKhdOK69YzB n+tjEGo2hyaPUNKvl8yJqCTtBpCgzeSjzyf3d6Hz/kQkeQjpIktiIKjnO0Sutcjotz+m7Bq17cW nISOSfKV24ky7xVTNc92ssGNHRV04Qoc4DCa/RuJ/7FoCbrCIvHcb6ybfJ9jYyqOtvy5l/ru3Ys ZnifTTdXjNyvywTjx0/eAmkrUBvCY2goXm5+gfh59x+Lawiq 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/rda-uart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/rda-uart.c b/drivers/tty/serial/rda-uart.c index d824c8318f33..13deb355cf1b 100644 --- a/drivers/tty/serial/rda-uart.c +++ b/drivers/tty/serial/rda-uart.c @@ -780,19 +780,17 @@ static int rda_uart_probe(struct platform_device *pdev) return ret; } -static int rda_uart_remove(struct platform_device *pdev) +static void rda_uart_remove(struct platform_device *pdev) { struct rda_uart_port *rda_port = platform_get_drvdata(pdev); uart_remove_one_port(&rda_uart_driver, &rda_port->port); rda_uart_ports[pdev->id] = NULL; - - return 0; } static struct platform_driver rda_uart_platform_driver = { .probe = rda_uart_probe, - .remove = rda_uart_remove, + .remove_new = rda_uart_remove, .driver = { .name = "rda-uart", .of_match_table = rda_uart_dt_matches, From patchwork Fri Nov 10 15:30: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: 743335 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 3055FC04A95 for ; Fri, 10 Nov 2023 17:57:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230152AbjKJR4l (ORCPT ); Fri, 10 Nov 2023 12:56:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235550AbjKJRzx (ORCPT ); Fri, 10 Nov 2023 12:55:53 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 263243AE18 for ; Fri, 10 Nov 2023 07:31:00 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT6-0006Ow-FS; Fri, 10 Nov 2023 16:30:48 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT4-0083Ko-Pw; Fri, 10 Nov 2023 16:30:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT4-00Gnx4-Gy; Fri, 10 Nov 2023 16:30:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 34/52] serial: samsung: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:02 +0100 Message-ID: <20231110152927.70601-35-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1893; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=kaeCw/XWGh/rhDctG7bOvweVgq32oP1oEknoetRz908=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkyE0v2ifLXtpzyGQdhUDaOdpTbnDbApuz6j2 DwCA6OZbfaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MhAAKCRCPgPtYfRL+ TsviB/92l+BrGxD7LXpisKNsmU30AFLHo+S43n4iodbe7lthheC7MZSZLHD0dEDOdCp56RgtQsp CEQiRtNt5t22s3lx4u2rq/o8TgjmdbJ4GhoGB1Ye+szDBoXfpbrvwTwy6Pe41xnLvR+bxiuioCR 9gK1zkLFt1xieOdMNjib/u+FAFyn3sP+/ip9WtWCeJnRb7Gssqf4WQEg9c85RV6ZQxubLWKp0j5 fqaUO6NE6u5k+K8gnD15eOJMMOO/gV9qDl5gZxgwb1p/rFexxL8MCWiDhxYlJJBjNQNsGcaAzDB pjbgKNRerSRBjSyFZrxMn8KeMBetjW0NgvofQ2wh9vWRMc95 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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 Reviewed-by: Krzysztof Kozlowski --- drivers/tty/serial/samsung_tty.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 3bd552841cd2..1b0c2b467a30 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2054,7 +2054,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) return 0; } -static int s3c24xx_serial_remove(struct platform_device *dev) +static void s3c24xx_serial_remove(struct platform_device *dev) { struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); @@ -2063,8 +2063,6 @@ static int s3c24xx_serial_remove(struct platform_device *dev) } uart_unregister_driver(&s3c24xx_uart_drv); - - return 0; } /* UART power management code */ @@ -2611,7 +2609,7 @@ MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match); static struct platform_driver samsung_serial_driver = { .probe = s3c24xx_serial_probe, - .remove = s3c24xx_serial_remove, + .remove_new = s3c24xx_serial_remove, .id_table = s3c24xx_serial_driver_ids, .driver = { .name = "samsung-uart", From patchwork Fri Nov 10 15:30: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: 743338 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 4EE10C4332F for ; Fri, 10 Nov 2023 17:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230281AbjKJR4K (ORCPT ); Fri, 10 Nov 2023 12:56:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235418AbjKJRzo (ORCPT ); Fri, 10 Nov 2023 12:55:44 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F4123AE01 for ; Fri, 10 Nov 2023 07:30:56 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT6-0006PL-4l; Fri, 10 Nov 2023 16:30:48 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT4-0083Kr-Vd; Fri, 10 Nov 2023 16:30:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT4-00Gnx9-Ma; Fri, 10 Nov 2023 16:30:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: "Maciej W. Rozycki" , Yangtao Li , Thierry Reding , Christophe JAILLET , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 35/52] serial: sccnxp: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:03 +0100 Message-ID: <20231110152927.70601-36-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-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=Zwo0fde9Fmjq3fBI9vN+ath/c0eptfnAqi+hn+91mVM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkyFwJHa22wtQ/8r4RMPqYLDBh/rPmqOoZI2E kCtVYN9WdyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MhQAKCRCPgPtYfRL+ TsVPCACYy06KBoKyw0Q+Kf7AJkQ0cpewSUG13gkMZ9HSV5Sl/eS5uMK7qJFMF0vyUDGqMd3W2Ui rFlQ4Ym0eHE3o7ESZj9D7NOZGhdbcuh5Zvs3otgSI9D5btqtsd48it0p2pPGN8GOToa6BpxTVno A6lRevWe404bE187wYejp6LYppHg8DpX7eN6csS4RVC7DH16UbzC4D/jVmyRcGUcZt/JvWWM3pJ hnxWY8C/JGNk76pYmTL7IMGOiDyH85JguLkpaLqNUmZgoNJiQda11DGS6J6GZglujNMAfebMZky Pf6MKakeGx4bvt2OWb2Vkpkr7vCecZv39+QORgo9Rdvx5dXq 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/sccnxp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c index 8269b0fb3083..f24217a560d7 100644 --- a/drivers/tty/serial/sccnxp.c +++ b/drivers/tty/serial/sccnxp.c @@ -1021,7 +1021,7 @@ static int sccnxp_probe(struct platform_device *pdev) return ret; } -static int sccnxp_remove(struct platform_device *pdev) +static void sccnxp_remove(struct platform_device *pdev) { int i; struct sccnxp_port *s = platform_get_drvdata(pdev); @@ -1041,8 +1041,6 @@ static int sccnxp_remove(struct platform_device *pdev) if (ret) dev_err(&pdev->dev, "Failed to disable regulator\n"); } - - return 0; } static struct platform_driver sccnxp_uart_driver = { @@ -1050,7 +1048,7 @@ static struct platform_driver sccnxp_uart_driver = { .name = SCCNXP_NAME, }, .probe = sccnxp_probe, - .remove = sccnxp_remove, + .remove_new = sccnxp_remove, .id_table = sccnxp_id_table, }; module_platform_driver(sccnxp_uart_driver); From patchwork Fri Nov 10 15:30: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: 743052 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 0E97AC4167D for ; Fri, 10 Nov 2023 19:39:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235415AbjKJTjw (ORCPT ); Fri, 10 Nov 2023 14:39:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236235AbjKJTjk (ORCPT ); Fri, 10 Nov 2023 14:39:40 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE4DE3A8B8 for ; Fri, 10 Nov 2023 07:30:54 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT6-0006Pf-5V; Fri, 10 Nov 2023 16:30:48 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT5-0083Kx-5R; Fri, 10 Nov 2023 16:30:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT4-00GnxC-SS; Fri, 10 Nov 2023 16:30:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Laxman Dewangan , Thierry Reding , Jonathan Hunter , kernel@pengutronix.de, linux-serial@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 36/52] serial: tegra: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:04 +0100 Message-ID: <20231110152927.70601-37-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1825; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=G2ztO6ZS0L1mppkoBSatHWYdrZ3lJhBHyoZqK/ZNRzY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkyGLb33QkkT/HgQ0F6Yevq7L3StcfbfsEz9s /Xpqyt2m3aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MhgAKCRCPgPtYfRL+ Tlo2B/9tenq0eFH5I1CfvTlJAFSpeRaUXBJbga528JieDnIuiWIXvuf4pzDH5SEs6/IWm3atRnX XlxnNp01iHQDdQSKhBBGdHvGVZSkB/+hYPTR0uJ/mbS7mwPB4gzhT2ehCEJw85N8wReiZKLFQRJ Hsf4rLCwRrcU3JmZo5euHCevWpV32VhjQf8AKrjh8Q6UF1Ah4tPQXyBfcwQX8fG21Y09ydk/ZgW DHlb3IN4oqtOLiMcXZo3YfWuhvxSIsgRg4fHJYAhVtCUvcsBu+aZmfm9j3g3gqOpbXD2PRJKgG8 f5Ub9hDZ7nlk/bnD51yCLVkmHL9VIIagOuw+KOBuzt0p/261 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/serial-tegra.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c index 6d4006b41975..525f3a2f7bd4 100644 --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -1611,13 +1611,12 @@ static int tegra_uart_probe(struct platform_device *pdev) return ret; } -static int tegra_uart_remove(struct platform_device *pdev) +static void tegra_uart_remove(struct platform_device *pdev) { struct tegra_uart_port *tup = platform_get_drvdata(pdev); struct uart_port *u = &tup->uport; uart_remove_one_port(&tegra_uart_driver, u); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1644,7 +1643,7 @@ static const struct dev_pm_ops tegra_uart_pm_ops = { static struct platform_driver tegra_uart_platform_driver = { .probe = tegra_uart_probe, - .remove = tegra_uart_remove, + .remove_new = tegra_uart_remove, .driver = { .name = "serial-tegra", .of_match_table = tegra_uart_of_match, From patchwork Fri Nov 10 15:30: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: 743322 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 3F742C04A95 for ; Fri, 10 Nov 2023 18:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345498AbjKJSdv (ORCPT ); Fri, 10 Nov 2023 13:33:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345518AbjKJSc4 (ORCPT ); Fri, 10 Nov 2023 13:32:56 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF3113AE15 for ; Fri, 10 Nov 2023 07:30:59 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT6-0006Q5-DD; Fri, 10 Nov 2023 16:30:48 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT5-0083L0-E7; Fri, 10 Nov 2023 16:30:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT5-00GnxH-4w; Fri, 10 Nov 2023 16:30:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Thierry Reding , Tobias Klauser , Richard GENOUD , Thomas Gleixner , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 37/52] serial: txx9: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:05 +0100 Message-ID: <20231110152927.70601-38-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1888; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=79i3JRQQkLyJUMUcsqiIaRJXAT6ziqOMjwh1zWRC1Bw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkyH/z9AUSsLRwGXvLcQdyKx3SkQoo8Q9sDmS ARHmJcyb9KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MhwAKCRCPgPtYfRL+ TjJiB/9a9S8q/hNJCkKE3MxOJ9xnu6SXuRaie4H312fqlnVTOiVU7VYq1o/5SpEAb8CwBYX0CcJ EeDIb1zHlYz7QDDHpIb6GehtI4FzpgraiGlt+TjxKMP/OJ+79W8+GLEWmQjZCfNwZt83aLahpgi KSQKZzEjGUVaMOlbYPAuZ9HyH0OK1uKzmL28oWVLrzQ3G5ZXYNZMJNvOv9Y6LkdxajhG+gmtNM8 ZpV6dgDX0DDJftPbFCGnuyTyQLbfrRN1pkP1+WcDD84+SlxuQLH+1v6EU85kZl+8lNJ4siLUDHE wmsTk56miai5shB4d5cYIK/EWm+9nvYhgJ4WNS8Ywc8BbEib 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/serial_txx9.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c index eaa980722455..e1897894a4ef 100644 --- a/drivers/tty/serial/serial_txx9.c +++ b/drivers/tty/serial/serial_txx9.c @@ -1052,7 +1052,7 @@ static int serial_txx9_probe(struct platform_device *dev) /* * Remove serial ports registered against a platform device. */ -static int serial_txx9_remove(struct platform_device *dev) +static void serial_txx9_remove(struct platform_device *dev) { int i; @@ -1062,7 +1062,6 @@ static int serial_txx9_remove(struct platform_device *dev) if (up->dev == &dev->dev) serial_txx9_unregister_port(i); } - return 0; } #ifdef CONFIG_PM @@ -1097,7 +1096,7 @@ static int serial_txx9_resume(struct platform_device *dev) static struct platform_driver serial_txx9_plat_driver = { .probe = serial_txx9_probe, - .remove = serial_txx9_remove, + .remove_new = serial_txx9_remove, #ifdef CONFIG_PM .suspend = serial_txx9_suspend, .resume = serial_txx9_resume, From patchwork Fri Nov 10 15:30: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: 743341 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 B6C46C4332F for ; Fri, 10 Nov 2023 17:53:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230210AbjKJRx2 (ORCPT ); Fri, 10 Nov 2023 12:53:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbjKJRwp (ORCPT ); Fri, 10 Nov 2023 12:52:45 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B0BD3AE21 for ; Fri, 10 Nov 2023 07:31:02 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT6-0006QY-Nm; Fri, 10 Nov 2023 16:30:48 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT5-0083L4-Kk; Fri, 10 Nov 2023 16:30:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT5-00GnxL-Bh; Fri, 10 Nov 2023 16:30:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Biju Das , Geert Uytterhoeven , John Ogness , Rob Herring , Thomas Gleixner , Krzysztof Kozlowski , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 38/52] serial: sh-sci: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:06 +0100 Message-ID: <20231110152927.70601-39-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1958; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=P4CxsfLuAYcUUJTW3Uww1c2csld4J0Z5EKJII3L8zME=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQ/nw75+Pr+qJTe+DYPN83Azf4+Eieud/18+U5tl39VN nusYm8nozELAyMXg6yYIot945pMqyq5yM61/y7DDGJlApnCwMUpABNhaeVgaPb4E2VtFXHrguLK krYrKS81BM60Mbz//2rp3seRX274KdZVrMss8rB4piIl9PztV9H0f1cuKOznW3hJofQyo4HA/92 6MtJqG15fL+ZfKvHwrXdgZo8DO5OA7vTXXCbHj33kSeDNW1O8LeGG8qrcnYnHOhmV63c1qKyeYS sa8tXPmYGl6uZT9VIzKUH+xBmP9B4vrl7N2LH86SuV3X9V3924G835RzFEr8U15Ou/4v9/xD2Kr iZeEDB88Hvfyxx1Q2Oz5cf4PhZ53py0SVwq28a40czmi2ar7seigrd5PjPlstaX5DdcySiTerr2 1rr9U4+/02ZiyOVfLNsz4VDMgeYHc+r4Sm0PSN9iDxEBAA== 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/sh-sci.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 84ab434c94ba..745023001510 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3190,7 +3190,7 @@ static struct uart_driver sci_uart_driver = { .cons = SCI_CONSOLE, }; -static int sci_remove(struct platform_device *dev) +static void sci_remove(struct platform_device *dev) { struct sci_port *port = platform_get_drvdata(dev); unsigned int type = port->port.type; /* uart_remove_... clears it */ @@ -3204,8 +3204,6 @@ static int sci_remove(struct platform_device *dev) device_remove_file(&dev->dev, &dev_attr_rx_fifo_trigger); if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF) device_remove_file(&dev->dev, &dev_attr_rx_fifo_timeout); - - return 0; } @@ -3470,7 +3468,7 @@ static SIMPLE_DEV_PM_OPS(sci_dev_pm_ops, sci_suspend, sci_resume); static struct platform_driver sci_driver = { .probe = sci_probe, - .remove = sci_remove, + .remove_new = sci_remove, .driver = { .name = "sh-sci", .pm = &sci_dev_pm_ops, From patchwork Fri Nov 10 15:30:08 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: 743336 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 B9A3FC05031 for ; Fri, 10 Nov 2023 17:56:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229765AbjKJR4O (ORCPT ); Fri, 10 Nov 2023 12:56:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235436AbjKJRzp (ORCPT ); Fri, 10 Nov 2023 12:55:45 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20F3C3AE17 for ; Fri, 10 Nov 2023 07:31:00 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT7-0006R3-Sg; Fri, 10 Nov 2023 16:30:49 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT6-0083LC-1G; Fri, 10 Nov 2023 16:30:48 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT5-00GnxS-OV; Fri, 10 Nov 2023 16:30:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Orson Zhai , Baolin Wang , Chunyan Zhang , Richard GENOUD , Krzysztof Kozlowski , Thomas Gleixner , Yangtao Li , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 40/52] serial: sprd: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:08 +0100 Message-ID: <20231110152927.70601-41-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1854; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=JKeg3njv1DfC1+cz/7hRN2iur/eGLM4Vi8Ef2GKE6IQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkyL0bfbABJKlEWBffhmS/GsrsCD7PWLSpoP+ 2/x6Hl4Bk6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MiwAKCRCPgPtYfRL+ Tk/kB/9MhWlQInRgSTy4mV780YSeLxjOwaXT4wbqNQ0Ywbhxtntf4hrimqydArdxckZ6BxgPqpk grK/YYZpieQSwWOQwKSz4h5wfOq5LpGZdXsBzW4n3HpTIt7ZGNG6v2UOI6BTknolmCUse6giyhQ 4Hjo30Esr/e7Y/LWEl/hlE5R/9Gfsq5o3fV4WFej23gA6V/MobJybiNB+4HfsIikUX/eLLljFvs MrpC9DLiQhOfUd8j+77B21ziD0cEEuPF+aDoIQgmagcCqpSS4LOsnB4Q3HoAgvKEQFVaXbma5Jv WPN4idGLygNc+bMYp9/cCRAQpNvbL9VaTLEPlXP2uG2yCbSn 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/sprd_serial.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index f257525f9299..15f14fa593da 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -1076,7 +1076,7 @@ static struct uart_driver sprd_uart_driver = { .cons = SPRD_CONSOLE, }; -static int sprd_remove(struct platform_device *dev) +static void sprd_remove(struct platform_device *dev) { struct sprd_uart_port *sup = platform_get_drvdata(dev); @@ -1089,8 +1089,6 @@ static int sprd_remove(struct platform_device *dev) if (!sprd_ports_num) uart_unregister_driver(&sprd_uart_driver); - - return 0; } static bool sprd_uart_is_console(struct uart_port *uport) @@ -1257,7 +1255,7 @@ MODULE_DEVICE_TABLE(of, serial_ids); static struct platform_driver sprd_platform_driver = { .probe = sprd_probe, - .remove = sprd_remove, + .remove_new = sprd_remove, .driver = { .name = "sprd_serial", .of_match_table = serial_ids, From patchwork Fri Nov 10 15:30:09 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: 743342 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 49871C4167B for ; Fri, 10 Nov 2023 17:46:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235195AbjKJRqA (ORCPT ); Fri, 10 Nov 2023 12:46:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234955AbjKJRo6 (ORCPT ); Fri, 10 Nov 2023 12:44:58 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D2FD3A8B4 for ; Fri, 10 Nov 2023 07:30:57 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT7-0006RQ-Nb; Fri, 10 Nov 2023 16:30:49 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT6-0083LF-7n; Fri, 10 Nov 2023 16:30:48 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT5-00GnxX-Us; Fri, 10 Nov 2023 16:30:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Patrice Chotard , linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 41/52] serial: st-asc: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:09 +0100 Message-ID: <20231110152927.70601-42-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1725; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=gZAuzkYCGY0dF9/FS9pnOeoUofxsKi3Iu2S8ruq8iME=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkyMPWumyxIsIlwiGvagUxMnaptSsbwMux23e 5d5mfo9v2aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MjAAKCRCPgPtYfRL+ ToZgCACKw3RLWpSoo/7rdWWIY4lxOB81Wg6GnHCOLfGnoi/Es1OdVJl2N+FxUO21GX0BDcF2TZC T1OEHHTz4Ey66K2iaQyA4lXjoD+xhhu7eJHWuv3CEdQE4lzsl8n0Dhu9q+UITVoI/t2zLGUvFnL e51FM++X8DqqbIC4WPoLFDIqtNv8TjQxvw9s7LJ6CF8nRfc41XbMzxDkidzyTD4PjRhssd27nFk 5M9P1GXde6KC11mc+jWecG8jX6GXVoY1eKfmG6lRhottrUEAzD8y1Y6BoshxP9V/LP85Xp/c/yJ oCVVmCnr1gPe3t9xhlbDtdHBCI1QsrwdJ+R9PGv2YrvN3QrS 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/st-asc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index a821f5d76a26..bbb5595d7e24 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -793,13 +793,11 @@ static int asc_serial_probe(struct platform_device *pdev) return 0; } -static int asc_serial_remove(struct platform_device *pdev) +static void asc_serial_remove(struct platform_device *pdev) { struct uart_port *port = platform_get_drvdata(pdev); uart_remove_one_port(&asc_uart_driver, port); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -932,7 +930,7 @@ static const struct dev_pm_ops asc_serial_pm_ops = { static struct platform_driver asc_serial_driver = { .probe = asc_serial_probe, - .remove = asc_serial_remove, + .remove_new = asc_serial_remove, .driver = { .name = DRIVER_NAME, .pm = &asc_serial_pm_ops, From patchwork Fri Nov 10 15:30:12 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: 743337 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 08D8FC4167B for ; Fri, 10 Nov 2023 17:56:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229515AbjKJR4M (ORCPT ); Fri, 10 Nov 2023 12:56:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235489AbjKJRzt (ORCPT ); Fri, 10 Nov 2023 12:55:49 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F06D3A8AE for ; Fri, 10 Nov 2023 07:30:52 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT7-0006Sn-GN; Fri, 10 Nov 2023 16:30:49 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT6-0083LS-QS; Fri, 10 Nov 2023 16:30:48 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT6-00Gnxi-HN; Fri, 10 Nov 2023 16:30:48 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Hammer Hsieh , kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 44/52] serial: sunplus: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:12 +0100 Message-ID: <20231110152927.70601-45-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1844; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=V4gEMT6Up/+x/qjHaGbrUAdomXMcVjjjuODHMxiGMi8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkyPl2eAOFum8wjRGTDSEhRAcjz8cNS5o2t+Z UKNETp7/rmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MjwAKCRCPgPtYfRL+ TpdmCACMYGQRnl667oRNutq9gsa//xi7PWWbq9mLOwHtcFwotgr8RprXdSEFj6kMAskQyRLaWmw QLPlg7ekGnn3A4BSKM3w57Bz9nDpkVf9uiDoHIF7KeqFeqqy3RADl+CtH2fTVfZ/X82TDz086y7 w9WIxO4znEd6UJL0e58qNVcnXmX+rrRnGjDcvwZVbw1z9x08zC+yZaHoBb0Sf2hdoX3LQ/xCJWR GllzJw4PveGj5PBBIlgZs1EkM8WgYaoOYrCJ1U4RVQMcWRRbbWjM6eqrgUJmPtTiAxJ/hYEznCh t35RFAxO/V+lXfUkuUut13qEhSSSzzdbDeCjEsDZEGcN2VqX 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/sunplus-uart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sunplus-uart.c b/drivers/tty/serial/sunplus-uart.c index 4251f4e1ba99..99f5285819d4 100644 --- a/drivers/tty/serial/sunplus-uart.c +++ b/drivers/tty/serial/sunplus-uart.c @@ -662,13 +662,11 @@ static int sunplus_uart_probe(struct platform_device *pdev) return ret; } -static int sunplus_uart_remove(struct platform_device *pdev) +static void sunplus_uart_remove(struct platform_device *pdev) { struct sunplus_uart_port *sup = platform_get_drvdata(pdev); uart_remove_one_port(&sunplus_uart_driver, &sup->port); - - return 0; } static int __maybe_unused sunplus_uart_suspend(struct device *dev) @@ -703,7 +701,7 @@ MODULE_DEVICE_TABLE(of, sp_uart_of_match); static struct platform_driver sunplus_uart_platform_driver = { .probe = sunplus_uart_probe, - .remove = sunplus_uart_remove, + .remove_new = sunplus_uart_remove, .driver = { .name = "sunplus_uart", .of_match_table = sp_uart_of_match, From patchwork Fri Nov 10 15:30:13 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: 743321 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 05538C4332F for ; Fri, 10 Nov 2023 19:19:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346147AbjKJTTb (ORCPT ); Fri, 10 Nov 2023 14:19:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346063AbjKJTTQ (ORCPT ); Fri, 10 Nov 2023 14:19:16 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39FD83AE08 for ; Fri, 10 Nov 2023 07:30:57 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT8-0006TD-4o; Fri, 10 Nov 2023 16:30:50 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT6-0083LW-Vz; Fri, 10 Nov 2023 16:30:49 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT6-00Gnxm-Mp; Fri, 10 Nov 2023 16:30:48 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: "David S. Miller" , sparclinux@vger.kernel.org, kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 45/52] serial: sunsab: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:13 +0100 Message-ID: <20231110152927.70601-46-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1786; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=mFZ7rFtgjnKMNWKryiYYB+Rn3DQsgJKunWT+YZc7nkE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkyQCD0lXrxcXc3hXF9OmjGC3tVksi2xlksya MDZz1ZCC8uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MkAAKCRCPgPtYfRL+ Tl+qCACZkj4/wFrmhfGG63TY77xzKqXzJI+YjqlGMXLp0VFeGPUaFLAZChrazwGsaLl67NskSaH LhWFIkzjYzoLae/cCYOuU5g/MGtLxlCaQhL8kobnRxdRhxwAe8VlajMtIdOw38miT5dJRcZmuiP b0LFYGITK0HSpLncAxnQo6rv/PFRXZFxc7Y9VGnhX98MkVyg+mvZtnHSv83prKAXt1HNnk3HgLa pIFlnBSFInCcc3lFL90uyogb80anBDbH6IIRErQpsfRY1tfXwmx2rBtbVLSBsuzsP9YH0NMlBpe mlY9j+zROEbhg2V/644dxU4Rh4DKLhDWRyK3XKjff2Ju1etg 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/sunsab.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c index 6aa51a6f8063..ff557796b578 100644 --- a/drivers/tty/serial/sunsab.c +++ b/drivers/tty/serial/sunsab.c @@ -1066,7 +1066,7 @@ static int sab_probe(struct platform_device *op) return err; } -static int sab_remove(struct platform_device *op) +static void sab_remove(struct platform_device *op) { struct uart_sunsab_port *up = platform_get_drvdata(op); @@ -1078,8 +1078,6 @@ static int sab_remove(struct platform_device *op) of_iounmap(&op->resource[0], up[0].port.membase, sizeof(union sab82532_async_regs)); - - return 0; } static const struct of_device_id sab_match[] = { @@ -1100,7 +1098,7 @@ static struct platform_driver sab_driver = { .of_match_table = sab_match, }, .probe = sab_probe, - .remove = sab_remove, + .remove_new = sab_remove, }; static int __init sunsab_init(void) From patchwork Fri Nov 10 15:30:14 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: 743317 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 A0AC5C4167B for ; Fri, 10 Nov 2023 20:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235929AbjKJUgy (ORCPT ); Fri, 10 Nov 2023 15:36:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235469AbjKJUgk (ORCPT ); Fri, 10 Nov 2023 15:36:40 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 826633AE0A for ; Fri, 10 Nov 2023 07:30:57 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT8-0006Tc-4o; Fri, 10 Nov 2023 16:30:50 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT7-0083La-6T; Fri, 10 Nov 2023 16:30:49 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT6-00Gnxr-Tj; Fri, 10 Nov 2023 16:30:48 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: "David S. Miller" , sparclinux@vger.kernel.org, kernel@pengutronix.de, linux-serial@vger.kernel.org Subject: [PATCH 46/52] serial: sunsu: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:14 +0100 Message-ID: <20231110152927.70601-47-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1719; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=bJvr6ajvc8acvcU6LpWDvOv5tO3tdCW3m+BAMBN9sSk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkySfFl2F/BTiBQOkgUXRv47nPJftRH90peJI DfvmZmIeAOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MkgAKCRCPgPtYfRL+ TnN7B/wLODkAOPQCFWUj4zF150l4kwLErWUwDX15OAohX+Bjvr3cvggKOwDd1eqQJyfRh2Aq3qd 0gtrGa09D2onXpxFGJU9gHHfCV73uttZTYRdbLqibO+mn88rJVLq+1GOZHnC3Ack3giSB4wqSs3 mExxuWH/y6zzdP7xViHRWx8v+dp48hKXcAwZXSLkPRRFvBmBss3omhCsdDvAtHyZQs0N8OGsNcE 6EpxsX4c8XIYx7USAYj2IJL3pf2+jY/A+8Dd7nBFcteFiCyWKX8Q6c8dMwl8IohKBBfogrsNjty VQzAvv3PfFA9hEzW6dIrTvJvmdPC5eAVqniqgA7/GRmi78VV 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/sunsu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c index 1e051cc2591c..c8b65f4b2710 100644 --- a/drivers/tty/serial/sunsu.c +++ b/drivers/tty/serial/sunsu.c @@ -1515,7 +1515,7 @@ static int su_probe(struct platform_device *op) return err; } -static int su_remove(struct platform_device *op) +static void su_remove(struct platform_device *op) { struct uart_sunsu_port *up = platform_get_drvdata(op); bool kbdms = false; @@ -1536,8 +1536,6 @@ static int su_remove(struct platform_device *op) if (kbdms) kfree(up); - - return 0; } static const struct of_device_id su_match[] = { @@ -1565,7 +1563,7 @@ static struct platform_driver su_driver = { .of_match_table = su_match, }, .probe = su_probe, - .remove = su_remove, + .remove_new = su_remove, }; static int __init sunsu_init(void) From patchwork Fri Nov 10 15:30:16 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: 743334 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 AEF75C4332F for ; Fri, 10 Nov 2023 18:03:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235630AbjKJSDv (ORCPT ); Fri, 10 Nov 2023 13:03:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235815AbjKJSCv (ORCPT ); Fri, 10 Nov 2023 13:02:51 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F72B3AE19 for ; Fri, 10 Nov 2023 07:31:00 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT8-0006Vs-CC; Fri, 10 Nov 2023 16:30:50 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT7-0083Li-Ky; Fri, 10 Nov 2023 16:30:49 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT7-00Gnxz-Bw; Fri, 10 Nov 2023 16:30:49 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Thierry Reding , Jonathan Hunter , Rob Herring , kernel@pengutronix.de, linux-serial@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 48/52] serial: tegra-tcu: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:16 +0100 Message-ID: <20231110152927.70601-49-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1884; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=swhoAVWkrMA1knLpinhSt78hBhGNQA0uOcknMNn7oHE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkyUQtzMD5FVl3PDgSX036X6YAVoStTH23z85 lRajOE6YUyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MlAAKCRCPgPtYfRL+ TrJLCACTXSSwXRfVKE8mNLNndtxd/K2yp4IbhNEu6zhTuS/S+8w+maZ7jBYj27IihUFrYwr5FkB Eyv3Q+LNFc2WV5kH2hQ8TKafa/6npOp533lnKpOPOyOtA3Kgp5jKNvvsgfnT3zkoO6XWpeGpUOT dkwpAzKfpmL8O1EOH9mSAKVUr+zLLMZHRfzFbL5AUBpYyriBZBWfUw0P1a5iIUEi/ztoDvS1Svn 2yd9WqczWY1U4AGXDgkxaba/xQKX9zOG9Q3hcOQ0lAf2SC8GPL+802+xVhb/h3imgxKojCyG3S3 RCyMIoJWMY+XUidK1d1DXTwJkZ/wprpGRSn0TXAWPxzHo02v 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/tegra-tcu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/tegra-tcu.c b/drivers/tty/serial/tegra-tcu.c index 65069daf36ec..d9c78320eb02 100644 --- a/drivers/tty/serial/tegra-tcu.c +++ b/drivers/tty/serial/tegra-tcu.c @@ -266,7 +266,7 @@ static int tegra_tcu_probe(struct platform_device *pdev) return err; } -static int tegra_tcu_remove(struct platform_device *pdev) +static void tegra_tcu_remove(struct platform_device *pdev) { struct tegra_tcu *tcu = platform_get_drvdata(pdev); @@ -277,8 +277,6 @@ static int tegra_tcu_remove(struct platform_device *pdev) uart_remove_one_port(&tcu->driver, &tcu->port); uart_unregister_driver(&tcu->driver); mbox_free_channel(tcu->tx); - - return 0; } static const struct of_device_id tegra_tcu_match[] = { @@ -293,7 +291,7 @@ static struct platform_driver tegra_tcu_driver = { .of_match_table = tegra_tcu_match, }, .probe = tegra_tcu_probe, - .remove = tegra_tcu_remove, + .remove_new = tegra_tcu_remove, }; module_platform_driver(tegra_tcu_driver); From patchwork Fri Nov 10 15:30:20 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: 743323 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 A58CEC4167B for ; Fri, 10 Nov 2023 18:29:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346253AbjKJS3a (ORCPT ); Fri, 10 Nov 2023 13:29:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345469AbjKJS13 (ORCPT ); Fri, 10 Nov 2023 13:27:29 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD4853AE2C for ; Fri, 10 Nov 2023 07:31:09 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1TT8-0006aB-Ui; Fri, 10 Nov 2023 16:30:50 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1TT8-0083M1-Df; Fri, 10 Nov 2023 16:30:50 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1TT8-00GnyF-4Q; Fri, 10 Nov 2023 16:30:50 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Michal Simek , Petr Mladek , John Ogness , Ruan Jinjie , Julien Malik , Thomas Gleixner , kernel@pengutronix.de, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 52/52] serial: xilinx_uartps: Convert to platform remove callback returning void Date: Fri, 10 Nov 2023 16:30:20 +0100 Message-ID: <20231110152927.70601-53-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> References: <20231110152927.70601-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1891; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oDO1V0mfGEnMGCQITHferGZjE/RW7aj4K1QhMWCqHCI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTkyYcKVoA2rfh/sNGXuFSpPqKNvbjEd6pDvDn jkNwDSLPJqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU5MmAAKCRCPgPtYfRL+ TlPiB/40emV+cbNrIKsaUbFCYN7kPO7XFtI+Ui73Q/WeOxR39fIAeTSL5Ldpt2W1KU5e7MTDmk+ IhjQV+9A0a5Afo1Itxvr4CBB2oerjnp5PxhW4ytKxdL0zQHcz8dJFNNWXorYxGaRm0XJgNU0Xjg nplx5qJXu6AkMjDp3F5x9K54yYcndKeFVoJXXrUYTonF3AC83O7XlLGs8HPdKW4koObJjn6dwdc Cw2QRzH8EPyg3GS83WRr9B/r7kFOA9PwcSwt+VQT7UC6qoEhjgGXd1pZAfgKJalwKmNwn2FhIms dpA+8BHCV5OB61vp7GzOVGgu1GX6boMWT2PJCFnxCl0Wb74L 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-serial@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/xilinx_uartps.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 66a45a634158..6decf2b13340 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1666,7 +1666,7 @@ static int cdns_uart_probe(struct platform_device *pdev) * * Return: 0 on success, negative errno otherwise */ -static int cdns_uart_remove(struct platform_device *pdev) +static void cdns_uart_remove(struct platform_device *pdev) { struct uart_port *port = platform_get_drvdata(pdev); struct cdns_uart *cdns_uart_data = port->private_data; @@ -1692,12 +1692,11 @@ static int cdns_uart_remove(struct platform_device *pdev) if (!--instances) uart_unregister_driver(cdns_uart_data->cdns_uart_driver); - return 0; } static struct platform_driver cdns_uart_platform_driver = { .probe = cdns_uart_probe, - .remove = cdns_uart_remove, + .remove_new = cdns_uart_remove, .driver = { .name = CDNS_UART_NAME, .of_match_table = cdns_uart_of_match,