From patchwork Sun May 7 16:25:24 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: 13233785 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86AB6C77B75 for ; Sun, 7 May 2023 16:26:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B470B10E1D9; Sun, 7 May 2023 16:26:36 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id BC30510E1FF for ; Sun, 7 May 2023 16:26:35 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDP-0001dP-OP; Sun, 07 May 2023 18:26:27 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDN-001nB8-Rm; Sun, 07 May 2023 18:26:25 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDN-002Afi-3T; Sun, 07 May 2023 18:26:25 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: James@pengutronix.de, Liviu Dudau , Mihail Atanassov , Brian Starkey , David Airlie , Daniel Vetter Subject: [PATCH 01/53] drm/komeda: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:24 +0200 Message-Id: <20230507162616.1368908-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1783; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OvkbG5m0IUNUsqlbgvhk5MDb0LehSI8/F3qShARO9pQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9DkuPeFi45tO4c9lfTHj1terzstr+EWsXbA7 x/LEJC9MpWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ5AAKCRCPgPtYfRL+ Ti6JB/0eBHs1fAarJAUzCnae5/QXAWF0uVEI/Sp77SU/lBsUahaOZeBrEf/bF7HJvyVwldP+BbW EjwFhNhwWSCZ6Godz/uQuXmEES8ha9zwpeLJQMWzwVe8HGGsuOt90l/2WJC611qwB+2cuZcODVI bVRE9sUT7uoqMz46MxLO25gy/3XY1KZyJqAmMS91/SpF7O6OHkDfuc5VIWeMbxcvARvjeAgi0vH ebKSqHyu29e8dbK2wqUXSqkkGA2rsn+NKtQ5A7UmHK4bWrFbF+xf5kNAhx8EtUdAUVNFwTGz4ij 2uR5NOBK8OQGo63bSyhvd1jlHugMdrzYzmOPUUIyqNqe4962 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mali DP Maintainers , kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Liviu Dudau --- drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c index 28f76e07dd95..c597c362f689 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c @@ -131,10 +131,9 @@ static int komeda_platform_probe(struct platform_device *pdev) return component_master_add_with_match(dev, &komeda_master_ops, match); } -static int komeda_platform_remove(struct platform_device *pdev) +static void komeda_platform_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &komeda_master_ops); - return 0; } static const struct of_device_id komeda_of_match[] = { @@ -189,7 +188,7 @@ static const struct dev_pm_ops komeda_pm_ops = { static struct platform_driver komeda_platform_driver = { .probe = komeda_platform_probe, - .remove = komeda_platform_remove, + .remove_new = komeda_platform_remove, .driver = { .name = "komeda", .of_match_table = komeda_of_match, From patchwork Sun May 7 16:25:25 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: 13233789 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B9B9C77B7C for ; Sun, 7 May 2023 16:26:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 00BEC10E22E; Sun, 7 May 2023 16:26:40 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id CCB4F10E20C for ; Sun, 7 May 2023 16:26:35 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDP-0001dS-OP; Sun, 07 May 2023 18:26:27 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDO-001nBK-Fj; Sun, 07 May 2023 18:26:26 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDN-002Afl-9f; Sun, 07 May 2023 18:26:25 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liviu Dudau , Brian Starkey , David Airlie , Daniel Vetter Subject: [PATCH 02/53] drm/arm/hdlcd: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:25 +0200 Message-Id: <20230507162616.1368908-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1601; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=BcsotUJe59zgY1E1RjIlTVRNFL1xf6WmjfvCx9YuOZY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9DlKKI2ju61B/WGXezwgza5MpQSmaOyiRTph Knzu/qGWtqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ5QAKCRCPgPtYfRL+ TsfsCACtqIMylofjDdijFLbCH+p3hxJiSxWXNypyrIX8l5jmIXpwmG9ksYfa+wAgZTLsrG+wZ9e 1c825yV3ocTEF5BKXmUybgeZ0Xs1+Dgnz5dvIrbd+nnhUIuIJj/BNjcUIjQut+eCztGZ8UAyAY9 Pymdc26eDe6hJlyxgem383C9NSuzOk4itvLgVg4KZQvrjFCw6mGyIplpaC7oQVNsI0IF0xTPQx4 hszAta/g8vAfg/vhI/UMdxw4byFe0PaSYNtKK7vzwVfGIQhtQLPNHWFJJd49urSfOWls3U3iyiu MJ28oC1/wLhraUF6oQ3fjAdqhmoOogpmoMSrkIeQEdj6sNeF 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mali DP Maintainers , kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Liviu Dudau --- drivers/gpu/drm/arm/hdlcd_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index e3507dd6f82a..5e265c81a1b3 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -369,10 +369,9 @@ static int hdlcd_probe(struct platform_device *pdev) match); } -static int hdlcd_remove(struct platform_device *pdev) +static void hdlcd_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &hdlcd_master_ops); - return 0; } static const struct of_device_id hdlcd_of_match[] = { @@ -401,7 +400,7 @@ static SIMPLE_DEV_PM_OPS(hdlcd_pm_ops, hdlcd_pm_suspend, hdlcd_pm_resume); static struct platform_driver hdlcd_platform_driver = { .probe = hdlcd_probe, - .remove = hdlcd_remove, + .remove_new = hdlcd_remove, .driver = { .name = "hdlcd", .pm = &hdlcd_pm_ops, From patchwork Sun May 7 16:25:26 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: 13233787 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26503C77B75 for ; Sun, 7 May 2023 16:26:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7535A10E20C; Sun, 7 May 2023 16:26:37 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3627810E1D9 for ; Sun, 7 May 2023 16:26:35 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDP-0001dR-OP; Sun, 07 May 2023 18:26:27 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDO-001nBH-D3; Sun, 07 May 2023 18:26:26 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDN-002Afo-K6; Sun, 07 May 2023 18:26:25 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liviu Dudau , Brian Starkey , David Airlie , Daniel Vetter Subject: [PATCH 03/53] drm/arm/malidp: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:26 +0200 Message-Id: <20230507162616.1368908-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1654; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oIRSKFenS1dYQ6jOO0uI1kxWibMOzGJ6AOJI8U8h3hQ=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTwC88UGFtXtaRnl3ExFgXsKdul1hO+Zf/9S3lWG+5VV Wf6byvsZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAiBfbs/9RsDGbGCQSeu/DF P/GSxo3X159ve3/6zPUtj9zmPu1w52GpEDpvwFdRbP9k30GGzBk7ryYkpPo/5LlepD+5V2HFfqm rJ5ozzVx3JCROrqnUS9YwnOy79RfP/Nvni75cWC9WUT/3yQptxQUz07rzvO7vv+fI6ezwOKOUYY ZIx0ue6nVXjd5YT2Qpnf9WxGFxdWDekoRe8aqX3gE1tv94PvUnaNVezDkgen9ysW2s3KHLGuV5X jPbfu+z+HXqwJm8FfKPL/AvYDKu4ezIEX68tkRw2ybLdyym17wcr4lJPNNU8wkwMMlU9bu4c1OO uqPujIvZt9kz044/dNKONV125cjegF5LJ7NAdnFe/ho+AA== 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mali DP Maintainers , kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Liviu Dudau --- drivers/gpu/drm/arm/malidp_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 589c1c66a6dc..389ef1c3d9b6 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -936,10 +936,9 @@ static int malidp_platform_probe(struct platform_device *pdev) match); } -static int malidp_platform_remove(struct platform_device *pdev) +static void malidp_platform_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &malidp_master_ops); - return 0; } static int __maybe_unused malidp_pm_suspend(struct device *dev) @@ -982,7 +981,7 @@ static const struct dev_pm_ops malidp_pm_ops = { static struct platform_driver malidp_platform_driver = { .probe = malidp_platform_probe, - .remove = malidp_platform_remove, + .remove_new = malidp_platform_remove, .driver = { .name = "mali-dp", .pm = &malidp_pm_ops, From patchwork Sun May 7 16:25:27 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: 13233788 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1408CC7EE24 for ; Sun, 7 May 2023 16:26:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6261610E227; Sun, 7 May 2023 16:26:38 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id C508110E204 for ; Sun, 7 May 2023 16:26:35 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDQ-0001dU-8G; Sun, 07 May 2023 18:26:28 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDP-001nBS-5E; Sun, 07 May 2023 18:26:27 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDN-002Afs-RU; Sun, 07 May 2023 18:26:25 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Russell King , David Airlie , Daniel Vetter Subject: [PATCH 04/53] drm/armada: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:27 +0200 Message-Id: <20230507162616.1368908-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2619; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/FdlWENcVvW3cGuPQ5OlrrjXkRY2fS1amOJKRJMNqIY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9DnEFDcYGKHPHZSWZPqfugPvelXL+lTZ4jQ8 yXsHdDOyuGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ5wAKCRCPgPtYfRL+ TmBvCACqjhqozew6P+8uOtANRdDigS72yCu8rL8GtDTxrjCMOdiJjoNShRVVdvamFjEYS0Ahqm7 DqOJMlY3ojJyyCeyCopaND3jlteRq+PaefIPhDAA+OQSw19POIR1GNOyoD4dAHn6olYTfzB/GU1 JU8U33Ki0twsBYZEXzMLTU04ijPGoVaMrKUHBggStt9UsTnYkKjfVKW9HDpGsuFBJSWrYFWd444 gw/UN6sezkKnGc0EzKwJoreFTvyGGNLiqc4OIISEFG1er5Hg92s+5iAC57B9JzWpKlmmYq6UpqI WLA1VsKHh+hTgQ6HsFNCmwQT8JR5ynWJDLjjBfI3qvPeYtPW 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the armada drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/armada/armada_crtc.c | 5 ++--- drivers/gpu/drm/armada/armada_drv.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index 15dd667aa2e7..52d2c942d3d2 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -1066,10 +1066,9 @@ static int armada_lcd_probe(struct platform_device *pdev) return component_add(&pdev->dev, &armada_lcd_ops); } -static int armada_lcd_remove(struct platform_device *pdev) +static void armada_lcd_remove(struct platform_device *pdev) { component_del(&pdev->dev, &armada_lcd_ops); - return 0; } static const struct of_device_id armada_lcd_of_match[] = { @@ -1095,7 +1094,7 @@ MODULE_DEVICE_TABLE(platform, armada_lcd_platform_ids); struct platform_driver armada_lcd_platform_driver = { .probe = armada_lcd_probe, - .remove = armada_lcd_remove, + .remove_new = armada_lcd_remove, .driver = { .name = "armada-lcd", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index 142668cd6d7c..b8ff21f545cd 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -232,10 +232,9 @@ static int armada_drm_probe(struct platform_device *pdev) match); } -static int armada_drm_remove(struct platform_device *pdev) +static void armada_drm_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &armada_master_ops); - return 0; } static const struct platform_device_id armada_drm_platform_ids[] = { @@ -250,7 +249,7 @@ MODULE_DEVICE_TABLE(platform, armada_drm_platform_ids); static struct platform_driver armada_drm_platform_driver = { .probe = armada_drm_probe, - .remove = armada_drm_remove, + .remove_new = armada_drm_remove, .driver = { .name = "armada-drm", }, From patchwork Sun May 7 16:25:28 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: 13233817 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9975DC77B7C for ; Sun, 7 May 2023 16:27:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B11B810E28C; Sun, 7 May 2023 16:27:14 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id F329210E208 for ; Sun, 7 May 2023 16:26:44 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDS-0001dT-S6; Sun, 07 May 2023 18:26:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDO-001nBO-T0; Sun, 07 May 2023 18:26:26 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDO-002Afw-3k; Sun, 07 May 2023 18:26:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Joel Stanley , David Airlie , Daniel Vetter Subject: [PATCH 05/53] drm/aspeed: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:28 +0200 Message-Id: <20230507162616.1368908-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1662; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=sobAg6Eg+gKdbd2fhmmqrspNYTQq+HfT/x7kh1gXCMU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9DoTwxX8oa8uhAkh2uW1KmDaDlPlpXQIcPiU HjOchsc3OaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ6AAKCRCPgPtYfRL+ TnArCACeESOC7nnTd6GZkV1m4vCElrTeUnG/+J0vzaHSVXYMMPvUSLcWL98/DXESfV+vRbZdVRS zLWmtQHmaXaPiRztaOaAx1LVNoQ5D24/XgF+iTThVs4sADR0YZ79NBzbnZfnAtk0+P8bTNKazie AtF8t0diQ9aPZD56n+98UE5m/gmQQTTGfanrDGLuVyNJvD1Q+pXLyD1MFgA5Q02c4vpspE2ZKeh xEd1f7SfPAfXnqtMgt5C4ZHB30L3y0UaQmP+N/CIqvTkcgE0I4NLDKJW/DdMXgJU1Vkzd8uq4Q7 W3wi0msfUPb8OgLWiEIjkUwajRsqZzxdjDRVCEXR749mAUuO 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , kernel@pengutronix.de, dri-devel@lists.freedesktop.org, linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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/gpu/drm/aspeed/aspeed_gfx_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c index ecfb060d2557..d0089e7fbfae 100644 --- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c @@ -351,20 +351,18 @@ static int aspeed_gfx_probe(struct platform_device *pdev) return ret; } -static int aspeed_gfx_remove(struct platform_device *pdev) +static void aspeed_gfx_remove(struct platform_device *pdev) { struct drm_device *drm = platform_get_drvdata(pdev); sysfs_remove_group(&pdev->dev.kobj, &aspeed_sysfs_attr_group); drm_dev_unregister(drm); aspeed_gfx_unload(drm); - - return 0; } static struct platform_driver aspeed_gfx_platform_driver = { .probe = aspeed_gfx_probe, - .remove = aspeed_gfx_remove, + .remove_new = aspeed_gfx_remove, .driver = { .name = "aspeed_gfx", .of_match_table = aspeed_gfx_match, From patchwork Sun May 7 16:25: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: 13233798 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8AB78C77B7C for ; Sun, 7 May 2023 16:27:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 264D710E25F; Sun, 7 May 2023 16:26:49 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF5BB10E208 for ; Sun, 7 May 2023 16:26:39 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDS-0001dy-S7; Sun, 07 May 2023 18:26:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDP-001nBd-Te; Sun, 07 May 2023 18:26:27 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDO-002Afz-Bb; Sun, 07 May 2023 18:26:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sam Ravnborg , Boris Brezillon , David Airlie , Daniel Vetter , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Subject: [PATCH 06/53] drm/atmel-hlcdc: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:29 +0200 Message-Id: <20230507162616.1368908-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1879; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7ujUAumCLtbl6IzTAzsgkmHDHidTx/e4bRhs71MEbvE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9DqywKY1tTDHN5DaO+Gz51KbNZu8Dd1OKPli jnO0dgRhZmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ6gAKCRCPgPtYfRL+ TvvcB/wJG/rRk0TBYsOHv1FtJX6l/rSj79MIQqTrXMuGyIYqLMQqOVMT/PROXND30oZrnTJems/ z8FQlqd9wNjmrcrP2PuJ2zKx3T2bNlCZOrquQSU5IsqMo79OjgifiG7B8Umsb/LkkYlYHC+zNPm WHcmHnDh77nDI20yo3mO0Srbd4+BxOQO8VdRnB3ijzyEJ8vph02ifDziukq8tFryh3TsEl1eG6Z 4tUeQmQvgeY0I8B4qRh1hkd0ag0EKcmhOqJpLa/0yadrQf1ZxKzZZ14A+2r/bXLUSfgjg6DL274 f3obpws+7ZuhsfCddIfbZ97TkF727RBEW+jbJzcj3K4c0EL+ 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Sam Ravnborg Reviewed-by: Claudiu Beznea --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index 4e806b06d35d..e3960cd11a6b 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -773,15 +773,13 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev) return ret; } -static int atmel_hlcdc_dc_drm_remove(struct platform_device *pdev) +static void atmel_hlcdc_dc_drm_remove(struct platform_device *pdev) { struct drm_device *ddev = platform_get_drvdata(pdev); drm_dev_unregister(ddev); atmel_hlcdc_dc_unload(ddev); drm_dev_put(ddev); - - return 0; } static int atmel_hlcdc_dc_drm_suspend(struct device *dev) @@ -826,7 +824,7 @@ static const struct of_device_id atmel_hlcdc_dc_of_match[] = { static struct platform_driver atmel_hlcdc_dc_platform_driver = { .probe = atmel_hlcdc_dc_drm_probe, - .remove = atmel_hlcdc_dc_drm_remove, + .remove_new = atmel_hlcdc_dc_drm_remove, .driver = { .name = "atmel-hlcdc-display-controller", .pm = pm_sleep_ptr(&atmel_hlcdc_dc_drm_pm_ops), From patchwork Sun May 7 16:25: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: 13233828 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7923DC77B75 for ; Sun, 7 May 2023 16:27:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D328610E2BA; Sun, 7 May 2023 16:27:21 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id D983C10E208 for ; Sun, 7 May 2023 16:26:43 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDS-0001dx-6a; Sun, 07 May 2023 18:26:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDP-001nBc-TM; Sun, 07 May 2023 18:26:27 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDO-002Ag4-KO; Sun, 07 May 2023 18:26:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter , Tomi Valkeinen , Rahul T R , Jayshri Pawar Subject: [PATCH 07/53] drm/bridge: cdns-dsi: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:30 +0200 Message-Id: <20230507162616.1368908-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1871; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=eNvxOjdfxQPRMVFZafFcSaTeGH5Q8TB8svrRybsNEVk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9Dr5momXKEF45kL/UWTqVLIP0CXMtkbXttDJ yeFvqGHvWOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ6wAKCRCPgPtYfRL+ To9YB/9Akph6ldo43rmICyCtAa4p5g83e8ndLhkzZxcLMkmXm9lWYq6qCX09GpDMbG6HM9MxMBw VONqpn2em8Z0hhuwkzJ7YhJVQC88gQzmUf+F0qfUf3yvzjdorbjg5Ff+0jtJZJDHHF+F3LxhbON ZmOs4P6WNX8LzwrmTIhrTVXg+QrfmK6uEvFIoMccQOPh5nv6YZVRVghOrxjhB9xBjwp0troaTls YnU06ahE4PmLWy4BjN7pKUWwYMu6D+ua/RcwCN3hnoHtiNl9LBbK2TOKaBJLKTaHdxfrBOXOZwj 0HSUAinm8FatMblbdr+IjTch17D4MIfMSJ4/iP2NxLPcPYFd 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org, Laurent Pinchart , Jernej Skrabec , Jonas Karlman Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Laurent Pinchart --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c index 5dbfc7226b31..f50d65f54314 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -1278,7 +1278,7 @@ static int cdns_dsi_drm_probe(struct platform_device *pdev) return ret; } -static int cdns_dsi_drm_remove(struct platform_device *pdev) +static void cdns_dsi_drm_remove(struct platform_device *pdev) { struct cdns_dsi *dsi = platform_get_drvdata(pdev); @@ -1288,8 +1288,6 @@ static int cdns_dsi_drm_remove(struct platform_device *pdev) dsi->platform_ops->deinit(dsi); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id cdns_dsi_of_match[] = { @@ -1303,7 +1301,7 @@ MODULE_DEVICE_TABLE(of, cdns_dsi_of_match); static struct platform_driver cdns_dsi_platform_driver = { .probe = cdns_dsi_drm_probe, - .remove = cdns_dsi_drm_remove, + .remove_new = cdns_dsi_drm_remove, .driver = { .name = "cdns-dsi", .of_match_table = cdns_dsi_of_match, From patchwork Sun May 7 16:25:31 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: 13233827 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61BA9C77B7C for ; Sun, 7 May 2023 16:27:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A6C910E2B7; Sun, 7 May 2023 16:27:21 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id F081C10E222 for ; Sun, 7 May 2023 16:26:39 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDR-0001e5-Mk; Sun, 07 May 2023 18:26:29 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDQ-001nBl-33; Sun, 07 May 2023 18:26:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDO-002Ag7-Tf; Sun, 07 May 2023 18:26:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter Subject: [PATCH 08/53] drm/bridge: display-connector: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:31 +0200 Message-Id: <20230507162616.1368908-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1916; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=BttTyRX9EsgM5qX2qxFWRDeeP4XvZKsP9X9LPBgZiWo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9Ds1h1MElY3E9cNEmrfBwm4U2DuCvNqsGLrR 1BgGT5XR1qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ7AAKCRCPgPtYfRL+ TrRSCACPCMMFTk2RkZ/fr/xeQkAUkxO4OgomQu02C8qTw6r5XbF0+r8C14Eiq+Fiz17F1UDqOg0 tmWNj/sM38kFXSV5sUY1WHLZggXBXy/74XZhsiRMt5wysPCfOmnvUC8qpPdrcnDkGkdhGc4uwPU WLiJjrrSk2LHFGzyd3B6xm92PwyIM594hzmWu22gCOBe8DDIVHdjwGZJvwpTRsv/U14GK3pbO22 tFyR4mbPz+L8WEhgKmnkMv8urKlSGowquQlAPZiJrsrpOmZWhTLUEXqj1R5jZa6UsRCNo1mxcvc i33F/edTV/OrORA1rMryxQQEKa0LLT8zAvchwPr57/W9Gz9w 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org, Laurent Pinchart , Jernej Skrabec , Jonas Karlman Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Laurent Pinchart --- drivers/gpu/drm/bridge/display-connector.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c index 9a12449ad7b8..fbb3e102c02f 100644 --- a/drivers/gpu/drm/bridge/display-connector.c +++ b/drivers/gpu/drm/bridge/display-connector.c @@ -382,7 +382,7 @@ static int display_connector_probe(struct platform_device *pdev) return 0; } -static int display_connector_remove(struct platform_device *pdev) +static void display_connector_remove(struct platform_device *pdev) { struct display_connector *conn = platform_get_drvdata(pdev); @@ -396,8 +396,6 @@ static int display_connector_remove(struct platform_device *pdev) if (!IS_ERR(conn->bridge.ddc)) i2c_put_adapter(conn->bridge.ddc); - - return 0; } static const struct of_device_id display_connector_match[] = { @@ -426,7 +424,7 @@ MODULE_DEVICE_TABLE(of, display_connector_match); static struct platform_driver display_connector_driver = { .probe = display_connector_probe, - .remove = display_connector_remove, + .remove_new = display_connector_remove, .driver = { .name = "display-connector", .of_match_table = display_connector_match, From patchwork Sun May 7 16:25: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: 13233795 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B6A5C7EE24 for ; Sun, 7 May 2023 16:27:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D6A3B10E24E; Sun, 7 May 2023 16:26:47 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 32E6510E208 for ; Sun, 7 May 2023 16:26:40 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDR-0001e9-Mq; Sun, 07 May 2023 18:26:29 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDQ-001nBp-9B; Sun, 07 May 2023 18:26:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDP-002AgB-79; Sun, 07 May 2023 18:26:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter Subject: [PATCH 09/53] drm/bridge: fsl-ldb: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:32 +0200 Message-Id: <20230507162616.1368908-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1628; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=WmJGj5zZgjZTb/hhWzS7CvlrE+edWWq2LiMSrtRIhAI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9DtdX6600O1qKeJwmA1NMRWVg/sCsVDmT8FM krZAeUrb8aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ7QAKCRCPgPtYfRL+ Tl1hB/98d8G520k4HTgZBcH/pSa0pB6Fm96AdgCqDyO7hfitt11qZ7ZUBG6Qg+u0z3+A7bjo0iA 0BHD/+FAr5SJy3KZdSzxisfEkyFfCElo4pi2rCKQa1wIN19pzarRvJ6ANqSV15xjMfWYDPmB/p+ Np4bxZrTAtLvHe58mSWft4Drb4QhK1n21+uC2U7nwn+hHNyBBY1zmzEdflBDYZRKebKbuBKCK4z LrfcpIgxGFIEHZFTMX4gsXTUELpq57Tl1TwEV1Y2WHFrrxgia/5jqtmMa3YBXK3i6we4feM68qz zqZHhTLOJmNO1liC2kurvDWG/+Ux0EfzAUAWKkUhVWkaXjqh 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org, Laurent Pinchart , Jernej Skrabec , Jonas Karlman Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Laurent Pinchart --- drivers/gpu/drm/bridge/fsl-ldb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/fsl-ldb.c b/drivers/gpu/drm/bridge/fsl-ldb.c index 6bac160b395b..450b352914f4 100644 --- a/drivers/gpu/drm/bridge/fsl-ldb.c +++ b/drivers/gpu/drm/bridge/fsl-ldb.c @@ -347,13 +347,11 @@ static int fsl_ldb_probe(struct platform_device *pdev) return 0; } -static int fsl_ldb_remove(struct platform_device *pdev) +static void fsl_ldb_remove(struct platform_device *pdev) { struct fsl_ldb *fsl_ldb = platform_get_drvdata(pdev); drm_bridge_remove(&fsl_ldb->bridge); - - return 0; } static const struct of_device_id fsl_ldb_match[] = { @@ -367,7 +365,7 @@ MODULE_DEVICE_TABLE(of, fsl_ldb_match); static struct platform_driver fsl_ldb_driver = { .probe = fsl_ldb_probe, - .remove = fsl_ldb_remove, + .remove_new = fsl_ldb_remove, .driver = { .name = "fsl-ldb", .of_match_table = fsl_ldb_match, From patchwork Sun May 7 16:25:33 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: 13233804 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D94D2C7EE24 for ; Sun, 7 May 2023 16:27:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C6E110E26F; Sun, 7 May 2023 16:26:58 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id C3DE810E24E for ; Sun, 7 May 2023 16:26:42 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDS-0001eB-SA; Sun, 07 May 2023 18:26:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDQ-001nBs-BV; Sun, 07 May 2023 18:26:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDP-002AgF-EW; Sun, 07 May 2023 18:26:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liu Ying , Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer Subject: [PATCH 10/53] drm/imx/imx8*: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:33 +0200 Message-Id: <20230507162616.1368908-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6662; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=w0wm/m6KTZ/aEkFpblu7iJD33wBFarzjpv7j5zgUhIU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9DuOHcOizatAVIXpr1t5mM+sZZZyf3JDwIs/ +i1RtSHzSWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ7gAKCRCPgPtYfRL+ TqViB/4nHOeM0WAbV5b+9g0kMT2d1sXER9zrZwyq248bBViu7pHty1Vkvmg7eU4Y27w1VjUgyxd khtSo9QlwrrewAxZPu5I+xr8hZyTi0vRz8kiTzU7mDOZNgw7byVA4CTfAmgPaoaJDc3a2sxcDJH Eju47hd1vWPsgol8pH/4WVzZkYO9B2S0Lu8ZFR/3cx/JanlLLaAnLBr8RPklu27eFP0fv3WM0ni PsI6vno4x5OVfWmdW0Fe10YkykUVsC0y2E+gCSicPFmHBN3IZFsvxLrXETdWvGXRjXWYKi1fGkH /wVSL7pbxxHiYSwBmP21NUnacjvEoRSqGf9yh7JY7Shrlurb 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jernej Skrabec , Jonas Karlman , dri-devel@lists.freedesktop.org, NXP Linux Team , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the imx8 drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c | 6 ++---- drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c | 6 ++---- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 6 ++---- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 6 ++---- drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 6 ++---- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c b/drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c index 178af8d2d80b..386032a02599 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c +++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c @@ -532,7 +532,7 @@ static int imx8qm_ldb_probe(struct platform_device *pdev) return ret; } -static int imx8qm_ldb_remove(struct platform_device *pdev) +static void imx8qm_ldb_remove(struct platform_device *pdev) { struct imx8qm_ldb *imx8qm_ldb = platform_get_drvdata(pdev); struct ldb *ldb = &imx8qm_ldb->base; @@ -540,8 +540,6 @@ static int imx8qm_ldb_remove(struct platform_device *pdev) ldb_remove_bridge_helper(ldb); pm_runtime_disable(&pdev->dev); - - return 0; } static int __maybe_unused imx8qm_ldb_runtime_suspend(struct device *dev) @@ -573,7 +571,7 @@ MODULE_DEVICE_TABLE(of, imx8qm_ldb_dt_ids); static struct platform_driver imx8qm_ldb_driver = { .probe = imx8qm_ldb_probe, - .remove = imx8qm_ldb_remove, + .remove_new = imx8qm_ldb_remove, .driver = { .pm = &imx8qm_ldb_pm_ops, .name = DRIVER_NAME, diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c index 63948d5d20fd..c806576b1e22 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c @@ -667,7 +667,7 @@ static int imx8qxp_ldb_probe(struct platform_device *pdev) return ret; } -static int imx8qxp_ldb_remove(struct platform_device *pdev) +static void imx8qxp_ldb_remove(struct platform_device *pdev) { struct imx8qxp_ldb *imx8qxp_ldb = platform_get_drvdata(pdev); struct ldb *ldb = &imx8qxp_ldb->base; @@ -675,8 +675,6 @@ static int imx8qxp_ldb_remove(struct platform_device *pdev) ldb_remove_bridge_helper(ldb); pm_runtime_disable(&pdev->dev); - - return 0; } static int __maybe_unused imx8qxp_ldb_runtime_suspend(struct device *dev) @@ -708,7 +706,7 @@ MODULE_DEVICE_TABLE(of, imx8qxp_ldb_dt_ids); static struct platform_driver imx8qxp_ldb_driver = { .probe = imx8qxp_ldb_probe, - .remove = imx8qxp_ldb_remove, + .remove_new = imx8qxp_ldb_remove, .driver = { .pm = &imx8qxp_ldb_pm_ops, .name = DRIVER_NAME, diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c index 503bd8db8afe..d0868a6ac6c9 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c @@ -357,7 +357,7 @@ static int imx8qxp_pc_bridge_probe(struct platform_device *pdev) return ret; } -static int imx8qxp_pc_bridge_remove(struct platform_device *pdev) +static void imx8qxp_pc_bridge_remove(struct platform_device *pdev) { struct imx8qxp_pc *pc = platform_get_drvdata(pdev); struct imx8qxp_pc_channel *ch; @@ -374,8 +374,6 @@ static int imx8qxp_pc_bridge_remove(struct platform_device *pdev) } pm_runtime_disable(&pdev->dev); - - return 0; } static int __maybe_unused imx8qxp_pc_runtime_suspend(struct device *dev) @@ -435,7 +433,7 @@ MODULE_DEVICE_TABLE(of, imx8qxp_pc_dt_ids); static struct platform_driver imx8qxp_pc_bridge_driver = { .probe = imx8qxp_pc_bridge_probe, - .remove = imx8qxp_pc_bridge_remove, + .remove_new = imx8qxp_pc_bridge_remove, .driver = { .pm = &imx8qxp_pc_pm_ops, .name = DRIVER_NAME, diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c index 9e5f2b4dc2e5..25dc82a44ef4 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -398,13 +398,11 @@ static int imx8qxp_pixel_link_bridge_probe(struct platform_device *pdev) return ret; } -static int imx8qxp_pixel_link_bridge_remove(struct platform_device *pdev) +static void imx8qxp_pixel_link_bridge_remove(struct platform_device *pdev) { struct imx8qxp_pixel_link *pl = platform_get_drvdata(pdev); drm_bridge_remove(&pl->bridge); - - return 0; } static const struct of_device_id imx8qxp_pixel_link_dt_ids[] = { @@ -416,7 +414,7 @@ MODULE_DEVICE_TABLE(of, imx8qxp_pixel_link_dt_ids); static struct platform_driver imx8qxp_pixel_link_bridge_driver = { .probe = imx8qxp_pixel_link_bridge_probe, - .remove = imx8qxp_pixel_link_bridge_remove, + .remove_new = imx8qxp_pixel_link_bridge_remove, .driver = { .of_match_table = imx8qxp_pixel_link_dt_ids, .name = DRIVER_NAME, diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c index d0fec82f0cf8..4a886cb808ca 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c @@ -455,15 +455,13 @@ static int imx8qxp_pxl2dpi_bridge_probe(struct platform_device *pdev) return ret; } -static int imx8qxp_pxl2dpi_bridge_remove(struct platform_device *pdev) +static void imx8qxp_pxl2dpi_bridge_remove(struct platform_device *pdev) { struct imx8qxp_pxl2dpi *p2d = platform_get_drvdata(pdev); drm_bridge_remove(&p2d->bridge); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id imx8qxp_pxl2dpi_dt_ids[] = { @@ -474,7 +472,7 @@ MODULE_DEVICE_TABLE(of, imx8qxp_pxl2dpi_dt_ids); static struct platform_driver imx8qxp_pxl2dpi_bridge_driver = { .probe = imx8qxp_pxl2dpi_bridge_probe, - .remove = imx8qxp_pxl2dpi_bridge_remove, + .remove_new = imx8qxp_pxl2dpi_bridge_remove, .driver = { .of_match_table = imx8qxp_pxl2dpi_dt_ids, .name = DRIVER_NAME, From patchwork Sun May 7 16:25: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: 13233819 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E80D5C77B7C for ; Sun, 7 May 2023 16:27:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 62CD410E2A6; Sun, 7 May 2023 16:27:16 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7748E10E24E for ; Sun, 7 May 2023 16:26:41 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDR-0001eH-Mw; Sun, 07 May 2023 18:26:29 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDQ-001nBu-C7; Sun, 07 May 2023 18:26:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDP-002AgI-Lh; Sun, 07 May 2023 18:26:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter Subject: [PATCH 11/53] drm/bridge: lvds-codec: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:34 +0200 Message-Id: <20230507162616.1368908-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1685; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=SVLCg0j2jmMWLC7kq7k43Us2gCMuVufSOkCBmvnFhz8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9DwR2kueJa/f70mXolx6bCGuq9odV8IvYTEv 5uW/2aDde6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ8AAKCRCPgPtYfRL+ Tqd4B/9E+yKXlkMuNkf1J9LEDE/70YkWYZqzCzmMooUR0/fCIx0vperoaqY0Abpt2JXtcn+c27E EZGesvS6zxeLIZlC47hbaVQAkqOwkNoQAvfsnrE3mc9kuA7mWpoKsB1LHmdxDqmRKkVBcih4jQe qBc8Akfw3ZZqqpfYAjVQOmfGvTsE/5ikcvYFeCCZ4EiohaTmjOezYFmD6c7bVnclDjIl2cZrQbb Fb4xh/18VKHLfC3dTuI0xLCy8vxHhJRgfNbnOdOGXfK/xZcs0l1gRBlikKatYA8vfHCUISdsJrv K3Lv5j3kB0FWoT0nemNJj39Rp9IqREIFAr64zMxFUi4i67Rp 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org, Laurent Pinchart , Jernej Skrabec , Jonas Karlman Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Laurent Pinchart --- drivers/gpu/drm/bridge/lvds-codec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/lvds-codec.c b/drivers/gpu/drm/bridge/lvds-codec.c index 39e7004de720..67368f23d4aa 100644 --- a/drivers/gpu/drm/bridge/lvds-codec.c +++ b/drivers/gpu/drm/bridge/lvds-codec.c @@ -215,13 +215,11 @@ static int lvds_codec_probe(struct platform_device *pdev) return 0; } -static int lvds_codec_remove(struct platform_device *pdev) +static void lvds_codec_remove(struct platform_device *pdev) { struct lvds_codec *lvds_codec = platform_get_drvdata(pdev); drm_bridge_remove(&lvds_codec->bridge); - - return 0; } static const struct of_device_id lvds_codec_match[] = { @@ -243,7 +241,7 @@ MODULE_DEVICE_TABLE(of, lvds_codec_match); static struct platform_driver lvds_codec_driver = { .probe = lvds_codec_probe, - .remove = lvds_codec_remove, + .remove_new = lvds_codec_remove, .driver = { .name = "lvds-codec", .of_match_table = lvds_codec_match, From patchwork Sun May 7 16:25: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: 13233820 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A2BAC77B75 for ; Sun, 7 May 2023 16:27:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D7BB10E29E; Sun, 7 May 2023 16:27:15 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6C00A10E222 for ; Sun, 7 May 2023 16:26:39 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDR-0001eo-Mk; Sun, 07 May 2023 18:26:29 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDQ-001nC0-HI; Sun, 07 May 2023 18:26:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDP-002AgL-Rl; Sun, 07 May 2023 18:26:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter Subject: [PATCH 12/53] drm/bridge: nwl-dsi: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:35 +0200 Message-Id: <20230507162616.1368908-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1659; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=3zR5t3zdMW3365XlnzO/Z8IlMTrqK4KOlVlOFzp1Fc4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9DxQD0IPuV1DexjmK4NGsy+Em9xwXS6WuRQD 4Gu7YWbGCOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ8QAKCRCPgPtYfRL+ TgbKB/9VzRDsas8nqWOy2XHxgXS3kSZafEaPOSzZjKVEWjagcntJC6iiM28i+Y1PmC7QRZyqoW5 iAvIJkE4G30gfP00jfGzjVI0X4/OzECg8YNMHJ6nBEXtwh8OLMYcqROOmzbGOrg0zV4umRDdMaP afgGPnfRDD+gr/FEcwyxS+J+oWRC70ikvtyvpAYFeEPJT31VWiVjC5mRPeeKcA4p6SbPCrItdrv TINo3ZI6+FFbrAoll80EdEZfim3zhjOJOKyzPDx6AR3c2ysqK3cfBLF2LCWSrEkfRhTCM5VL01o rD8TTdTfQXtkn0l+L8ifciaBv9Th2NyAweUx/32gqwwi4RPF 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org, Laurent Pinchart , Jernej Skrabec , Jonas Karlman Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Laurent Pinchart --- drivers/gpu/drm/bridge/nwl-dsi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c index 6dc2a4e191d7..4a5f5c4f5dcc 100644 --- a/drivers/gpu/drm/bridge/nwl-dsi.c +++ b/drivers/gpu/drm/bridge/nwl-dsi.c @@ -1199,7 +1199,7 @@ static int nwl_dsi_probe(struct platform_device *pdev) return 0; } -static int nwl_dsi_remove(struct platform_device *pdev) +static void nwl_dsi_remove(struct platform_device *pdev) { struct nwl_dsi *dsi = platform_get_drvdata(pdev); @@ -1207,12 +1207,11 @@ static int nwl_dsi_remove(struct platform_device *pdev) mipi_dsi_host_unregister(&dsi->dsi_host); drm_bridge_remove(&dsi->bridge); pm_runtime_disable(&pdev->dev); - return 0; } static struct platform_driver nwl_dsi_driver = { .probe = nwl_dsi_probe, - .remove = nwl_dsi_remove, + .remove_new = nwl_dsi_remove, .driver = { .of_match_table = nwl_dsi_dt_ids, .name = DRV_NAME, From patchwork Sun May 7 16:25: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: 13233837 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4928C7EE24 for ; Sun, 7 May 2023 16:28:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1636310E2B2; Sun, 7 May 2023 16:27:39 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA51510E23B for ; Sun, 7 May 2023 16:26:40 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDR-0001hW-Sa; Sun, 07 May 2023 18:26:29 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDR-001nC5-5B; Sun, 07 May 2023 18:26:29 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDQ-002AgQ-5b; Sun, 07 May 2023 18:26:28 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter Subject: [PATCH 13/53] drm/bridge: simple-bridge: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:36 +0200 Message-Id: <20230507162616.1368908-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1674; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=mwZj4gHUFHV20QvYsxv1JBy5tueuFIw8nWyhK6OZyaI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9DyKvYR3EcH++T0vcLPSbwPicd4gtZYvWpqp 9MSX5TSObKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ8gAKCRCPgPtYfRL+ TtTGCACoIfEHjwHcDUp4yelOhDOYUtTG6lh48iUxUxMlTuNaDiI7nZPgJZzMJcZCu7yzn9ml6in C5ilg/vbVdFwgyF3fr1He2x20cIqYnYKNecXOcobeBSwIahj9o9S9I1xCV+1RpsNQFdzRmNXYMq MLcVD14J8OcN+z0bbsKH7JztO5VNTVKYbB5Yj3vkT11SdeA1JdSYP67p5yrBaqwz22qXrmDtdCj hb01a2MF8YsXc7Ddd9YqyKhRUF4sag8Su+7dybCJtCuffJOS6G4i8nUdvlQFkEcPsmBrjvaZwQc 0x1rtCDkZQfqxO05ArJlPU3ftDdFyFOfZwnD1jyepuFi878h 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org, Laurent Pinchart , Jernej Skrabec , Jonas Karlman Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Laurent Pinchart --- drivers/gpu/drm/bridge/simple-bridge.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/simple-bridge.c b/drivers/gpu/drm/bridge/simple-bridge.c index 2c5c5211bdab..5ede3e111096 100644 --- a/drivers/gpu/drm/bridge/simple-bridge.c +++ b/drivers/gpu/drm/bridge/simple-bridge.c @@ -218,13 +218,11 @@ static int simple_bridge_probe(struct platform_device *pdev) return 0; } -static int simple_bridge_remove(struct platform_device *pdev) +static void simple_bridge_remove(struct platform_device *pdev) { struct simple_bridge *sbridge = platform_get_drvdata(pdev); drm_bridge_remove(&sbridge->bridge); - - return 0; } /* @@ -301,7 +299,7 @@ MODULE_DEVICE_TABLE(of, simple_bridge_match); static struct platform_driver simple_bridge_driver = { .probe = simple_bridge_probe, - .remove = simple_bridge_remove, + .remove_new = simple_bridge_remove, .driver = { .name = "simple-bridge", .of_match_table = simple_bridge_match, From patchwork Sun May 7 16:25: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: 13233831 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 77521C7EE24 for ; Sun, 7 May 2023 16:28:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B180E10E2BB; Sun, 7 May 2023 16:27:23 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id C2D5610E208 for ; Sun, 7 May 2023 16:26:46 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDT-0001iS-KY; Sun, 07 May 2023 18:26:31 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDR-001nC9-Gv; Sun, 07 May 2023 18:26:29 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDQ-002AgW-IW; Sun, 07 May 2023 18:26:28 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter , Minghao Chi , Mark Brown , Kuninori Morimoto Subject: [PATCH 14/53] drm/bridge: synopsys: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:37 +0200 Message-Id: <20230507162616.1368908-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4543; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=RmALSi7arc8L/LkIjMqDVXDgMpkLumx6TXSe9TsFeJU=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTwC58/hpS9v9M9bZegTfHSJ2naO28tSFPhbzU5Gc4vm xSVKTe/k9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJTK9m/5/4unXF3h5RizlX qkv3hav8mKntZrAuuClAI0T3+zzP9g2/rP+etvd16CjymHV66/lvfBwH446EfvyrbBpj1/dMori kqVyWi9FZoa/aL0IhpeZcXkfIQvd6R+fciQ1ebNvCjgjUveQS3RmzLDDux2W+6iIBkVV5jyeJZn WwVWYLxTbVTxKw+fF/2e0/hmV52V37XBmfMVf8XrqjMsI37oHE5ut3tt56wLLEZMq9Zc53vtS8y 2VZvztb7n/BuTeyKXKvf6YYtPxeni+rU372Y+RDtRU+8RNf/DoyZ+F9/4+hqUJKnfLiV/lPPrkZ aBM4I0IsyfivdsC/OxwRM2PmJU/aUJbXqpinNldq5/J1AA== 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org, Laurent Pinchart , Jernej Skrabec , Jonas Karlman Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the synopsis bridge drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c | 6 ++---- drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 6 ++---- drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c | 6 ++---- drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 6 ++---- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c index 4efb62bcdb63..67b8d17a722a 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c @@ -584,13 +584,11 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev) return ret; } -static int snd_dw_hdmi_remove(struct platform_device *pdev) +static void snd_dw_hdmi_remove(struct platform_device *pdev) { struct snd_dw_hdmi *dw = platform_get_drvdata(pdev); snd_card_free(dw->card); - - return 0; } #if defined(CONFIG_PM_SLEEP) && defined(IS_NOT_BROKEN) @@ -625,7 +623,7 @@ static SIMPLE_DEV_PM_OPS(snd_dw_hdmi_pm, snd_dw_hdmi_suspend, static struct platform_driver snd_dw_hdmi_driver = { .probe = snd_dw_hdmi_probe, - .remove = snd_dw_hdmi_remove, + .remove_new = snd_dw_hdmi_remove, .driver = { .name = DRIVER_NAME, .pm = PM_OPS, diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c index c8f44bcb298a..9389ce526eb1 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c @@ -296,19 +296,17 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev) return 0; } -static int dw_hdmi_cec_remove(struct platform_device *pdev) +static void dw_hdmi_cec_remove(struct platform_device *pdev) { struct dw_hdmi_cec *cec = platform_get_drvdata(pdev); cec_notifier_cec_adap_unregister(cec->notify, cec->adap); cec_unregister_adapter(cec->adap); - - return 0; } static struct platform_driver dw_hdmi_cec_driver = { .probe = dw_hdmi_cec_probe, - .remove = dw_hdmi_cec_remove, + .remove_new = dw_hdmi_cec_remove, .driver = { .name = "dw-hdmi-cec", }, diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c index 557966239677..423762da2ab4 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c @@ -172,18 +172,16 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev) return PTR_ERR_OR_ZERO(dw->audio_pdev); } -static int snd_dw_hdmi_remove(struct platform_device *pdev) +static void snd_dw_hdmi_remove(struct platform_device *pdev) { struct snd_dw_hdmi *dw = platform_get_drvdata(pdev); platform_device_unregister(dw->audio_pdev); - - return 0; } static struct platform_driver snd_dw_hdmi_driver = { .probe = snd_dw_hdmi_probe, - .remove = snd_dw_hdmi_remove, + .remove_new = snd_dw_hdmi_remove, .driver = { .name = DRIVER_NAME, }, diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c index d751820c6da6..26c187d20d97 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c @@ -216,18 +216,16 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev) return 0; } -static int snd_dw_hdmi_remove(struct platform_device *pdev) +static void snd_dw_hdmi_remove(struct platform_device *pdev) { struct platform_device *platform = dev_get_drvdata(&pdev->dev); platform_device_unregister(platform); - - return 0; } static struct platform_driver snd_dw_hdmi_driver = { .probe = snd_dw_hdmi_probe, - .remove = snd_dw_hdmi_remove, + .remove_new = snd_dw_hdmi_remove, .driver = { .name = DRIVER_NAME, }, From patchwork Sun May 7 16:25: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: 13233807 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 95C26C7EE2D for ; Sun, 7 May 2023 16:27:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 05B8C10E284; Sun, 7 May 2023 16:26:59 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F5E210E23B for ; Sun, 7 May 2023 16:26:40 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDS-0001j8-LH; Sun, 07 May 2023 18:26:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDR-001nCJ-Vu; Sun, 07 May 2023 18:26:29 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDR-002Agb-27; Sun, 07 May 2023 18:26:29 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter Subject: [PATCH 15/53] drm/bridge: thc63lvd1024: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:38 +0200 Message-Id: <20230507162616.1368908-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1635; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Ic76M4VTTSlOXuvE6Vhc9SPsqmsW6NQH4QEoa1JX0To=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9D0SqtGxVWorqlYjd93M/u80niW0t0RBjKEE wN0+MRCG7GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ9AAKCRCPgPtYfRL+ TjYyB/9hHoo8r9l0mnwug7Os/lUQISAt6SgqR0cfSnkm0n1jNHOnkJV8kXBWUPXzUxcnzzTVKvl Jz81nHTTG6Txabh2XupdLpRVDT7pF1GartKjIsJvv2aB57SxPjw0cM+FNISIF0zCOr5hIYHL4ml pIJ2zDxIMoLQ61n7E6AtugsUU3I0EpvX0FOy/UQhhYvtVzinwh+yHTAGcbp230gNrwj6W8HYjLc UTtBghTswzTrBib0ktZJtWhrCHofElY1KSzG3LNubdey7W0Jwkp8Sy/ElF9q1V5wZcWBGkEWFXb +QVZ46NxSRQqZG/IQIi5rWCuKVmvk52neqoYZpqhrG8Lp8eV 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org, Laurent Pinchart , Jernej Skrabec , Jonas Karlman Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Laurent Pinchart --- drivers/gpu/drm/bridge/thc63lvd1024.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c index e21078b2f8b5..d4c1a601bbb5 100644 --- a/drivers/gpu/drm/bridge/thc63lvd1024.c +++ b/drivers/gpu/drm/bridge/thc63lvd1024.c @@ -230,13 +230,11 @@ static int thc63_probe(struct platform_device *pdev) return 0; } -static int thc63_remove(struct platform_device *pdev) +static void thc63_remove(struct platform_device *pdev) { struct thc63_dev *thc63 = platform_get_drvdata(pdev); drm_bridge_remove(&thc63->bridge); - - return 0; } static const struct of_device_id thc63_match[] = { @@ -247,7 +245,7 @@ MODULE_DEVICE_TABLE(of, thc63_match); static struct platform_driver thc63_driver = { .probe = thc63_probe, - .remove = thc63_remove, + .remove_new = thc63_remove, .driver = { .name = "thc63lvd1024", .of_match_table = thc63_match, From patchwork Sun May 7 16:25:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13233803 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D75BC7EE2A for ; Sun, 7 May 2023 16:27:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AC03E10E204; Sun, 7 May 2023 16:26:57 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6CE4010E222 for ; Sun, 7 May 2023 16:26:40 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDS-0001jG-Mt; Sun, 07 May 2023 18:26:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDS-001nCM-2H; Sun, 07 May 2023 18:26:30 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDR-002Agf-AC; Sun, 07 May 2023 18:26:29 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter Subject: [PATCH 16/53] drm/bridge: tfp410: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:39 +0200 Message-Id: <20230507162616.1368908-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1598; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Kb/3WrDogc45V9gw8JVjdCX72OlQk/IE4c2ji/cx3cM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9D2tcXXohgxolypRvofhfo8K8cRhAMavqh24 aNb4TN9V1uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ9gAKCRCPgPtYfRL+ TkrUCACipgxBVnCcjgpMXENuhSfPx8vrLllFPc5pCC/xEFyryUi3naHZm6KBR14UOpSGNTHsAJV JxpbXQy5D3HSZLWL2nZvjgG54NPYHJz9N5K38AInVHNP8gNjqGnuND4tUiCJBXxLejiicp8mCSB ys8eHf56T4DesSYDS4sfa7tJAikXom5prPtE/v+nUuIMfUHKhGrCUmq8yAaTaeECwlFstbsnd0Q muoMvLsqjmgun6SYEaIoUgQKbv9vNliLSCZX2yrbFSIfFUgxBGGnhwTl4n+0idtzlayEls2HKyA W1m3HcUFyYGokHX8rOPmdKR5Ar4tfCJZV3Ul/uOqxRqq9Wk3 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org, Laurent Pinchart , Jernej Skrabec , Jonas Karlman Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Laurent Pinchart --- drivers/gpu/drm/bridge/ti-tfp410.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index 6db69df0e18b..ab63225cd635 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -355,11 +355,9 @@ static int tfp410_probe(struct platform_device *pdev) return tfp410_init(&pdev->dev, false); } -static int tfp410_remove(struct platform_device *pdev) +static void tfp410_remove(struct platform_device *pdev) { tfp410_fini(&pdev->dev); - - return 0; } static const struct of_device_id tfp410_match[] = { @@ -370,7 +368,7 @@ MODULE_DEVICE_TABLE(of, tfp410_match); static struct platform_driver tfp410_platform_driver = { .probe = tfp410_probe, - .remove = tfp410_remove, + .remove_new = tfp410_remove, .driver = { .name = "tfp410-bridge", .of_match_table = tfp410_match, From patchwork Sun May 7 16:25:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13233791 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18BBAC77B7C for ; Sun, 7 May 2023 16:27:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4E60510E245; Sun, 7 May 2023 16:26:41 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7ED7910E221 for ; Sun, 7 May 2023 16:26:37 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDS-0001kG-Se; Sun, 07 May 2023 18:26:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDS-001nCQ-8m; Sun, 07 May 2023 18:26:30 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDR-002Agi-JH; Sun, 07 May 2023 18:26:29 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Lucas Stach , David Airlie , Daniel Vetter Subject: [PATCH 17/53] drm/etnaviv: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:40 +0200 Message-Id: <20230507162616.1368908-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2546; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=LGWRACpyXOQNyHkdacYcXEPxMrPtXUYIVDimy4ZnAMQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9D3ZE3TDbK2iwkNWfrp21JRUdMH1kusifiOC jAwa5djrkyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ9wAKCRCPgPtYfRL+ TsjvB/0XKCq+uqfNqVwAyaJu6A7dx1wg2qP4JIBqXmfaZIDE4bHAx4/AQhCQ8tnuCk1EpmhUqJ9 WBKpUDwjngWZwNXgZK7/v5a3Crw7xPrlveTcO5tn0TdMRayRQBK61X+kOApUW35ac1kGdzQ62Z1 WN70Qb+HxLaygixS01cGi/g3R1RKadhnm6tDoyqmOajRayudFS1z7JczjUI/zlLYt+3vGu3SAxR BGQZhV75HNfXTkZ1MfdIA5GRKjPUbCtyw+lHIi2r6J75UwaAanf3igJtsywb4sGQNXwlKxZfEq/ WMW6TpyAIYnJukja9x/lL058Y3p8V2323bhDehZhTKqRHzsC 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Russell King Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the etnaviv drm driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 6 ++---- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index 31a7f59ccb49..071254653cf3 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -641,16 +641,14 @@ static int etnaviv_pdev_probe(struct platform_device *pdev) return component_master_add_with_match(dev, &etnaviv_master_ops, match); } -static int etnaviv_pdev_remove(struct platform_device *pdev) +static void etnaviv_pdev_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &etnaviv_master_ops); - - return 0; } static struct platform_driver etnaviv_platform_driver = { .probe = etnaviv_pdev_probe, - .remove = etnaviv_pdev_remove, + .remove_new = etnaviv_pdev_remove, .driver = { .name = "etnaviv", }, diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index de8c9894967c..52ab18a30b85 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1892,11 +1892,10 @@ static int etnaviv_gpu_platform_probe(struct platform_device *pdev) return 0; } -static int etnaviv_gpu_platform_remove(struct platform_device *pdev) +static void etnaviv_gpu_platform_remove(struct platform_device *pdev) { component_del(&pdev->dev, &gpu_ops); pm_runtime_disable(&pdev->dev); - return 0; } static int etnaviv_gpu_rpm_suspend(struct device *dev) @@ -1954,6 +1953,6 @@ struct platform_driver etnaviv_gpu_driver = { .of_match_table = etnaviv_gpu_match, }, .probe = etnaviv_gpu_platform_probe, - .remove = etnaviv_gpu_platform_remove, + .remove_new = etnaviv_gpu_platform_remove, .id_table = gpu_ids, }; From patchwork Sun May 7 16:25: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: 13233829 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97623C77B7C for ; Sun, 7 May 2023 16:27:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2316910E2B0; Sun, 7 May 2023 16:27:22 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id AD64710E236 for ; Sun, 7 May 2023 16:26:41 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDT-0001lX-Bq; Sun, 07 May 2023 18:26:31 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDS-001nCW-Ni; Sun, 07 May 2023 18:26:30 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDR-002Agm-SY; Sun, 07 May 2023 18:26:29 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Inki Dae , Seung-Woo Kim , Kyungmin Park , David Airlie , Daniel Vetter , Krzysztof Kozlowski , Jingoo Han Subject: [PATCH 18/53] drm/exynos: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:41 +0200 Message-Id: <20230507162616.1368908-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=14943; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=48T/hZEMBFXQAHiD2tnn9j2cQ68jelXTorg6bfIYt/w=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9D4b3MgJ8vJ304kuGToZkcRLVsuYl2yMW3g4 iyMVjUzKbCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ+AAKCRCPgPtYfRL+ TgYnB/94s8OBAIZSNFYoWHvDf+jnTnRTHjVB4LfRTiwTaA9gT6LhYNCJ2Db1kmNWUjrzigFgCKS kjgwxJKTOFz8ysvieRxIpyJfYWsnA3Jsz6bR0d3LhHQAQYewOmN22UZrA3RxxNbWwuR9mHxGBp/ EGY1pr9bm8Dx6b2bgSfxSFDVXSrQaI5rPAlzyUtKXnVZnQsiHKboRxJt5LFvX5n+/Jw4AeQaBvR kpQuxjywsxpDBKLiqW5vxWmT6+0A/I9e+JPVxyCmioSohd0xQRnRP2odYVaFOSkRPK9HonIwHab Vw3SXcSctf8kRi7RDeOOXVUBr5vT9RiSMFFOsuBKwVQysPVK 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, Alim Akhtar Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the exynos drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 6 ++---- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 6 ++---- drivers/gpu/drm/exynos/exynos_dp.c | 6 ++---- drivers/gpu/drm/exynos/exynos_drm_drv.c | 5 ++--- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 6 ++---- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 6 ++---- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 6 ++---- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 6 ++---- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 6 ++---- drivers/gpu/drm/exynos/exynos_drm_mic.c | 6 ++---- drivers/gpu/drm/exynos/exynos_drm_rotator.c | 6 ++---- drivers/gpu/drm/exynos/exynos_drm_scaler.c | 6 ++---- drivers/gpu/drm/exynos/exynos_hdmi.c | 6 ++---- drivers/gpu/drm/exynos/exynos_mixer.c | 6 ++---- 14 files changed, 28 insertions(+), 55 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index 2867b39fa35e..dd63418a9fd2 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c @@ -862,18 +862,16 @@ static int exynos5433_decon_probe(struct platform_device *pdev) return ret; } -static int exynos5433_decon_remove(struct platform_device *pdev) +static void exynos5433_decon_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); component_del(&pdev->dev, &decon_component_ops); - - return 0; } struct platform_driver exynos5433_decon_driver = { .probe = exynos5433_decon_probe, - .remove = exynos5433_decon_remove, + .remove_new = exynos5433_decon_remove, .driver = { .name = "exynos5433-decon", .pm = pm_ptr(&exynos5433_decon_pm_ops), diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c index 3126f735dedc..6fca23e04285 100644 --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c @@ -766,7 +766,7 @@ static int decon_probe(struct platform_device *pdev) return ret; } -static int decon_remove(struct platform_device *pdev) +static void decon_remove(struct platform_device *pdev) { struct decon_context *ctx = dev_get_drvdata(&pdev->dev); @@ -775,8 +775,6 @@ static int decon_remove(struct platform_device *pdev) iounmap(ctx->regs); component_del(&pdev->dev, &decon_component_ops); - - return 0; } static int exynos7_decon_suspend(struct device *dev) @@ -841,7 +839,7 @@ static DEFINE_RUNTIME_DEV_PM_OPS(exynos7_decon_pm_ops, exynos7_decon_suspend, struct platform_driver decon_driver = { .probe = decon_probe, - .remove = decon_remove, + .remove_new = decon_remove, .driver = { .name = "exynos-decon", .pm = pm_ptr(&exynos7_decon_pm_ops), diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c index 3404ec1367fb..ca31bad6c576 100644 --- a/drivers/gpu/drm/exynos/exynos_dp.c +++ b/drivers/gpu/drm/exynos/exynos_dp.c @@ -250,14 +250,12 @@ static int exynos_dp_probe(struct platform_device *pdev) return component_add(&pdev->dev, &exynos_dp_ops); } -static int exynos_dp_remove(struct platform_device *pdev) +static void exynos_dp_remove(struct platform_device *pdev) { struct exynos_dp_device *dp = platform_get_drvdata(pdev); component_del(&pdev->dev, &exynos_dp_ops); analogix_dp_remove(dp->adp); - - return 0; } static int exynos_dp_suspend(struct device *dev) @@ -285,7 +283,7 @@ MODULE_DEVICE_TABLE(of, exynos_dp_match); struct platform_driver dp_driver = { .probe = exynos_dp_probe, - .remove = exynos_dp_remove, + .remove_new = exynos_dp_remove, .driver = { .name = "exynos-dp", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 16c539657f73..67f2e68d6e3a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -354,15 +354,14 @@ static int exynos_drm_platform_probe(struct platform_device *pdev) match); } -static int exynos_drm_platform_remove(struct platform_device *pdev) +static void exynos_drm_platform_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &exynos_drm_ops); - return 0; } static struct platform_driver exynos_drm_platform_driver = { .probe = exynos_drm_platform_probe, - .remove = exynos_drm_platform_remove, + .remove_new = exynos_drm_platform_remove, .driver = { .name = "exynos-drm", .pm = &exynos_drm_pm_ops, diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 06d6513ddaae..96aa98945f18 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1744,13 +1744,11 @@ static int exynos_dsi_probe(struct platform_device *pdev) return ret; } -static int exynos_dsi_remove(struct platform_device *pdev) +static void exynos_dsi_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); component_del(&pdev->dev, &exynos_dsi_component_ops); - - return 0; } static int __maybe_unused exynos_dsi_suspend(struct device *dev) @@ -1825,7 +1823,7 @@ static const struct dev_pm_ops exynos_dsi_pm_ops = { struct platform_driver dsi_driver = { .probe = exynos_dsi_probe, - .remove = exynos_dsi_remove, + .remove_new = exynos_dsi_remove, .driver = { .name = "exynos-dsi", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 8de2714599fc..e81a576de398 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1367,7 +1367,7 @@ static int fimc_probe(struct platform_device *pdev) return ret; } -static int fimc_remove(struct platform_device *pdev) +static void fimc_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct fimc_context *ctx = get_fimc_context(dev); @@ -1377,8 +1377,6 @@ static int fimc_remove(struct platform_device *pdev) pm_runtime_disable(dev); fimc_put_clocks(ctx); - - return 0; } static int fimc_runtime_suspend(struct device *dev) @@ -1410,7 +1408,7 @@ MODULE_DEVICE_TABLE(of, fimc_of_match); struct platform_driver fimc_driver = { .probe = fimc_probe, - .remove = fimc_remove, + .remove_new = fimc_remove, .driver = { .of_match_table = fimc_of_match, .name = "exynos-drm-fimc", diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 7f4a0be03dd1..cab64bc2b332 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -1278,13 +1278,11 @@ static int fimd_probe(struct platform_device *pdev) return ret; } -static int fimd_remove(struct platform_device *pdev) +static void fimd_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); component_del(&pdev->dev, &fimd_component_ops); - - return 0; } static int exynos_fimd_suspend(struct device *dev) @@ -1326,7 +1324,7 @@ static DEFINE_RUNTIME_DEV_PM_OPS(exynos_fimd_pm_ops, exynos_fimd_suspend, struct platform_driver fimd_driver = { .probe = fimd_probe, - .remove = fimd_remove, + .remove_new = fimd_remove, .driver = { .name = "exynos4-fb", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index ec784e58da5c..1f327b06645c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -1530,7 +1530,7 @@ static int g2d_probe(struct platform_device *pdev) return ret; } -static int g2d_remove(struct platform_device *pdev) +static void g2d_remove(struct platform_device *pdev) { struct g2d_data *g2d = platform_get_drvdata(pdev); @@ -1545,8 +1545,6 @@ static int g2d_remove(struct platform_device *pdev) g2d_fini_cmdlist(g2d); destroy_workqueue(g2d->g2d_workq); kmem_cache_destroy(g2d->runqueue_slab); - - return 0; } static int g2d_suspend(struct device *dev) @@ -1609,7 +1607,7 @@ MODULE_DEVICE_TABLE(of, exynos_g2d_match); struct platform_driver g2d_driver = { .probe = g2d_probe, - .remove = g2d_remove, + .remove_new = g2d_remove, .driver = { .name = "exynos-drm-g2d", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 964dceb28c1e..f9cf4461036c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1308,15 +1308,13 @@ static int gsc_probe(struct platform_device *pdev) return ret; } -static int gsc_remove(struct platform_device *pdev) +static void gsc_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; component_del(dev, &gsc_component_ops); pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); - - return 0; } static int __maybe_unused gsc_runtime_suspend(struct device *dev) @@ -1421,7 +1419,7 @@ MODULE_DEVICE_TABLE(of, exynos_drm_gsc_of_match); struct platform_driver gsc_driver = { .probe = gsc_probe, - .remove = gsc_remove, + .remove_new = gsc_remove, .driver = { .name = "exynos-drm-gsc", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c index 17bab5b1663f..e2920960180f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_mic.c +++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c @@ -442,7 +442,7 @@ static int exynos_mic_probe(struct platform_device *pdev) return ret; } -static int exynos_mic_remove(struct platform_device *pdev) +static void exynos_mic_remove(struct platform_device *pdev) { struct exynos_mic *mic = platform_get_drvdata(pdev); @@ -450,8 +450,6 @@ static int exynos_mic_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); drm_bridge_remove(&mic->bridge); - - return 0; } static const struct of_device_id exynos_mic_of_match[] = { @@ -462,7 +460,7 @@ MODULE_DEVICE_TABLE(of, exynos_mic_of_match); struct platform_driver mic_driver = { .probe = exynos_mic_probe, - .remove = exynos_mic_remove, + .remove_new = exynos_mic_remove, .driver = { .name = "exynos-mic", .pm = pm_ptr(&exynos_mic_pm_ops), diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 8706f377c349..797424a5d83b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -329,15 +329,13 @@ static int rotator_probe(struct platform_device *pdev) return ret; } -static int rotator_remove(struct platform_device *pdev) +static void rotator_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; component_del(dev, &rotator_component_ops); pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); - - return 0; } static int rotator_runtime_suspend(struct device *dev) @@ -453,7 +451,7 @@ static DEFINE_RUNTIME_DEV_PM_OPS(rotator_pm_ops, rotator_runtime_suspend, struct platform_driver rotator_driver = { .probe = rotator_probe, - .remove = rotator_remove, + .remove_new = rotator_remove, .driver = { .name = "exynos-rotator", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c index 20608e9780ce..b5cbb864c0c8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c @@ -539,15 +539,13 @@ static int scaler_probe(struct platform_device *pdev) return ret; } -static int scaler_remove(struct platform_device *pdev) +static void scaler_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; component_del(dev, &scaler_component_ops); pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); - - return 0; } static int clk_disable_unprepare_wrapper(struct clk *clk) @@ -721,7 +719,7 @@ MODULE_DEVICE_TABLE(of, exynos_scaler_match); struct platform_driver scaler_driver = { .probe = scaler_probe, - .remove = scaler_remove, + .remove_new = scaler_remove, .driver = { .name = "exynos-scaler", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index b7c11bdce2c8..b03cc88f873b 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -2067,7 +2067,7 @@ static int hdmi_probe(struct platform_device *pdev) return ret; } -static int hdmi_remove(struct platform_device *pdev) +static void hdmi_remove(struct platform_device *pdev) { struct hdmi_context *hdata = platform_get_drvdata(pdev); @@ -2090,8 +2090,6 @@ static int hdmi_remove(struct platform_device *pdev) put_device(&hdata->ddc_adpt->dev); mutex_destroy(&hdata->mutex); - - return 0; } static int __maybe_unused exynos_hdmi_suspend(struct device *dev) @@ -2123,7 +2121,7 @@ static const struct dev_pm_ops exynos_hdmi_pm_ops = { struct platform_driver hdmi_driver = { .probe = hdmi_probe, - .remove = hdmi_remove, + .remove_new = hdmi_remove, .driver = { .name = "exynos-hdmi", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 8d333db813b7..9aaf62c85cff 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -1259,13 +1259,11 @@ static int mixer_probe(struct platform_device *pdev) return ret; } -static int mixer_remove(struct platform_device *pdev) +static void mixer_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); component_del(&pdev->dev, &mixer_component_ops); - - return 0; } static int __maybe_unused exynos_mixer_suspend(struct device *dev) @@ -1339,5 +1337,5 @@ struct platform_driver mixer_driver = { .of_match_table = mixer_match_types, }, .probe = mixer_probe, - .remove = mixer_remove, + .remove_new = mixer_remove, }; From patchwork Sun May 7 16:25:42 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: 13233786 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18DBFC77B75 for ; Sun, 7 May 2023 16:26:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1332210E1FF; Sun, 7 May 2023 16:26:37 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id B3B1710E1D9 for ; Sun, 7 May 2023 16:26:35 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDT-0001li-Ns; Sun, 07 May 2023 18:26:31 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDS-001nCb-RV; Sun, 07 May 2023 18:26:30 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDS-002Agq-4e; Sun, 07 May 2023 18:26:30 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Stefan Agner , Alison Wang , David Airlie , Daniel Vetter Subject: [PATCH 19/53] drm/fsl-dcu: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:42 +0200 Message-Id: <20230507162616.1368908-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1747; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=CzWRQlFRXvdkeV3ss06LaVEr5UYl3veXf4uwAJ0mK38=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9D593nUTIJqc7iVjuvQkupPVfWpZ+q9MDVws W+j6thrNP2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ+QAKCRCPgPtYfRL+ TiD6CACt3iEgttlT5lyoMibtEjyNlv1hlpIfQxB5HlcbWd+RnZ15jMT7/K74kvZI1CE3HbHnYLw G6bx5lsRdZNDzEA3waow87QDY3QWmiLagZ0KiqZGLgody8gzVy/9SSvE99KnQIj9tmnMVUUYIwR UYaD0rylkVB7jFvvZIEMIc1lZMQtE0p26How2bdErSGztsuhMC/y5gvT1WPyBJC++rEFnmJjsKU VjLLrwqSVDO9SF3CH6m3GT5l8VRlga3lPDnGGAHJzUXNABAAAqz7gL2GEiWmxh6gpgvNfsTdORz 9+FAEcs15yTEf8xhKr6ieiDaPpYjCbGQWm5NckkR89VH7V7c 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index 8579c7629f5e..532c326b4ec9 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -346,7 +346,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev) return ret; } -static int fsl_dcu_drm_remove(struct platform_device *pdev) +static void fsl_dcu_drm_remove(struct platform_device *pdev) { struct fsl_dcu_drm_device *fsl_dev = platform_get_drvdata(pdev); @@ -354,13 +354,11 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev) drm_dev_put(fsl_dev->drm); clk_disable_unprepare(fsl_dev->clk); clk_unregister(fsl_dev->pix_clk); - - return 0; } static struct platform_driver fsl_dcu_drm_platform_driver = { .probe = fsl_dcu_drm_probe, - .remove = fsl_dcu_drm_remove, + .remove_new = fsl_dcu_drm_remove, .driver = { .name = "fsl-dcu", .pm = &fsl_dcu_drm_pm_ops, From patchwork Sun May 7 16:25:43 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: 13233823 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2911C7EE24 for ; Sun, 7 May 2023 16:27:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 45F1410E2AE; Sun, 7 May 2023 16:27:17 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0347B10E270 for ; Sun, 7 May 2023 16:27:05 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDU-0001mJ-H8; Sun, 07 May 2023 18:26:32 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDT-001nCj-AH; Sun, 07 May 2023 18:26:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDS-002Agv-Ce; Sun, 07 May 2023 18:26:30 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Xinliang Liu , Tian Tao , David Airlie , Daniel Vetter , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Jani Nikula , Sam Ravnborg , Thomas Zimmermann , Danilo Krummrich , Laurent Pinchart , Javier Martinez Canillas Subject: [PATCH 20/53] drm/hisilicon: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:43 +0200 Message-Id: <20230507162616.1368908-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2801; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=G2D/zW973Dz0Uv4IgMR8LfVcWS2oJpaIAvmMNkWr2FU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9D7nNQrWnX6ghtuLmlpCU8NEubvwcyw6+HeB 1OfHdilkr6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ+wAKCRCPgPtYfRL+ TjgTCACBDOvWtOKod1nXllG0ATxBH5QhvA9M4VbBvQv+FbEFQzfTDet4lNI+qYutnABFK0YxSvb AKckQfTuRaM2fTzTxKTkVujpSkyZv1PekIZJjdQhQSPWppjQn+1a2wdwtD2YTr3CM/57OjrYQMe PAE1IGpeakO5PB3WOobwPL4ZPv+HLHAuvGYBSJ98dJ1tAlnYgqHNiClBcBOl3UNZR2lGJ6M9/vN l4JDq9sBCl+gweyueAJ5IeKO0PCsytstWkS9etjpGiC86V3LTAllEpqD0d6zuiMEOgTVeFg7QZn UCRE7byI0uFSwXd9/4v/nYOsd2jvdo2hjmBnk1wSBZdQRv/H 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, Xinwei Kong , John Stultz , kernel@pengutronix.de, Yongqin Liu , Sumit Semwal Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the hisilicon drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 6 ++---- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c index d9978b79828c..566de4658719 100644 --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c @@ -874,14 +874,12 @@ static int dsi_probe(struct platform_device *pdev) return 0; } -static int dsi_remove(struct platform_device *pdev) +static void dsi_remove(struct platform_device *pdev) { struct dsi_data *data = platform_get_drvdata(pdev); struct dw_dsi *dsi = &data->dsi; mipi_dsi_host_unregister(&dsi->host); - - return 0; } static const struct of_device_id dsi_of_match[] = { @@ -892,7 +890,7 @@ MODULE_DEVICE_TABLE(of, dsi_of_match); static struct platform_driver dsi_driver = { .probe = dsi_probe, - .remove = dsi_remove, + .remove_new = dsi_remove, .driver = { .name = "dw-dsi", .of_match_table = dsi_of_match, diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index 9c5d49bf40c9..bc2948500311 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -279,10 +279,9 @@ static int kirin_drm_platform_probe(struct platform_device *pdev) return component_master_add_with_match(dev, &kirin_drm_ops, match); } -static int kirin_drm_platform_remove(struct platform_device *pdev) +static void kirin_drm_platform_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &kirin_drm_ops); - return 0; } static const struct of_device_id kirin_drm_dt_ids[] = { @@ -295,7 +294,7 @@ MODULE_DEVICE_TABLE(of, kirin_drm_dt_ids); static struct platform_driver kirin_drm_platform_driver = { .probe = kirin_drm_platform_probe, - .remove = kirin_drm_platform_remove, + .remove_new = kirin_drm_platform_remove, .driver = { .name = "kirin-drm", .of_match_table = kirin_drm_dt_ids, From patchwork Sun May 7 16:25: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: 13233813 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED842C77B75 for ; Sun, 7 May 2023 16:27:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 98C4C10E275; Sun, 7 May 2023 16:27:12 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1270410E236 for ; Sun, 7 May 2023 16:26:40 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDV-0001s8-Tn; Sun, 07 May 2023 18:26:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDU-001nD1-DM; Sun, 07 May 2023 18:26:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDS-002Agy-Lf; Sun, 07 May 2023 18:26:30 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laurentiu Palcu , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer Subject: [PATCH 21/53] drm/imx/dcss: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:44 +0200 Message-Id: <20230507162616.1368908-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1795; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=8QCnUZlvXPTd47a8W8x+3k75pn2h7bblLfemtxDr4sc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9D8NLTLML+jR52jrQgBCDWZdlqjokiu8FizP 6XBcumWWI+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ/AAKCRCPgPtYfRL+ Tq0YB/9T7wpxwOmq2Lm/xHfQqGhIC6jN3pD6Pp+qUHl44kQf5UYA0IAjnqr2Vmz2hvaY4EvJ/H7 MATIikJHqX8MlQ+S+QckLmVZsS4FpddbVEN7IPhyAvi78HCOG8h1cbAFfPOnri4ylvHV7FUp/o1 H/G0UHjTIYj3lm/JE8MB3BE4touviAgXBb9edPhKmZCVZJsV/5QURL7z5skF8BSpkvryUuapjcI Fb9rEyC/ja3HqZ7jbCkdTDSV62gezTH/iE/GmxCtkxMjQortiaI/S4ezjGPSe6L4zJ1rgBmXsGS Dpod/0JXL0vFOLRB86+2DXRSridVIhV0UDevfEfqKLM/ibMH 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, NXP Linux Team , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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/gpu/drm/imx/dcss/dcss-drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/imx/dcss/dcss-drv.c b/drivers/gpu/drm/imx/dcss/dcss-drv.c index 4f2291610139..3400ec23cae5 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-drv.c +++ b/drivers/gpu/drm/imx/dcss/dcss-drv.c @@ -79,7 +79,7 @@ static int dcss_drv_platform_probe(struct platform_device *pdev) return err; } -static int dcss_drv_platform_remove(struct platform_device *pdev) +static void dcss_drv_platform_remove(struct platform_device *pdev) { struct dcss_drv *mdrv = dev_get_drvdata(&pdev->dev); @@ -87,8 +87,6 @@ static int dcss_drv_platform_remove(struct platform_device *pdev) dcss_dev_destroy(mdrv->dcss); kfree(mdrv); - - return 0; } static struct dcss_type_data dcss_types[] = { @@ -112,7 +110,7 @@ MODULE_DEVICE_TABLE(of, dcss_of_match); static struct platform_driver dcss_platform_driver = { .probe = dcss_drv_platform_probe, - .remove = dcss_drv_platform_remove, + .remove_new = dcss_drv_platform_remove, .driver = { .name = "imx-dcss", .of_match_table = dcss_of_match, From patchwork Sun May 7 16:25:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13233812 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EFB17C77B7C for ; Sun, 7 May 2023 16:27:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 05A1010E2A3; Sun, 7 May 2023 16:27:01 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 55C7C10E22E for ; Sun, 7 May 2023 16:26:39 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDU-0001pK-Up; Sun, 07 May 2023 18:26:32 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDT-001nCu-Ua; Sun, 07 May 2023 18:26:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDT-002Ah3-4O; Sun, 07 May 2023 18:26:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Philipp Zabel , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer Subject: [PATCH 22/53] drm/imx/ipuv3: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:45 +0200 Message-Id: <20230507162616.1368908-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6235; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OwGdtbofn72q3ITC18weA/3SXerFfQZdKPm7KU8LNrg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9D9I82qryai/MO8Ks/0Qqqoro0mAAlA4zwP1 C0XW7g+ceyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ/QAKCRCPgPtYfRL+ TiuACAClfR+PuclBM7IL2bCpVLmFIpZ3q4ZhSczbz4OVIPJ1Z0oX3Nfh+Isejp0Mqz8uDaT3AFH 71E6DEdNXQ2Jbvo+mNz1LlrshlAQMi6TWmU3Nqal9ZbzcqKqbVKKJkYMfy1XjXhETocmvrgY+yr ju5TpPCSWlUIawAvlf8EYXJ5YEKyUg47mIj8ztEI+QeOL+mZY8cGWDw8OfomXyh39bewdS47sfd 0yH5imQYTrVC4mK5cSidMMrn/rprJ2kqr0C3mhhsGODy0Y0LCmzcjg4l6bI90wbD7/Fuw74GtVy 5w+o9oOkPZwbFzLzo4Sbu5km0H1UTip6uxbotgCpYsLoQhJv 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, NXP Linux Team , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the ipuv3 imx drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Philipp Zabel --- drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c | 6 ++---- drivers/gpu/drm/imx/ipuv3/imx-drm-core.c | 5 ++--- drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 5 ++--- drivers/gpu/drm/imx/ipuv3/imx-tve.c | 5 ++--- drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c | 5 ++--- drivers/gpu/drm/imx/ipuv3/parallel-display.c | 6 ++---- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c b/drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c index a2277a0d6d06..0006ea52b83c 100644 --- a/drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c +++ b/drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c @@ -255,19 +255,17 @@ static int dw_hdmi_imx_probe(struct platform_device *pdev) return ret; } -static int dw_hdmi_imx_remove(struct platform_device *pdev) +static void dw_hdmi_imx_remove(struct platform_device *pdev) { struct imx_hdmi *hdmi = platform_get_drvdata(pdev); component_del(&pdev->dev, &dw_hdmi_imx_ops); dw_hdmi_remove(hdmi->hdmi); - - return 0; } static struct platform_driver dw_hdmi_imx_platform_driver = { .probe = dw_hdmi_imx_probe, - .remove = dw_hdmi_imx_remove, + .remove_new = dw_hdmi_imx_remove, .driver = { .name = "dwhdmi-imx", .of_match_table = dw_hdmi_imx_dt_ids, diff --git a/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c b/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c index e060fa6cbcb9..b17a9dd42565 100644 --- a/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c +++ b/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c @@ -292,10 +292,9 @@ static int imx_drm_platform_probe(struct platform_device *pdev) return ret; } -static int imx_drm_platform_remove(struct platform_device *pdev) +static void imx_drm_platform_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &imx_drm_ops); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -324,7 +323,7 @@ MODULE_DEVICE_TABLE(of, imx_drm_dt_ids); static struct platform_driver imx_drm_pdrv = { .probe = imx_drm_platform_probe, - .remove = imx_drm_platform_remove, + .remove_new = imx_drm_platform_remove, .driver = { .name = "imx-drm", .pm = &imx_drm_pm_ops, diff --git a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c index c45fc8f4744d..989eca32d325 100644 --- a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c +++ b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c @@ -737,7 +737,7 @@ static int imx_ldb_probe(struct platform_device *pdev) return ret; } -static int imx_ldb_remove(struct platform_device *pdev) +static void imx_ldb_remove(struct platform_device *pdev) { struct imx_ldb *imx_ldb = platform_get_drvdata(pdev); int i; @@ -750,12 +750,11 @@ static int imx_ldb_remove(struct platform_device *pdev) } component_del(&pdev->dev, &imx_ldb_ops); - return 0; } static struct platform_driver imx_ldb_driver = { .probe = imx_ldb_probe, - .remove = imx_ldb_remove, + .remove_new = imx_ldb_remove, .driver = { .of_match_table = imx_ldb_dt_ids, .name = DRIVER_NAME, diff --git a/drivers/gpu/drm/imx/ipuv3/imx-tve.c b/drivers/gpu/drm/imx/ipuv3/imx-tve.c index d6832f506322..b49bddb85535 100644 --- a/drivers/gpu/drm/imx/ipuv3/imx-tve.c +++ b/drivers/gpu/drm/imx/ipuv3/imx-tve.c @@ -645,10 +645,9 @@ static int imx_tve_probe(struct platform_device *pdev) return component_add(dev, &imx_tve_ops); } -static int imx_tve_remove(struct platform_device *pdev) +static void imx_tve_remove(struct platform_device *pdev) { component_del(&pdev->dev, &imx_tve_ops); - return 0; } static const struct of_device_id imx_tve_dt_ids[] = { @@ -659,7 +658,7 @@ MODULE_DEVICE_TABLE(of, imx_tve_dt_ids); static struct platform_driver imx_tve_driver = { .probe = imx_tve_probe, - .remove = imx_tve_remove, + .remove_new = imx_tve_remove, .driver = { .of_match_table = imx_tve_dt_ids, .name = "imx-tve", diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c index 5f26090b0c98..8819e40d5e6e 100644 --- a/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c @@ -441,10 +441,9 @@ static int ipu_drm_probe(struct platform_device *pdev) return component_add(dev, &ipu_crtc_ops); } -static int ipu_drm_remove(struct platform_device *pdev) +static void ipu_drm_remove(struct platform_device *pdev) { component_del(&pdev->dev, &ipu_crtc_ops); - return 0; } struct platform_driver ipu_drm_driver = { @@ -452,5 +451,5 @@ struct platform_driver ipu_drm_driver = { .name = "imx-ipuv3-crtc", }, .probe = ipu_drm_probe, - .remove = ipu_drm_remove, + .remove_new = ipu_drm_remove, }; diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c index 0fa0b590830b..70349739dd89 100644 --- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c +++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c @@ -353,11 +353,9 @@ static int imx_pd_probe(struct platform_device *pdev) return component_add(dev, &imx_pd_ops); } -static int imx_pd_remove(struct platform_device *pdev) +static void imx_pd_remove(struct platform_device *pdev) { component_del(&pdev->dev, &imx_pd_ops); - - return 0; } static const struct of_device_id imx_pd_dt_ids[] = { @@ -368,7 +366,7 @@ MODULE_DEVICE_TABLE(of, imx_pd_dt_ids); static struct platform_driver imx_pd_driver = { .probe = imx_pd_probe, - .remove = imx_pd_remove, + .remove_new = imx_pd_remove, .driver = { .of_match_table = imx_pd_dt_ids, .name = "imx-parallel-display", From patchwork Sun May 7 16:25: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: 13233792 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 83555C77B75 for ; Sun, 7 May 2023 16:27:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E19C10E222; Sun, 7 May 2023 16:26:46 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id D15A310E208 for ; Sun, 7 May 2023 16:26:38 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDV-0001qk-Ln; Sun, 07 May 2023 18:26:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDU-001nCx-4W; Sun, 07 May 2023 18:26:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDT-002Ah6-Cy; Sun, 07 May 2023 18:26:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Cercueil , David Airlie , Daniel Vetter Subject: [PATCH 23/53] drm/ingenic: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:46 +0200 Message-Id: <20230507162616.1368908-24-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2841; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oqJ82rDPbejoSeR+k9lYVin9WuUFH7/jrOhYfGPtgEQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9D+00uZSnldPeVBZqM9VkFLDoFMFwx0/LK01 k+o/x6VZruJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ/gAKCRCPgPtYfRL+ TlOTCACKbM3+tb64WfqgKHt1ysDj82pxM6KwiSjsKq8vRDMZ0KMIlF93UPgj4ISSw+F3n03KBZn VvyaaQAqtEt+JYbzJ1EL0R0kZHyA7Zc2uSO+pWOx2JjiMR0gB71eKOQtwOLBi+x9i1hZqXtqfn7 fsA8fObKAvqDCGGEAgVddRoXOGfH4PcyFwGn90qwTtrFxEmmsE8fJOSUJEjE8DQ+fkzPmqTSHz2 eQQgbx7bzwo/gmMCpbkYBnBw6x+RyH/dh47sAo2wvpj2E2+oE9PrmeV0PgVmjwbKlZjac7CalWg WV/kFAGN8x6jsA45x9MqrCxAS9j6UG/o9CMOPBmOd+dt2jVl 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the ingenic drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Paul Cercueil --- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 6 ++---- drivers/gpu/drm/ingenic/ingenic-ipu.c | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index 5ec75e9ba499..4a22b7465080 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -1449,7 +1449,7 @@ static int ingenic_drm_probe(struct platform_device *pdev) return component_master_add_with_match(dev, &ingenic_master_ops, match); } -static int ingenic_drm_remove(struct platform_device *pdev) +static void ingenic_drm_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1457,8 +1457,6 @@ static int ingenic_drm_remove(struct platform_device *pdev) ingenic_drm_unbind(dev); else component_master_del(dev, &ingenic_master_ops); - - return 0; } static int ingenic_drm_suspend(struct device *dev) @@ -1611,7 +1609,7 @@ static struct platform_driver ingenic_drm_driver = { .of_match_table = of_match_ptr(ingenic_drm_of_match), }, .probe = ingenic_drm_probe, - .remove = ingenic_drm_remove, + .remove_new = ingenic_drm_remove, }; static int ingenic_drm_init(void) diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c b/drivers/gpu/drm/ingenic/ingenic-ipu.c index 7a43505011a5..fc0d8512d217 100644 --- a/drivers/gpu/drm/ingenic/ingenic-ipu.c +++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c @@ -922,10 +922,9 @@ static int ingenic_ipu_probe(struct platform_device *pdev) return component_add(&pdev->dev, &ingenic_ipu_ops); } -static int ingenic_ipu_remove(struct platform_device *pdev) +static void ingenic_ipu_remove(struct platform_device *pdev) { component_del(&pdev->dev, &ingenic_ipu_ops); - return 0; } static const u32 jz4725b_ipu_formats[] = { @@ -992,7 +991,7 @@ static struct platform_driver ingenic_ipu_driver = { .of_match_table = ingenic_ipu_of_match, }, .probe = ingenic_ipu_probe, - .remove = ingenic_ipu_remove, + .remove_new = ingenic_ipu_remove, }; struct platform_driver *ingenic_ipu_driver_ptr = &ingenic_ipu_driver; From patchwork Sun May 7 16:25: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: 13233802 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5DCAC77B7C for ; Sun, 7 May 2023 16:27:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9BA0810E264; Sun, 7 May 2023 16:26:56 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id B2E0010E23B for ; Sun, 7 May 2023 16:26:41 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDW-0001xf-T8; Sun, 07 May 2023 18:26:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDV-001nDB-8G; Sun, 07 May 2023 18:26:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDU-002AhB-1q; Sun, 07 May 2023 18:26:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Anitha Chrisanthus , Edmund Dea , David Airlie , Daniel Vetter Subject: [PATCH 24/53] drm/kmb: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:47 +0200 Message-Id: <20230507162616.1368908-25-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1774; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=LyCIvjeJcsjLg/tES3K2iScK0IA2DVhTNCBbZWMKkds=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9D/P2EkHDKY1ZFZaYZswid1zLhoubqSl1KTN xaPGjq/9ISJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfQ/wAKCRCPgPtYfRL+ TjdCCAC5aAROFMNcCs9/KD2wP8rnv/ofb7nJKMv5jzkHdSfa2ku6n6o27UzaUETFiWNDkzp5n2R +PPL44Sn18/2Krgan2Y0tKJ6btrnMbMZBxAllwsu1z2jmwFBxVLa+pt9FO4tk005iXnyWuNltfZ DM/LTBX7vQtN98RXQdl28bSvhoLtxiCANjGOh12ej4IjLtc6iPxGNUb9tzos7udBSHjKXqevUep lPoXjbNWNdj0pAJQdEp3SFNduWaYrIEsgp4A9LbRCUYGqBZjuo8sNbpntptsb7zTnIQj0JNosbE kXkGAAd/0Fa/2GGp3VPeW9di7By3cBdldAdyqkKLm8ei3K2b 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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/gpu/drm/kmb/kmb_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/kmb/kmb_drv.c b/drivers/gpu/drm/kmb/kmb_drv.c index d29c678f6c91..4b101b9277e1 100644 --- a/drivers/gpu/drm/kmb/kmb_drv.c +++ b/drivers/gpu/drm/kmb/kmb_drv.c @@ -448,7 +448,7 @@ static const struct drm_driver kmb_driver = { .minor = DRIVER_MINOR, }; -static int kmb_remove(struct platform_device *pdev) +static void kmb_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct drm_device *drm = dev_get_drvdata(dev); @@ -473,7 +473,6 @@ static int kmb_remove(struct platform_device *pdev) /* Unregister DSI host */ kmb_dsi_host_unregister(kmb->kmb_dsi); drm_atomic_helper_shutdown(drm); - return 0; } static int kmb_probe(struct platform_device *pdev) @@ -621,7 +620,7 @@ static SIMPLE_DEV_PM_OPS(kmb_pm_ops, kmb_pm_suspend, kmb_pm_resume); static struct platform_driver kmb_platform_driver = { .probe = kmb_probe, - .remove = kmb_remove, + .remove_new = kmb_remove, .driver = { .name = "kmb-drm", .pm = &kmb_pm_ops, From patchwork Sun May 7 16:25: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: 13233790 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D84DC77B75 for ; Sun, 7 May 2023 16:26:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 89F0110E241; Sun, 7 May 2023 16:26:40 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 82F8A10E222 for ; Sun, 7 May 2023 16:26:37 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDW-0001xC-Ki; Sun, 07 May 2023 18:26:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDV-001nD8-5p; Sun, 07 May 2023 18:26:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDU-002AhG-EI; Sun, 07 May 2023 18:26:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Qiang Yu , David Airlie , Daniel Vetter Subject: [PATCH 25/53] drm/lima: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:48 +0200 Message-Id: <20230507162616.1368908-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1766; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OU5nFZW1U8xX89GdpL66XMcT2yhVtZa5NvsVX95pBFo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EBTfSJKMY8B8QbF2127le+WXSjvxK3UQFEj yfNq3oy7CKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRAQAKCRCPgPtYfRL+ TiqeB/0Q+vRB9mbunHmpEQ6VVsVIUIJ/+zOj7HHDJeb7jXx0L7s9sieNP9k7S2lc5EE//o4LSbH 9CdDGPytV8owd/MIhFnlPRcOjsb9MfgymSAq4+Ek1vcD1i5cGyoL+FCSP6E0qgyi9AKIAb8Chzx 0E3gOrJLHVsuJi7mFJj7bHw+hMLDMvpF3YKqH77pPsL9+MQe4mx+TmI8/UgUhXm1dF0a/wxSE7/ KMHCe7m1f/054gFRo52RIZaoGN3DkVTF4lKXjHJh+2HZGdcgzUxza72fPu5abxu1ZowjNbqJepb c/5rzxx8fdDi2i1ZzrEWUxT1UlEXsC1evGfxJ6N+X9mk08sc 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, lima@lists.freedesktop.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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/gpu/drm/lima/lima_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_drv.c b/drivers/gpu/drm/lima/lima_drv.c index 7b8d7178d09a..a272eace8f25 100644 --- a/drivers/gpu/drm/lima/lima_drv.c +++ b/drivers/gpu/drm/lima/lima_drv.c @@ -439,7 +439,7 @@ static int lima_pdev_probe(struct platform_device *pdev) return err; } -static int lima_pdev_remove(struct platform_device *pdev) +static void lima_pdev_remove(struct platform_device *pdev) { struct lima_device *ldev = platform_get_drvdata(pdev); struct drm_device *ddev = ldev->ddev; @@ -457,7 +457,6 @@ static int lima_pdev_remove(struct platform_device *pdev) drm_dev_put(ddev); lima_sched_slab_fini(); - return 0; } static const struct of_device_id dt_match[] = { @@ -474,7 +473,7 @@ static const struct dev_pm_ops lima_pm_ops = { static struct platform_driver lima_platform_driver = { .probe = lima_pdev_probe, - .remove = lima_pdev_remove, + .remove_new = lima_pdev_remove, .driver = { .name = "lima", .pm = &lima_pm_ops, From patchwork Sun May 7 16:25:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13233805 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C58EAC77B7C for ; Sun, 7 May 2023 16:27:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C136E10E26D; Sun, 7 May 2023 16:26:57 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6296310E22E for ; Sun, 7 May 2023 16:26:38 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDX-0001zz-8U; Sun, 07 May 2023 18:26:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDV-001nDJ-P3; Sun, 07 May 2023 18:26:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDU-002AhN-Sk; Sun, 07 May 2023 18:26:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , David Airlie , Daniel Vetter Subject: [PATCH 26/53] drm/logicvc: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:49 +0200 Message-Id: <20230507162616.1368908-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1876; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=gDyK9dCRZKv2ugOYv+9odT8amOlhOfegrOYa7zlRmSs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9ECk/RRbelgk/M4CBC6tKwOWBdRw4Wa818WS o/kqmUFfRqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRAgAKCRCPgPtYfRL+ TgLZB/4hrOerFHu1lphie0c6g88xeD2r5jJ8W8sBhYxzcvXi2RM+IQAQW0m95hN7MvO9fM8lO3m ka1CFQz5mqb9X8H0gn/X/R4aEXRCwWIFLp9hKFdmmnf0E7EkTQY84xG66pPhUjZwY0EL2W9dr9D 5n0twmpiSu0unKCuFBpvd4JMToD9APxALA1ufV8TlR94iaU1uPrGO+J0uK7I/OLibNgEO8hEuAa nrb04mAcVeSZJ08TAZ9svO0vr96MMZMXKjjmr/IKxr7Z/Mwwl9T0eWyCjN/r69tJ6P6Hupw/UHd Pwnw+UmJHU4qjTQEOsVDij9ftiftJzB6Z9EvFNqaXTOZNpzw 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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/gpu/drm/logicvc/logicvc_drm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/logicvc/logicvc_drm.c b/drivers/gpu/drm/logicvc/logicvc_drm.c index 2fb23697740a..b97bc254dbfa 100644 --- a/drivers/gpu/drm/logicvc/logicvc_drm.c +++ b/drivers/gpu/drm/logicvc/logicvc_drm.c @@ -466,7 +466,7 @@ static int logicvc_drm_probe(struct platform_device *pdev) return ret; } -static int logicvc_drm_remove(struct platform_device *pdev) +static void logicvc_drm_remove(struct platform_device *pdev) { struct logicvc_drm *logicvc = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -480,8 +480,6 @@ static int logicvc_drm_remove(struct platform_device *pdev) logicvc_clocks_unprepare(logicvc); of_reserved_mem_device_release(dev); - - return 0; } static const struct of_device_id logicvc_drm_of_table[] = { @@ -493,7 +491,7 @@ MODULE_DEVICE_TABLE(of, logicvc_drm_of_table); static struct platform_driver logicvc_drm_platform_driver = { .probe = logicvc_drm_probe, - .remove = logicvc_drm_remove, + .remove_new = logicvc_drm_remove, .driver = { .name = "logicvc-drm", .of_match_table = logicvc_drm_of_table, From patchwork Sun May 7 16:25: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: 13233796 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2EAC5C77B7C for ; Sun, 7 May 2023 16:27:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 577E510E252; Sun, 7 May 2023 16:26:48 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3ECCA10E222 for ; Sun, 7 May 2023 16:26:38 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDX-0001zk-4L; Sun, 07 May 2023 18:26:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDV-001nDG-MD; Sun, 07 May 2023 18:26:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDV-002AhQ-2P; Sun, 07 May 2023 18:26:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , David Airlie , Daniel Vetter Subject: [PATCH 27/53] drm/mcde: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:50 +0200 Message-Id: <20230507162616.1368908-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2751; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=glMqUiPXRKhwzmEGMHZYlIT1zk+1agyjZyutvvTSAVI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EDiw6RSRoAQS4Oy8Ou8jEyPh/7AYPwk12ZG MmdeYe0fd6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRAwAKCRCPgPtYfRL+ Tj2BCACF5c6XZZEqhdkMfsHD44d8Fu3ah9J2f+rTXs3jXNat5loGDsmntb0BU013t4H6vzE9qz/ Xis8V4mCNNlzR4a7M/1EXlJZPIaVc8zw0dj2jIzd+Gh6iJ6o+URcreBWj3q2LtJ2GLoADW1R3/N EYU7/8bJxy8y7uaSnz7SGAtMveOQ+rUQu8bAtsQTzxV3DMsgfpi99sWzb3EsR04yCaUWGeLGZmM cQSh2/0NVioFF+mEHf/Dh1Ra42PGJnZta4cVf8RlPe+FnACGZc7miVc1VjAlOMC4NvFmTy+8AXX Ofiz6ijUkGEDX46e4GAEh5wu+LjfLfm5Zy5vE4Tl0iMxeAUG 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the mcde drm driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Linus Walleij --- drivers/gpu/drm/mcde/mcde_drv.c | 6 ++---- drivers/gpu/drm/mcde/mcde_dsi.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c index 4aedb050d2a5..458672d0fb7a 100644 --- a/drivers/gpu/drm/mcde/mcde_drv.c +++ b/drivers/gpu/drm/mcde/mcde_drv.c @@ -448,7 +448,7 @@ static int mcde_probe(struct platform_device *pdev) } -static int mcde_remove(struct platform_device *pdev) +static void mcde_remove(struct platform_device *pdev) { struct drm_device *drm = platform_get_drvdata(pdev); struct mcde *mcde = to_mcde(drm); @@ -457,8 +457,6 @@ static int mcde_remove(struct platform_device *pdev) clk_disable_unprepare(mcde->mcde_clk); regulator_disable(mcde->vana); regulator_disable(mcde->epod); - - return 0; } static const struct of_device_id mcde_of_match[] = { @@ -474,7 +472,7 @@ static struct platform_driver mcde_driver = { .of_match_table = of_match_ptr(mcde_of_match), }, .probe = mcde_probe, - .remove = mcde_remove, + .remove_new = mcde_remove, }; static struct platform_driver *const component_drivers[] = { diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index 9f9ac8699310..db82b38600b2 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -1208,14 +1208,12 @@ static int mcde_dsi_probe(struct platform_device *pdev) return component_add(dev, &mcde_dsi_component_ops); } -static int mcde_dsi_remove(struct platform_device *pdev) +static void mcde_dsi_remove(struct platform_device *pdev) { struct mcde_dsi *d = platform_get_drvdata(pdev); component_del(&pdev->dev, &mcde_dsi_component_ops); mipi_dsi_host_unregister(&d->dsi_host); - - return 0; } static const struct of_device_id mcde_dsi_of_match[] = { @@ -1231,5 +1229,5 @@ struct platform_driver mcde_dsi_driver = { .of_match_table = of_match_ptr(mcde_dsi_of_match), }, .probe = mcde_dsi_probe, - .remove = mcde_dsi_remove, + .remove_new = mcde_dsi_remove, }; From patchwork Sun May 7 16:25:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13233794 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81FB1C77B7C for ; Sun, 7 May 2023 16:27:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C762210E23B; Sun, 7 May 2023 16:26:47 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8D8ED10E245 for ; Sun, 7 May 2023 16:26:40 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDX-00020X-8y; Sun, 07 May 2023 18:26:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDV-001nDO-V0; Sun, 07 May 2023 18:26:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDV-002AhU-AA; Sun, 07 May 2023 18:26:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger Subject: [PATCH 28/53] drm/mediatek: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:51 +0200 Message-Id: <20230507162616.1368908-29-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1660; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=prZqrFdxCvTbI4x7dOHdK28JIgaSkJ1VYLZDHRrC16U=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EEWK/WmDsYyD/3xN+xXQG+bjxUxR+WBFuju Ad7JEEcqpaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRBAAKCRCPgPtYfRL+ TkSiB/9GGYKfJFILOekgh04x2byXZ/E2ie7ZdAkC2jOqnARySWmBKMoi3KpUN9L89qGW7K6ZTyB LXB+FXvVmxqtAFf2SmobjSpTtXbGQssX/IFTJ/ghOQjWjBr5rBHZhU8lX5twjDOCIeWl7Xw+P28 I8lYgp4UweLS+ZajeQyMKG7/l9PbdmTc1dpygpvcO6ipOdJA3nqC2MXbBPDUsdFUMzj2ZJ0gfYH GVlPa9vlGGZt9axD5vtmaXzRjwVFV0IYVCR44tZTvjPfnHzeh1T0e5bKZK3OQisibx+RxjwfmLd bFos7s4rJMWt568qw5yI7xx+nYMOwgHyQkQXJ/mMjW/ivEqa 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@pengutronix.de, dri-devel@lists.freedesktop.org, AngeloGioacchino Del Regno Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Matthias Brugger --- drivers/gpu/drm/mediatek/mtk_cec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_cec.c b/drivers/gpu/drm/mediatek/mtk_cec.c index b640bc0559e7..f47f417d8ba6 100644 --- a/drivers/gpu/drm/mediatek/mtk_cec.c +++ b/drivers/gpu/drm/mediatek/mtk_cec.c @@ -235,13 +235,12 @@ static int mtk_cec_probe(struct platform_device *pdev) return 0; } -static int mtk_cec_remove(struct platform_device *pdev) +static void mtk_cec_remove(struct platform_device *pdev) { struct mtk_cec *cec = platform_get_drvdata(pdev); mtk_cec_htplg_irq_disable(cec); clk_disable_unprepare(cec->clk); - return 0; } static const struct of_device_id mtk_cec_of_ids[] = { @@ -252,7 +251,7 @@ MODULE_DEVICE_TABLE(of, mtk_cec_of_ids); struct platform_driver mtk_cec_driver = { .probe = mtk_cec_probe, - .remove = mtk_cec_remove, + .remove_new = mtk_cec_remove, .driver = { .name = "mediatek-cec", .of_match_table = mtk_cec_of_ids, From patchwork Sun May 7 16:25:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13233814 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2348C7EE2A for ; Sun, 7 May 2023 16:27:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E95C410E299; Sun, 7 May 2023 16:27:13 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7482510E236 for ; Sun, 7 May 2023 16:26:40 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDX-00021A-Ho; Sun, 07 May 2023 18:26:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDW-001nDS-66; Sun, 07 May 2023 18:26:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDV-002AhY-JH; Sun, 07 May 2023 18:26:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger Subject: [PATCH 29/53] drm/mediatek: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:52 +0200 Message-Id: <20230507162616.1368908-30-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=15058; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rjK4uqKpKtvyFN1hjCYEzxh7lQT7NdbIECimi9ktnlI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EFUtRSr3jD2XOoi09eDV+eAimjzrwwrZbQA A8LfF+GCImJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRBQAKCRCPgPtYfRL+ TpVdCACr5TBdbHaiTvzj5X0aVb6r4Ja4Gszz+DhRa75Lwfrv8xhHp4ytHvTBkPrwSj92iIeWVxA ayLcsumtdFJKppVTiq6Mw5pWFD0GU0+OQ1Uf6iWk/PdyooHFVtI1h0dbwdcH/MSAVPzGhxUpVh/ 2eRGnPNcaFHeC8V+zGcmjGcLkDqDTyUdrs0IRgO/rl+fY4jcqahS4Y3ryA15CpXnJxpU2Jd02Cc uj9HjTy+aYrkJWrY7cHCvowMFkP0f30tTGE+YEGy3JIqE8v/qV+yNCcpoK4njy5XH2z8NoX4H/S 507P4RITLvChYk0oXD4NwqvbAnN77rSALyMF6VzBdNfPZqSn 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@pengutronix.de, dri-devel@lists.freedesktop.org, AngeloGioacchino Del Regno Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the mediatek drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Matthias Brugger --- drivers/gpu/drm/mediatek/mtk_disp_aal.c | 6 ++---- drivers/gpu/drm/mediatek/mtk_disp_ccorr.c | 6 ++---- drivers/gpu/drm/mediatek/mtk_disp_color.c | 6 ++---- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 6 ++---- drivers/gpu/drm/mediatek/mtk_disp_merge.c | 6 ++---- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 6 ++---- drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 6 ++---- drivers/gpu/drm/mediatek/mtk_dp.c | 6 ++---- drivers/gpu/drm/mediatek/mtk_dpi.c | 6 ++---- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 ++---- drivers/gpu/drm/mediatek/mtk_dsi.c | 6 ++---- drivers/gpu/drm/mediatek/mtk_hdmi.c | 5 ++--- drivers/gpu/drm/mediatek/mtk_hdmi_ddc.c | 6 ++---- drivers/gpu/drm/mediatek/mtk_mdp_rdma.c | 5 ++--- 14 files changed, 28 insertions(+), 54 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_aal.c b/drivers/gpu/drm/mediatek/mtk_disp_aal.c index 434e8a9ce8ab..cbd9b4becc43 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_aal.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_aal.c @@ -140,11 +140,9 @@ static int mtk_disp_aal_probe(struct platform_device *pdev) return ret; } -static int mtk_disp_aal_remove(struct platform_device *pdev) +static void mtk_disp_aal_remove(struct platform_device *pdev) { component_del(&pdev->dev, &mtk_disp_aal_component_ops); - - return 0; } static const struct mtk_disp_aal_data mt8173_aal_driver_data = { @@ -161,7 +159,7 @@ MODULE_DEVICE_TABLE(of, mtk_disp_aal_driver_dt_match); struct platform_driver mtk_disp_aal_driver = { .probe = mtk_disp_aal_probe, - .remove = mtk_disp_aal_remove, + .remove_new = mtk_disp_aal_remove, .driver = { .name = "mediatek-disp-aal", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c b/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c index 1773379b2439..fa6dbc4e9c35 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c @@ -195,11 +195,9 @@ static int mtk_disp_ccorr_probe(struct platform_device *pdev) return ret; } -static int mtk_disp_ccorr_remove(struct platform_device *pdev) +static void mtk_disp_ccorr_remove(struct platform_device *pdev) { component_del(&pdev->dev, &mtk_disp_ccorr_component_ops); - - return 0; } static const struct mtk_disp_ccorr_data mt8183_ccorr_driver_data = { @@ -221,7 +219,7 @@ MODULE_DEVICE_TABLE(of, mtk_disp_ccorr_driver_dt_match); struct platform_driver mtk_disp_ccorr_driver = { .probe = mtk_disp_ccorr_probe, - .remove = mtk_disp_ccorr_remove, + .remove_new = mtk_disp_ccorr_remove, .driver = { .name = "mediatek-disp-ccorr", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/mediatek/mtk_disp_color.c b/drivers/gpu/drm/mediatek/mtk_disp_color.c index cac9206079e7..78e44e6befd6 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_color.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_color.c @@ -132,11 +132,9 @@ static int mtk_disp_color_probe(struct platform_device *pdev) return ret; } -static int mtk_disp_color_remove(struct platform_device *pdev) +static void mtk_disp_color_remove(struct platform_device *pdev) { component_del(&pdev->dev, &mtk_disp_color_component_ops); - - return 0; } static const struct mtk_disp_color_data mt2701_color_driver_data = { @@ -164,7 +162,7 @@ MODULE_DEVICE_TABLE(of, mtk_disp_color_driver_dt_match); struct platform_driver mtk_disp_color_driver = { .probe = mtk_disp_color_probe, - .remove = mtk_disp_color_remove, + .remove_new = mtk_disp_color_remove, .driver = { .name = "mediatek-disp-color", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c index c844942603f7..c5237f4eb7fe 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c @@ -183,11 +183,9 @@ static int mtk_disp_gamma_probe(struct platform_device *pdev) return ret; } -static int mtk_disp_gamma_remove(struct platform_device *pdev) +static void mtk_disp_gamma_remove(struct platform_device *pdev) { component_del(&pdev->dev, &mtk_disp_gamma_component_ops); - - return 0; } static const struct mtk_disp_gamma_data mt8173_gamma_driver_data = { @@ -209,7 +207,7 @@ MODULE_DEVICE_TABLE(of, mtk_disp_gamma_driver_dt_match); struct platform_driver mtk_disp_gamma_driver = { .probe = mtk_disp_gamma_probe, - .remove = mtk_disp_gamma_remove, + .remove_new = mtk_disp_gamma_remove, .driver = { .name = "mediatek-disp-gamma", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/mediatek/mtk_disp_merge.c b/drivers/gpu/drm/mediatek/mtk_disp_merge.c index 6428b6203ffe..fd14a59bc951 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_merge.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_merge.c @@ -295,11 +295,9 @@ static int mtk_disp_merge_probe(struct platform_device *pdev) return ret; } -static int mtk_disp_merge_remove(struct platform_device *pdev) +static void mtk_disp_merge_remove(struct platform_device *pdev) { component_del(&pdev->dev, &mtk_disp_merge_component_ops); - - return 0; } static const struct of_device_id mtk_disp_merge_driver_dt_match[] = { @@ -311,7 +309,7 @@ MODULE_DEVICE_TABLE(of, mtk_disp_merge_driver_dt_match); struct platform_driver mtk_disp_merge_driver = { .probe = mtk_disp_merge_probe, - .remove = mtk_disp_merge_remove, + .remove_new = mtk_disp_merge_remove, .driver = { .name = "mediatek-disp-merge", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index 9d8c986700ee..f90ad9bce028 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c @@ -483,12 +483,10 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev) return ret; } -static int mtk_disp_ovl_remove(struct platform_device *pdev) +static void mtk_disp_ovl_remove(struct platform_device *pdev) { component_del(&pdev->dev, &mtk_disp_ovl_component_ops); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct mtk_disp_ovl_data mt2701_ovl_driver_data = { @@ -565,7 +563,7 @@ MODULE_DEVICE_TABLE(of, mtk_disp_ovl_driver_dt_match); struct platform_driver mtk_disp_ovl_driver = { .probe = mtk_disp_ovl_probe, - .remove = mtk_disp_ovl_remove, + .remove_new = mtk_disp_ovl_remove, .driver = { .name = "mediatek-disp-ovl", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c index a5a0c3bac35d..49149d67bb0e 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c @@ -350,13 +350,11 @@ static int mtk_disp_rdma_probe(struct platform_device *pdev) return ret; } -static int mtk_disp_rdma_remove(struct platform_device *pdev) +static void mtk_disp_rdma_remove(struct platform_device *pdev) { component_del(&pdev->dev, &mtk_disp_rdma_component_ops); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct mtk_disp_rdma_data mt2701_rdma_driver_data = { @@ -390,7 +388,7 @@ MODULE_DEVICE_TABLE(of, mtk_disp_rdma_driver_dt_match); struct platform_driver mtk_disp_rdma_driver = { .probe = mtk_disp_rdma_probe, - .remove = mtk_disp_rdma_remove, + .remove_new = mtk_disp_rdma_remove, .driver = { .name = "mediatek-disp-rdma", .owner = THIS_MODULE, diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index 1f94fcc144d3..6352ee412045 100644 --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -2575,7 +2575,7 @@ static int mtk_dp_probe(struct platform_device *pdev) return 0; } -static int mtk_dp_remove(struct platform_device *pdev) +static void mtk_dp_remove(struct platform_device *pdev) { struct mtk_dp *mtk_dp = platform_get_drvdata(pdev); @@ -2586,8 +2586,6 @@ static int mtk_dp_remove(struct platform_device *pdev) platform_device_unregister(mtk_dp->phy_dev); if (mtk_dp->audio_pdev) platform_device_unregister(mtk_dp->audio_pdev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -2646,7 +2644,7 @@ MODULE_DEVICE_TABLE(of, mtk_dp_of_match); static struct platform_driver mtk_dp_driver = { .probe = mtk_dp_probe, - .remove = mtk_dp_remove, + .remove_new = mtk_dp_remove, .driver = { .name = "mediatek-drm-dp", .of_match_table = mtk_dp_of_match, diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c index 948a53f1f4b3..ed3cbb202b7a 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -1102,14 +1102,12 @@ static int mtk_dpi_probe(struct platform_device *pdev) return 0; } -static int mtk_dpi_remove(struct platform_device *pdev) +static void mtk_dpi_remove(struct platform_device *pdev) { struct mtk_dpi *dpi = platform_get_drvdata(pdev); component_del(&pdev->dev, &mtk_dpi_component_ops); drm_bridge_remove(&dpi->bridge); - - return 0; } static const struct of_device_id mtk_dpi_of_ids[] = { @@ -1140,7 +1138,7 @@ MODULE_DEVICE_TABLE(of, mtk_dpi_of_ids); struct platform_driver mtk_dpi_driver = { .probe = mtk_dpi_probe, - .remove = mtk_dpi_remove, + .remove_new = mtk_dpi_remove, .driver = { .name = "mediatek-dpi", .of_match_table = mtk_dpi_of_ids, diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index a13b36ac03a1..b951ad494f7d 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -826,7 +826,7 @@ static int mtk_drm_probe(struct platform_device *pdev) return ret; } -static int mtk_drm_remove(struct platform_device *pdev) +static void mtk_drm_remove(struct platform_device *pdev) { struct mtk_drm_private *private = platform_get_drvdata(pdev); int i; @@ -836,8 +836,6 @@ static int mtk_drm_remove(struct platform_device *pdev) of_node_put(private->mutex_node); for (i = 0; i < DDP_COMPONENT_ID_MAX; i++) of_node_put(private->comp_node[i]); - - return 0; } static int mtk_drm_sys_prepare(struct device *dev) @@ -866,7 +864,7 @@ static const struct dev_pm_ops mtk_drm_pm_ops = { static struct platform_driver mtk_drm_platform_driver = { .probe = mtk_drm_probe, - .remove = mtk_drm_remove, + .remove_new = mtk_drm_remove, .driver = { .name = "mediatek-drm", .pm = &mtk_drm_pm_ops, diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 7d5250351193..d8bfc2cce54d 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -1178,14 +1178,12 @@ static int mtk_dsi_probe(struct platform_device *pdev) return ret; } -static int mtk_dsi_remove(struct platform_device *pdev) +static void mtk_dsi_remove(struct platform_device *pdev) { struct mtk_dsi *dsi = platform_get_drvdata(pdev); mtk_output_dsi_disable(dsi); mipi_dsi_host_unregister(&dsi->host); - - return 0; } static const struct mtk_dsi_driver_data mt8173_dsi_driver_data = { @@ -1223,7 +1221,7 @@ MODULE_DEVICE_TABLE(of, mtk_dsi_of_match); struct platform_driver mtk_dsi_driver = { .probe = mtk_dsi_probe, - .remove = mtk_dsi_remove, + .remove_new = mtk_dsi_remove, .driver = { .name = "mtk-dsi", .of_match_table = mtk_dsi_of_match, diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index 0a8e0a13f516..86133bf16326 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -1746,13 +1746,12 @@ static int mtk_drm_hdmi_probe(struct platform_device *pdev) return ret; } -static int mtk_drm_hdmi_remove(struct platform_device *pdev) +static void mtk_drm_hdmi_remove(struct platform_device *pdev) { struct mtk_hdmi *hdmi = platform_get_drvdata(pdev); drm_bridge_remove(&hdmi->bridge); mtk_hdmi_clk_disable_audio(hdmi); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1806,7 +1805,7 @@ MODULE_DEVICE_TABLE(of, mtk_drm_hdmi_of_ids); static struct platform_driver mtk_hdmi_driver = { .probe = mtk_drm_hdmi_probe, - .remove = mtk_drm_hdmi_remove, + .remove_new = mtk_drm_hdmi_remove, .driver = { .name = "mediatek-drm-hdmi", .of_match_table = mtk_drm_hdmi_of_ids, diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_ddc.c b/drivers/gpu/drm/mediatek/mtk_hdmi_ddc.c index 2fc9214ffa82..63d3d5ba31f1 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi_ddc.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_ddc.c @@ -324,14 +324,12 @@ static int mtk_hdmi_ddc_probe(struct platform_device *pdev) return ret; } -static int mtk_hdmi_ddc_remove(struct platform_device *pdev) +static void mtk_hdmi_ddc_remove(struct platform_device *pdev) { struct mtk_hdmi_ddc *ddc = platform_get_drvdata(pdev); i2c_del_adapter(&ddc->adap); clk_disable_unprepare(ddc->clk); - - return 0; } static const struct of_device_id mtk_hdmi_ddc_match[] = { @@ -342,7 +340,7 @@ MODULE_DEVICE_TABLE(of, mtk_hdmi_ddc_match); struct platform_driver mtk_hdmi_ddc_driver = { .probe = mtk_hdmi_ddc_probe, - .remove = mtk_hdmi_ddc_remove, + .remove_new = mtk_hdmi_ddc_remove, .driver = { .name = "mediatek-hdmi-ddc", .of_match_table = mtk_hdmi_ddc_match, diff --git a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c index eecfa98ff52e..11bb6ca8cc8f 100644 --- a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c +++ b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c @@ -291,11 +291,10 @@ static int mtk_mdp_rdma_probe(struct platform_device *pdev) return ret; } -static int mtk_mdp_rdma_remove(struct platform_device *pdev) +static void mtk_mdp_rdma_remove(struct platform_device *pdev) { component_del(&pdev->dev, &mtk_mdp_rdma_component_ops); pm_runtime_disable(&pdev->dev); - return 0; } static const struct of_device_id mtk_mdp_rdma_driver_dt_match[] = { @@ -306,7 +305,7 @@ MODULE_DEVICE_TABLE(of, mtk_mdp_rdma_driver_dt_match); struct platform_driver mtk_mdp_rdma_driver = { .probe = mtk_mdp_rdma_probe, - .remove = mtk_mdp_rdma_remove, + .remove_new = mtk_mdp_rdma_remove, .driver = { .name = "mediatek-mdp-rdma", .owner = THIS_MODULE, From patchwork Sun May 7 16:25: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: 13233797 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D7722C7EE24 for ; Sun, 7 May 2023 16:27:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5658510E256; Sun, 7 May 2023 16:26:49 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4785410E23B for ; Sun, 7 May 2023 16:26:41 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDZ-000261-JT; Sun, 07 May 2023 18:26:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDY-001nDd-7W; Sun, 07 May 2023 18:26:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDX-002Ahf-Es; Sun, 07 May 2023 18:26:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Neil Armstrong , David Airlie , Daniel Vetter , Kevin Hilman Subject: [PATCH 30/53] drm/meson: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:53 +0200 Message-Id: <20230507162616.1368908-31-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2679; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IZ1twIv1uwI4nJItBoYCOFI4DD6dXrwGi4YZz9Kqntg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EGtCz+Z+paG2IRQDn3Y9px5icvZXFwIT9C2 Zv/052ExLCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRBgAKCRCPgPtYfRL+ TuTsCACDzyIP6EDyD1EIHbH5PLni2fmWs+TgQvYA/thWExLjGojBx7/CxfpjLhVJV9KLBYT+zJV VbJvmjvqyLuanVmMp14qIrP6iobjyMNL7w2no5r3Du8juur9Z9lFss96NcQN6cSrKBxgwr4aLUy Vw2rAhKbAuK60JWGJ8VtJZNhE9HS9VYnrtIxzGL2aiNBktPB8GF0xrXpbxBbsXx0d2vsYptnhqQ DXeyqxuvUqcCkBIUDAV6R+rPuKYD+xgRPQn5q2QjapWLDDaokJtbRA300lmFSsFwEe56Ml6hVkD 9bOmchl+Fil/PWoRaZUTGnuEm8uQbGH3wjdh3xOuh3QTtdJx 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Jerome Brunet Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert meson drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Martin Blumenstingl --- drivers/gpu/drm/meson/meson_drv.c | 6 ++---- drivers/gpu/drm/meson/meson_dw_hdmi.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index 7caf937c3c90..edaaf9ce5b1a 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -500,11 +500,9 @@ static int meson_drv_probe(struct platform_device *pdev) return 0; }; -static int meson_drv_remove(struct platform_device *pdev) +static void meson_drv_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &meson_drv_master_ops); - - return 0; } static struct meson_drm_match_data meson_drm_gxbb_data = { @@ -544,7 +542,7 @@ static const struct dev_pm_ops meson_drv_pm_ops = { static struct platform_driver meson_drm_platform_driver = { .probe = meson_drv_probe, - .remove = meson_drv_remove, + .remove_new = meson_drv_remove, .shutdown = meson_drv_shutdown, .driver = { .name = "meson-drm", diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c index 3d046878ce6c..411219d53b14 100644 --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c @@ -852,11 +852,9 @@ static int meson_dw_hdmi_probe(struct platform_device *pdev) return component_add(&pdev->dev, &meson_dw_hdmi_ops); } -static int meson_dw_hdmi_remove(struct platform_device *pdev) +static void meson_dw_hdmi_remove(struct platform_device *pdev) { component_del(&pdev->dev, &meson_dw_hdmi_ops); - - return 0; } static const struct dev_pm_ops meson_dw_hdmi_pm_ops = { @@ -879,7 +877,7 @@ MODULE_DEVICE_TABLE(of, meson_dw_hdmi_of_table); static struct platform_driver meson_dw_hdmi_platform_driver = { .probe = meson_dw_hdmi_probe, - .remove = meson_dw_hdmi_remove, + .remove_new = meson_dw_hdmi_remove, .driver = { .name = DRIVER_NAME, .of_match_table = meson_dw_hdmi_of_table, From patchwork Sun May 7 16:25:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13233835 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 69C9EC7EE2A for ; Sun, 7 May 2023 16:28:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 831B910E2C1; Sun, 7 May 2023 16:27:38 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7622010E28C for ; Sun, 7 May 2023 16:27:02 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDZ-00026H-MH; Sun, 07 May 2023 18:26:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDY-001nDh-C7; Sun, 07 May 2023 18:26:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDX-002Ahi-OT; Sun, 07 May 2023 18:26:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , David Airlie , Daniel Vetter , Akhil P Oommen , Ricardo Ribalda , Konrad Dybcio , Johan Hovold , Joel@pengutronix.de, Fernandes@pengutronix.de, Stephen Boyd , Marijn Suijten , Liu Shixin , Douglas Anderson , Miaoqian Lin , Kuogee Hsieh , Bjorn Andersson Subject: [PATCH 31/53] drm/msm: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:54 +0200 Message-Id: <20230507162616.1368908-32-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=10451; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=CKmA1MoPFhvTsZuzcqmf65a2BYZ+TP/RrnqQzcAIOPU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EIGYkQ7XbNx71ppgBLH+MWORknGbl+9W+O6 EFRpqkYy7yJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRCAAKCRCPgPtYfRL+ To8cB/4stQCtEmnkfMiiK2nlbM6VBoZ2yqoWJ7fHc2an2HFyZKTIf5k3lE8aSVkPEoYixeRuc6C C8rjXou+2D6WX3RrjONWDsDS7O8ra/fkuMMorygQ0jRDqD7X8j5mjJ+FCmoD7iAGcQ1YNBBiGxA ZcabcUngcoCLy+JcPt1bxxUhIk0XtHGStRiHbdg8+r24Dr85TNK1cvH8cikhmXXO0NKBIdSwLZS eniDPGuu0ai6rzKR+Pa5P7Chr1Azo9mtXQbb54VkbKCdcl7M7bvOLNRzTjRKi6ZlvnjuaiZX7JP 0UUpzK97sfimmyG/2HwO5eHz8m3MD4HbsgCb/ajchwWKM+CN 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Sean Paul , kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the msm drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/adreno/adreno_device.c | 5 ++--- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 6 ++---- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 6 ++---- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 5 ++--- drivers/gpu/drm/msm/dp/dp_display.c | 6 ++---- drivers/gpu/drm/msm/dsi/dsi.c | 6 ++---- drivers/gpu/drm/msm/hdmi/hdmi.c | 6 ++---- drivers/gpu/drm/msm/hdmi/hdmi_phy.c | 6 ++---- drivers/gpu/drm/msm/msm_drv.c | 6 ++---- drivers/gpu/drm/msm/msm_mdss.c | 6 ++---- 10 files changed, 20 insertions(+), 38 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c index c5c4c93b3689..c6f443ac7904 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -603,10 +603,9 @@ static int adreno_probe(struct platform_device *pdev) return 0; } -static int adreno_remove(struct platform_device *pdev) +static void adreno_remove(struct platform_device *pdev) { component_del(&pdev->dev, &a3xx_ops); - return 0; } static void adreno_shutdown(struct platform_device *pdev) @@ -721,7 +720,7 @@ static const struct dev_pm_ops adreno_pm_ops = { static struct platform_driver adreno_driver = { .probe = adreno_probe, - .remove = adreno_remove, + .remove_new = adreno_remove, .shutdown = adreno_shutdown, .driver = { .name = "adreno", diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index a683bd9b5a04..918c8c4f8e3d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1240,11 +1240,9 @@ static int dpu_dev_probe(struct platform_device *pdev) return msm_drv_probe(&pdev->dev, dpu_kms_init); } -static int dpu_dev_remove(struct platform_device *pdev) +static void dpu_dev_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &msm_drm_ops); - - return 0; } static int __maybe_unused dpu_runtime_suspend(struct device *dev) @@ -1317,7 +1315,7 @@ MODULE_DEVICE_TABLE(of, dpu_dt_match); static struct platform_driver dpu_driver = { .probe = dpu_dev_probe, - .remove = dpu_dev_remove, + .remove_new = dpu_dev_remove, .shutdown = msm_drv_shutdown, .driver = { .name = "msm_dpu", diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c index 9a1a0769575d..727d20ef9f02 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c @@ -566,11 +566,9 @@ static int mdp4_probe(struct platform_device *pdev) return msm_drv_probe(&pdev->dev, mdp4_kms_init); } -static int mdp4_remove(struct platform_device *pdev) +static void mdp4_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &msm_drm_ops); - - return 0; } static const struct of_device_id mdp4_dt_match[] = { @@ -581,7 +579,7 @@ MODULE_DEVICE_TABLE(of, mdp4_dt_match); static struct platform_driver mdp4_platform_driver = { .probe = mdp4_probe, - .remove = mdp4_remove, + .remove_new = mdp4_remove, .shutdown = msm_drv_shutdown, .driver = { .name = "mdp4", diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index 29ae5c9613f3..51b313b4da51 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -942,11 +942,10 @@ static int mdp5_dev_probe(struct platform_device *pdev) return msm_drv_probe(&pdev->dev, mdp5_kms_init); } -static int mdp5_dev_remove(struct platform_device *pdev) +static void mdp5_dev_remove(struct platform_device *pdev) { DBG(""); component_master_del(&pdev->dev, &msm_drm_ops); - return 0; } static __maybe_unused int mdp5_runtime_suspend(struct device *dev) @@ -987,7 +986,7 @@ MODULE_DEVICE_TABLE(of, mdp5_dt_match); static struct platform_driver mdp5_driver = { .probe = mdp5_dev_probe, - .remove = mdp5_dev_remove, + .remove_new = mdp5_dev_remove, .shutdown = msm_drv_shutdown, .driver = { .name = "msm_mdp", diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index bde1a7ce442f..3fec97ede90e 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1347,7 +1347,7 @@ static int dp_display_probe(struct platform_device *pdev) return rc; } -static int dp_display_remove(struct platform_device *pdev) +static void dp_display_remove(struct platform_device *pdev) { struct dp_display_private *dp = dev_get_dp_display_private(&pdev->dev); @@ -1355,8 +1355,6 @@ static int dp_display_remove(struct platform_device *pdev) component_del(&pdev->dev, &dp_display_comp_ops); platform_set_drvdata(pdev, NULL); - - return 0; } static int dp_pm_resume(struct device *dev) @@ -1471,7 +1469,7 @@ static const struct dev_pm_ops dp_pm_ops = { static struct platform_driver dp_display_driver = { .probe = dp_display_probe, - .remove = dp_display_remove, + .remove_new = dp_display_remove, .driver = { .name = "msm-dp-display", .of_match_table = dp_dt_match, diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 31fdee2052be..c5d65f0a5140 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -162,14 +162,12 @@ static int dsi_dev_probe(struct platform_device *pdev) return 0; } -static int dsi_dev_remove(struct platform_device *pdev) +static void dsi_dev_remove(struct platform_device *pdev) { struct msm_dsi *msm_dsi = platform_get_drvdata(pdev); DBG(""); dsi_destroy(msm_dsi); - - return 0; } static const struct of_device_id dt_match[] = { @@ -186,7 +184,7 @@ static const struct dev_pm_ops dsi_pm_ops = { static struct platform_driver dsi_driver = { .probe = dsi_dev_probe, - .remove = dsi_dev_remove, + .remove_new = dsi_dev_remove, .driver = { .name = "msm_dsi", .of_match_table = dt_match, diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 3132105a2a43..884d2e142307 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -549,15 +549,13 @@ static int msm_hdmi_dev_probe(struct platform_device *pdev) return ret; } -static int msm_hdmi_dev_remove(struct platform_device *pdev) +static void msm_hdmi_dev_remove(struct platform_device *pdev) { struct hdmi *hdmi = dev_get_drvdata(&pdev->dev); component_del(&pdev->dev, &msm_hdmi_ops); msm_hdmi_put_phy(hdmi); - - return 0; } static const struct of_device_id msm_hdmi_dt_match[] = { @@ -572,7 +570,7 @@ static const struct of_device_id msm_hdmi_dt_match[] = { static struct platform_driver msm_hdmi_driver = { .probe = msm_hdmi_dev_probe, - .remove = msm_hdmi_dev_remove, + .remove_new = msm_hdmi_dev_remove, .driver = { .name = "hdmi_msm", .of_match_table = msm_hdmi_dt_match, diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c index 9780107e1cc9..52f45d6684b6 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c @@ -176,11 +176,9 @@ static int msm_hdmi_phy_probe(struct platform_device *pdev) return 0; } -static int msm_hdmi_phy_remove(struct platform_device *pdev) +static void msm_hdmi_phy_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id msm_hdmi_phy_dt_match[] = { @@ -199,7 +197,7 @@ static const struct of_device_id msm_hdmi_phy_dt_match[] = { static struct platform_driver msm_hdmi_phy_platform_driver = { .probe = msm_hdmi_phy_probe, - .remove = msm_hdmi_phy_remove, + .remove_new = msm_hdmi_phy_remove, .driver = { .name = "msm_hdmi_phy", .of_match_table = msm_hdmi_phy_dt_match, diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index aca48c868c14..8b1d097a82e9 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1265,11 +1265,9 @@ static int msm_pdev_probe(struct platform_device *pdev) return msm_drv_probe(&pdev->dev, NULL); } -static int msm_pdev_remove(struct platform_device *pdev) +static void msm_pdev_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &msm_drm_ops); - - return 0; } void msm_drv_shutdown(struct platform_device *pdev) @@ -1290,7 +1288,7 @@ void msm_drv_shutdown(struct platform_device *pdev) static struct platform_driver msm_platform_driver = { .probe = msm_pdev_probe, - .remove = msm_pdev_remove, + .remove_new = msm_pdev_remove, .shutdown = msm_drv_shutdown, .driver = { .name = "msm", diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c index 02646e4bb4cd..b8567b369063 100644 --- a/drivers/gpu/drm/msm/msm_mdss.c +++ b/drivers/gpu/drm/msm/msm_mdss.c @@ -508,15 +508,13 @@ static int mdss_probe(struct platform_device *pdev) return 0; } -static int mdss_remove(struct platform_device *pdev) +static void mdss_remove(struct platform_device *pdev) { struct msm_mdss *mdss = platform_get_drvdata(pdev); of_platform_depopulate(&pdev->dev); msm_mdss_destroy(mdss); - - return 0; } static const struct of_device_id mdss_dt_match[] = { @@ -540,7 +538,7 @@ MODULE_DEVICE_TABLE(of, mdss_dt_match); static struct platform_driver mdss_platform_driver = { .probe = mdss_probe, - .remove = mdss_remove, + .remove_new = mdss_remove, .driver = { .name = "msm-mdss", .of_match_table = mdss_dt_match, From patchwork Sun May 7 16:25: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: 13233818 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C37F8C77B75 for ; Sun, 7 May 2023 16:27:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D583110E2A0; Sun, 7 May 2023 16:27:15 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3C5B710E236 for ; Sun, 7 May 2023 16:26:43 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDZ-00026n-Q0; Sun, 07 May 2023 18:26:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDY-001nDl-LY; Sun, 07 May 2023 18:26:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDY-002Ahl-0j; Sun, 07 May 2023 18:26:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Marek Vasut , Stefan Agner , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer Subject: [PATCH 32/53] drm/mxsfb: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:55 +0200 Message-Id: <20230507162616.1368908-33-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2801; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=kVWpcnc1XVC8DDLsTo5yftSMiQz91Aa5kylEjn1xYXU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EJ4dUC5JToc0Pvdg9XRW8whfE5GHP62ou8I zTYkxa57/iJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRCQAKCRCPgPtYfRL+ TgEcB/9lAfrvEA9r1DRL4PsYJdM9XsbMvAzN0f2Rfp3paPKFKdLMlBKT51RVFbySOGGhtIv9eno a5X1shKftTHwx2vnuGUB6S20FQdQrLTA12CBeHeO1S8yZfhITSqJ0K+b22YIWojGqCaBb/nPqHl rTec91AOApFyVvbrwT+cQeY6WZVuQr5aAsDJQfzXKBl8yWdfGm6jvgK5eVtX6K9Goy9QnaTNXha YYUwzSo0tdX9WCEJpSqDy2r7uzaNMVDIC5/5jNfpteBwIQyxuE4mBiir4hGOxwtdC5XzQUgWdDT ZtIZakRm476VY+/CA5u7J/PRPSiex6Bxc+wgf8XmmND61puB 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, NXP Linux Team , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the mxsfb driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 6 ++---- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index cc2ceb301b96..748b023cfe83 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -232,7 +232,7 @@ static int lcdif_probe(struct platform_device *pdev) return ret; } -static int lcdif_remove(struct platform_device *pdev) +static void lcdif_remove(struct platform_device *pdev) { struct drm_device *drm = platform_get_drvdata(pdev); @@ -240,8 +240,6 @@ static int lcdif_remove(struct platform_device *pdev) drm_atomic_helper_shutdown(drm); lcdif_unload(drm); drm_dev_put(drm); - - return 0; } static void lcdif_shutdown(struct platform_device *pdev) @@ -309,7 +307,7 @@ static const struct dev_pm_ops lcdif_pm_ops = { static struct platform_driver lcdif_platform_driver = { .probe = lcdif_probe, - .remove = lcdif_remove, + .remove_new = lcdif_remove, .shutdown = lcdif_shutdown, .driver = { .name = "imx-lcdif", diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c index b3ab86ad1b36..31f3696f82af 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -377,7 +377,7 @@ static int mxsfb_probe(struct platform_device *pdev) return ret; } -static int mxsfb_remove(struct platform_device *pdev) +static void mxsfb_remove(struct platform_device *pdev) { struct drm_device *drm = platform_get_drvdata(pdev); @@ -385,8 +385,6 @@ static int mxsfb_remove(struct platform_device *pdev) drm_atomic_helper_shutdown(drm); mxsfb_unload(drm); drm_dev_put(drm); - - return 0; } static void mxsfb_shutdown(struct platform_device *pdev) @@ -418,7 +416,7 @@ static const struct dev_pm_ops mxsfb_pm_ops = { static struct platform_driver mxsfb_platform_driver = { .probe = mxsfb_probe, - .remove = mxsfb_remove, + .remove_new = mxsfb_remove, .shutdown = mxsfb_shutdown, .driver = { .name = "mxsfb", From patchwork Sun May 7 16:25: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: 13233834 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24320C7EE24 for ; Sun, 7 May 2023 16:28:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4806910E239; Sun, 7 May 2023 16:27:33 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id BAE6C10E260 for ; Sun, 7 May 2023 16:26:49 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDa-000283-8N; Sun, 07 May 2023 18:26:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDZ-001nDq-4k; Sun, 07 May 2023 18:26:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDY-002Aho-7w; Sun, 07 May 2023 18:26:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Ben Skeggs , Karol Herbst , Lyude Paul , David Airlie , Daniel Vetter Subject: [PATCH 33/53] drm/nouveau: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:56 +0200 Message-Id: <20230507162616.1368908-34-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1639; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Aas34mM8r2UNncCy6pRgZ1pPDP6Z2C/pivtVsXVacDI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EKYb5Y7UphJvliTa1p2Qa+Peo7Zfj3zhHQV xoLgcI3xSGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRCgAKCRCPgPtYfRL+ TsOxB/9IbEHeot3Lcg1cjhsCFT3YoEpPBHJ3ftcqMl+xceLj65HX0/cvmFsefq244GcIROmaY5k O52hc2NfHqQfh6ywfG3O5lhF/+3N02k4VzXtbgxYCAWHTIxt3h6700EofIJJr+zk5W+MDlhmaZn QjwMRsGdNv3v0CV6oxRwedn3tujMRB4v/A7zW42jroRTphl5OEfvPDplZ7I9Pxmt5x1ErvU7GTD ObiGjPmRDjVmdb28/wIn55eq/mZ2++5ZO6HKmPjzxb5glLr7i9pEKr7erR+yqZypu1XtBeS6oLl NdE8TRY98MBl49hnNgu+bLm7Rm83A87mFiPdgCUlHH9HyUDm 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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/gpu/drm/nouveau/nouveau_platform.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_platform.c b/drivers/gpu/drm/nouveau/nouveau_platform.c index 23cd43a7fd19..bf2dc7567ea4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_platform.c +++ b/drivers/gpu/drm/nouveau/nouveau_platform.c @@ -43,11 +43,10 @@ static int nouveau_platform_probe(struct platform_device *pdev) return 0; } -static int nouveau_platform_remove(struct platform_device *pdev) +static void nouveau_platform_remove(struct platform_device *pdev) { struct drm_device *dev = platform_get_drvdata(pdev); nouveau_drm_device_remove(dev); - return 0; } #if IS_ENABLED(CONFIG_OF) @@ -93,5 +92,5 @@ struct platform_driver nouveau_platform_driver = { .of_match_table = of_match_ptr(nouveau_platform_match), }, .probe = nouveau_platform_probe, - .remove = nouveau_platform_remove, + .remove_new = nouveau_platform_remove, }; From patchwork Sun May 7 16:25: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: 13233824 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6ECAC77B75 for ; Sun, 7 May 2023 16:27:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1814F10E2A7; Sun, 7 May 2023 16:27:18 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0C87A10E270 for ; Sun, 7 May 2023 16:26:57 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDb-00028k-2e; Sun, 07 May 2023 18:26:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDZ-001nDu-F5; Sun, 07 May 2023 18:26:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDY-002Aht-J6; Sun, 07 May 2023 18:26:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Tomi Valkeinen , David Airlie , Daniel Vetter , Laurent Pinchart , Guo Zhengkui , Yuan Can , Arnd Bergmann , Liang He , Jani Nikula , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Sam Ravnborg Subject: [PATCH 34/53] drm/omap: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:57 +0200 Message-Id: <20230507162616.1368908-35-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=8986; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iKD7AZeIUKma0IlZ3ROG9taQaa2zMRkbsZ3oUXVMYfk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EL8dtwabTFSktKTSKIM2JkHduexezDHxykY LsTEu3079eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRCwAKCRCPgPtYfRL+ TrkJB/4jQ1NQMD2pf64J0xwMh/q0rEmYMfJHpJLK4Q48qqIlU1lCafV/f4rn/tf5ie8KOTJb3Pj DvOatXSSboxGSBIffniDZJK0tuj6bNUzZQFyTSyxiqfT0Amydt1lmaB3vNPreGcyuiCiqIUf7at edBX2CF3iTJpvA1Jb8Rbm92L947z81TzMCKDs/ra+s+hhxU75TtL2SSlH8anU3Iw4ZDSAddb/i0 iHRZMADENeyN5023xShxJWjtTabrMhZRvy1UEoWQnMAJg5XbOmFG5Slk2Xjtpl1ZcAq2oR9G82X +2/TacWZwp2mFHiVbGWmtqF3Xr8mAQI3eX1NvlNEsdQlbDeW 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the omap drm driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/dss/dispc.c | 5 ++--- drivers/gpu/drm/omapdrm/dss/dsi.c | 6 ++---- drivers/gpu/drm/omapdrm/dss/dss.c | 6 ++---- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 5 ++--- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 5 ++--- drivers/gpu/drm/omapdrm/dss/venc.c | 5 ++--- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 9 +++------ drivers/gpu/drm/omapdrm/omap_drv.c | 6 ++---- 8 files changed, 17 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index aacad5045e95..c26aab4939fa 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -4858,10 +4858,9 @@ static int dispc_probe(struct platform_device *pdev) return component_add(&pdev->dev, &dispc_component_ops); } -static int dispc_remove(struct platform_device *pdev) +static void dispc_remove(struct platform_device *pdev) { component_del(&pdev->dev, &dispc_component_ops); - return 0; } static __maybe_unused int dispc_runtime_suspend(struct device *dev) @@ -4913,7 +4912,7 @@ static const struct dev_pm_ops dispc_pm_ops = { struct platform_driver omap_dispchw_driver = { .probe = dispc_probe, - .remove = dispc_remove, + .remove_new = dispc_remove, .driver = { .name = "omapdss_dispc", .pm = &dispc_pm_ops, diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 4c1084eb0175..ea63c64d3a1a 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -5044,7 +5044,7 @@ static int dsi_probe(struct platform_device *pdev) return r; } -static int dsi_remove(struct platform_device *pdev) +static void dsi_remove(struct platform_device *pdev) { struct dsi_data *dsi = platform_get_drvdata(pdev); @@ -5060,8 +5060,6 @@ static int dsi_remove(struct platform_device *pdev) regulator_disable(dsi->vdds_dsi_reg); dsi->vdds_dsi_enabled = false; } - - return 0; } static __maybe_unused int dsi_runtime_suspend(struct device *dev) @@ -5095,7 +5093,7 @@ static const struct dev_pm_ops dsi_pm_ops = { struct platform_driver omap_dsihw_driver = { .probe = dsi_probe, - .remove = dsi_remove, + .remove_new = dsi_remove, .driver = { .name = "omapdss_dsi", .pm = &dsi_pm_ops, diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index c4febb861910..02955f976845 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1532,7 +1532,7 @@ static int dss_probe(struct platform_device *pdev) return r; } -static int dss_remove(struct platform_device *pdev) +static void dss_remove(struct platform_device *pdev) { struct dss_device *dss = platform_get_drvdata(pdev); @@ -1557,8 +1557,6 @@ static int dss_remove(struct platform_device *pdev) dss_put_clocks(dss); kfree(dss); - - return 0; } static void dss_shutdown(struct platform_device *pdev) @@ -1607,7 +1605,7 @@ static const struct dev_pm_ops dss_pm_ops = { struct platform_driver omap_dsshw_driver = { .probe = dss_probe, - .remove = dss_remove, + .remove_new = dss_remove, .shutdown = dss_shutdown, .driver = { .name = "omapdss_dss", diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c index a8a75dc24751..a26b77d99d52 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c @@ -824,7 +824,7 @@ static int hdmi4_probe(struct platform_device *pdev) return r; } -static int hdmi4_remove(struct platform_device *pdev) +static void hdmi4_remove(struct platform_device *pdev) { struct omap_hdmi *hdmi = platform_get_drvdata(pdev); @@ -835,7 +835,6 @@ static int hdmi4_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); kfree(hdmi); - return 0; } static const struct of_device_id hdmi_of_match[] = { @@ -845,7 +844,7 @@ static const struct of_device_id hdmi_of_match[] = { struct platform_driver omapdss_hdmi4hw_driver = { .probe = hdmi4_probe, - .remove = hdmi4_remove, + .remove_new = hdmi4_remove, .driver = { .name = "omapdss_hdmi", .of_match_table = hdmi_of_match, diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c index 868712cd8a3a..e6611c683857 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c @@ -798,7 +798,7 @@ static int hdmi5_probe(struct platform_device *pdev) return r; } -static int hdmi5_remove(struct platform_device *pdev) +static void hdmi5_remove(struct platform_device *pdev) { struct omap_hdmi *hdmi = platform_get_drvdata(pdev); @@ -809,7 +809,6 @@ static int hdmi5_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); kfree(hdmi); - return 0; } static const struct of_device_id hdmi_of_match[] = { @@ -820,7 +819,7 @@ static const struct of_device_id hdmi_of_match[] = { struct platform_driver omapdss_hdmi5hw_driver = { .probe = hdmi5_probe, - .remove = hdmi5_remove, + .remove_new = hdmi5_remove, .driver = { .name = "omapdss_hdmi5", .of_match_table = hdmi_of_match, diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c index 4480b69ab5a7..f163d52a7c7d 100644 --- a/drivers/gpu/drm/omapdrm/dss/venc.c +++ b/drivers/gpu/drm/omapdrm/dss/venc.c @@ -865,7 +865,7 @@ static int venc_probe(struct platform_device *pdev) return r; } -static int venc_remove(struct platform_device *pdev) +static void venc_remove(struct platform_device *pdev) { struct venc_device *venc = platform_get_drvdata(pdev); @@ -876,7 +876,6 @@ static int venc_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); kfree(venc); - return 0; } static __maybe_unused int venc_runtime_suspend(struct device *dev) @@ -913,7 +912,7 @@ static const struct of_device_id venc_of_match[] = { struct platform_driver omap_venchw_driver = { .probe = venc_probe, - .remove = venc_remove, + .remove_new = venc_remove, .driver = { .name = "omapdss_venc", .pm = &venc_pm_ops, diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c index 61a27dd7392e..9753c1e1f994 100644 --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c @@ -723,7 +723,7 @@ bool dmm_is_available(void) return omap_dmm ? true : false; } -static int omap_dmm_remove(struct platform_device *dev) +static void omap_dmm_remove(struct platform_device *dev) { struct tiler_block *block, *_block; int i; @@ -763,8 +763,6 @@ static int omap_dmm_remove(struct platform_device *dev) kfree(omap_dmm); omap_dmm = NULL; } - - return 0; } static int omap_dmm_probe(struct platform_device *dev) @@ -982,8 +980,7 @@ static int omap_dmm_probe(struct platform_device *dev) return 0; fail: - if (omap_dmm_remove(dev)) - dev_err(&dev->dev, "cleanup failed\n"); + omap_dmm_remove(dev); return ret; } @@ -1213,7 +1210,7 @@ static const struct of_device_id dmm_of_match[] = { struct platform_driver omap_dmm_driver = { .probe = omap_dmm_probe, - .remove = omap_dmm_remove, + .remove_new = omap_dmm_remove, .driver = { .owner = THIS_MODULE, .name = DMM_DRIVER_NAME, diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 699ed814e021..fcab66fbcfbf 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -826,14 +826,12 @@ static int pdev_probe(struct platform_device *pdev) return ret; } -static int pdev_remove(struct platform_device *pdev) +static void pdev_remove(struct platform_device *pdev) { struct omap_drm_private *priv = platform_get_drvdata(pdev); omapdrm_cleanup(priv); kfree(priv); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -864,7 +862,7 @@ static struct platform_driver pdev = { .pm = &omapdrm_pm_ops, }, .probe = pdev_probe, - .remove = pdev_remove, + .remove_new = pdev_remove, }; static struct platform_driver * const drivers[] = { From patchwork Sun May 7 16:25:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13233808 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62AABC7EE24 for ; Sun, 7 May 2023 16:27:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3058010E272; Sun, 7 May 2023 16:26:58 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id C675310E256 for ; Sun, 7 May 2023 16:26:41 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDa-00028p-P2; Sun, 07 May 2023 18:26:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDZ-001nDw-H8; Sun, 07 May 2023 18:26:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDY-002Ahx-Qw; Sun, 07 May 2023 18:26:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laurent Pinchart , Thierry Reding , David Airlie , Daniel Vetter Subject: [PATCH 35/53] drm/panel: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:58 +0200 Message-Id: <20230507162616.1368908-36-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4992; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7wKuglqWDRf8mf03U4PA6L5Miu2HCuP60h54DaSdXGg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EMkIzA53AZ0B0ztasLGnim4SkRSRT2mlign B9DKrFbqDOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRDAAKCRCPgPtYfRL+ Tsm3CAC1PmMSahwFR7aJ4+niaHAv5MErMOBeB7DU/vnfYC+rVihmfVYaQ9Fd+h+PRXTIsJB827f CFuCzbKwsDo70hcasub2P6RJeS2v5J+BQEHSaJW4J5VwHo2OXkoiQNcBsnCkbVAvQ39AyqdoSvm YQCu3YWFGtVvfJxS57ou+Hqwp0Ou/haKdRLSEBbcXsfbf0NyEjHmYNYMaWJq48Vt7IbdyvXpagR asr6/pnNnHY7/IkXt0HQ8mDUoxYHeLOuEUzKPeFe3KOtZHqGHPl1X+4+9JIwgPAzOTstwqLy7gB D50S0wCquNePnFo3ZI8MlLVeypegadc5Sw4fwQtdJvlUnEYN 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sam Ravnborg , kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the drm panel drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/panel/panel-lvds.c | 6 ++---- drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 6 ++---- drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c | 6 ++---- drivers/gpu/drm/panel/panel-simple.c | 6 ++---- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c index de8758c30e6e..b47c3a679be0 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -228,15 +228,13 @@ static int panel_lvds_probe(struct platform_device *pdev) return 0; } -static int panel_lvds_remove(struct platform_device *pdev) +static void panel_lvds_remove(struct platform_device *pdev) { struct panel_lvds *lvds = platform_get_drvdata(pdev); drm_panel_remove(&lvds->panel); drm_panel_disable(&lvds->panel); - - return 0; } static const struct of_device_id panel_lvds_of_table[] = { @@ -248,7 +246,7 @@ MODULE_DEVICE_TABLE(of, panel_lvds_of_table); static struct platform_driver panel_lvds_driver = { .probe = panel_lvds_probe, - .remove = panel_lvds_remove, + .remove_new = panel_lvds_remove, .driver = { .name = "panel-lvds", .of_match_table = panel_lvds_of_table, diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c index 76160e5d43bd..5c3d9f7fc358 100644 --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c @@ -266,14 +266,12 @@ static int seiko_panel_probe(struct device *dev, return 0; } -static int seiko_panel_remove(struct platform_device *pdev) +static void seiko_panel_remove(struct platform_device *pdev) { struct seiko_panel *panel = platform_get_drvdata(pdev); drm_panel_remove(&panel->base); drm_panel_disable(&panel->base); - - return 0; } static void seiko_panel_shutdown(struct platform_device *pdev) @@ -335,7 +333,7 @@ static struct platform_driver seiko_panel_platform_driver = { .of_match_table = platform_of_match, }, .probe = seiko_panel_platform_probe, - .remove = seiko_panel_remove, + .remove_new = seiko_panel_remove, .shutdown = seiko_panel_shutdown, }; module_platform_driver(seiko_panel_platform_driver); diff --git a/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c b/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c index a07d0f6c3e69..76bd9e810827 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c @@ -189,15 +189,13 @@ static int ls037v7dw01_probe(struct platform_device *pdev) return 0; } -static int ls037v7dw01_remove(struct platform_device *pdev) +static void ls037v7dw01_remove(struct platform_device *pdev) { struct ls037v7dw01_panel *lcd = platform_get_drvdata(pdev); drm_panel_remove(&lcd->panel); drm_panel_disable(&lcd->panel); drm_panel_unprepare(&lcd->panel); - - return 0; } static const struct of_device_id ls037v7dw01_of_match[] = { @@ -209,7 +207,7 @@ MODULE_DEVICE_TABLE(of, ls037v7dw01_of_match); static struct platform_driver ls037v7dw01_driver = { .probe = ls037v7dw01_probe, - .remove = ls037v7dw01_remove, + .remove_new = ls037v7dw01_remove, .driver = { .name = "panel-sharp-ls037v7dw01", .of_match_table = ls037v7dw01_of_match, diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 065f378bba9d..1274eb95cf86 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -4335,11 +4335,9 @@ static int panel_simple_platform_probe(struct platform_device *pdev) return panel_simple_probe(&pdev->dev, id->data); } -static int panel_simple_platform_remove(struct platform_device *pdev) +static void panel_simple_platform_remove(struct platform_device *pdev) { panel_simple_remove(&pdev->dev); - - return 0; } static void panel_simple_platform_shutdown(struct platform_device *pdev) @@ -4360,7 +4358,7 @@ static struct platform_driver panel_simple_platform_driver = { .pm = &panel_simple_pm_ops, }, .probe = panel_simple_platform_probe, - .remove = panel_simple_platform_remove, + .remove_new = panel_simple_platform_remove, .shutdown = panel_simple_platform_shutdown, }; From patchwork Sun May 7 16:25: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: 13233810 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E038BC7EE2D for ; Sun, 7 May 2023 16:27:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1036110E298; Sun, 7 May 2023 16:27:00 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 20F2110E208 for ; Sun, 7 May 2023 16:26:44 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDa-00029H-Uz; Sun, 07 May 2023 18:26:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDZ-001nE2-OD; Sun, 07 May 2023 18:26:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDZ-002Ai0-29; Sun, 07 May 2023 18:26:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Rob Herring , Tomeu Vizoso , David Airlie , Daniel Vetter Subject: [PATCH 36/53] drm/panfrost: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:25:59 +0200 Message-Id: <20230507162616.1368908-37-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-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=eYWGh9UUGNbFrss+H8ko5zFeXRgPhPwqqImGCYXepXY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9ENjtziTLJRuQzp+mWoM+vdSqwBfQsHlqiwh VMpkYJtIl+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRDQAKCRCPgPtYfRL+ Tu/FB/4sKccabqvQx1/s076FdnRyHvRH4pviSfj7KFsdQU43I+L0JXGt9gI54dxe1Ali0p/7KjT esmHUfqUB46GUs+aNwxtxfkvW5K/E1inqU2zcpgRZHIMdwPN/NDYE+exgx7+UTldqpAwCbIykb6 UGbxWXJR0qdoNL25U2XHD5MPas02hh/XnhL7rKHfHZaih5Sec3vrQvFgF5xeR3jVUXqwu8cWX3f riAPhMT/M3TZLpaEx6vWYdUYd4bKDGixOBvEOC6LtGGX+9SeZmzN4vA0cQHnpr3cpD6yrt9bTAf L5G/hV/7t18O3W+sFG7VlwYqJqR18sm4nsz5MXUFx9F2KYHZ 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, Alyssa Rosenzweig , dri-devel@lists.freedesktop.org, Steven Price Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Steven Price --- drivers/gpu/drm/panfrost/panfrost_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index abb0dadd8f63..adaacc8c39d7 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -618,7 +618,7 @@ static int panfrost_probe(struct platform_device *pdev) return err; } -static int panfrost_remove(struct platform_device *pdev) +static void panfrost_remove(struct platform_device *pdev) { struct panfrost_device *pfdev = platform_get_drvdata(pdev); struct drm_device *ddev = pfdev->ddev; @@ -632,7 +632,6 @@ static int panfrost_remove(struct platform_device *pdev) pm_runtime_set_suspended(pfdev->dev); drm_dev_put(ddev); - return 0; } /* @@ -687,7 +686,7 @@ MODULE_DEVICE_TABLE(of, dt_match); static struct platform_driver panfrost_driver = { .probe = panfrost_probe, - .remove = panfrost_remove, + .remove_new = panfrost_remove, .driver = { .name = "panfrost", .pm = pm_ptr(&panfrost_pm_ops), From patchwork Sun May 7 16:26: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: 13233806 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30ABBC7EE24 for ; Sun, 7 May 2023 16:27:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 690BC10E274; Sun, 7 May 2023 16:26:58 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id D572610E252 for ; Sun, 7 May 2023 16:26:41 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDa-0002AI-VN; Sun, 07 May 2023 18:26:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDZ-001nEB-Vq; Sun, 07 May 2023 18:26:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDZ-002Ai4-AI; Sun, 07 May 2023 18:26:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laurent Pinchart , Kieran Bingham , David Airlie , Daniel Vetter Subject: [PATCH 37/53] drm/rcar-du: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:00 +0200 Message-Id: <20230507162616.1368908-38-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6961; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=1xeEpSdtJz+J9reRuG7HPCKs28vfLaAiZKwwuTgpxz4=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTwi3z+e25nMGV2pdyanJrY+Ff9oKuesuSmlRKcJlPDJ Sd8MnTsZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAiDiwcDKsP3ysuq/Rd/n9+ uNzeN5EtcVVBBlHLj6Yyrs+02HftiUWHnx73k+r8Jp1ltsHf65YG72HU5Ss2kCu/IvSgKidZvKf OYo/lFta7YvpKeRt6Jn7yuCLQVXD9dUPuxfDV99azLs8s7ozJ1tkmdDR9yZZ1V1+fzvllHDTtvE KwyhmH+uORBWLbpx1W75p5W+288suH/HM+VuyffOGnYf26BmHL1+6nI71/l30JYWVmcHjx8YZbk GLXPZVTlxNkM3/vutwmcmOxo/icv79frv239FR0lQVfE+umMuVtxasceSRntU8paDrqs9nh35Tu x1X+7MaPjXdVihwpaDR1W9ZvkmRwY5oSq+4cF/3Fmgr9AA== 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the rcar-du drm driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Laurent Pinchart Reviewed-by: Geert Uytterhoeven --- drivers/gpu/drm/rcar-du/rcar_cmm.c | 6 ++---- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 6 ++---- drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c | 6 ++---- drivers/gpu/drm/rcar-du/rcar_lvds.c | 6 ++---- drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c | 6 ++---- drivers/gpu/drm/rcar-du/rzg2l_mipi_dsi.c | 6 ++---- 6 files changed, 12 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_cmm.c b/drivers/gpu/drm/rcar-du/rcar_cmm.c index e2a67dda4658..26a2f5ad8ee5 100644 --- a/drivers/gpu/drm/rcar-du/rcar_cmm.c +++ b/drivers/gpu/drm/rcar-du/rcar_cmm.c @@ -187,11 +187,9 @@ static int rcar_cmm_probe(struct platform_device *pdev) return 0; } -static int rcar_cmm_remove(struct platform_device *pdev) +static void rcar_cmm_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id rcar_cmm_of_table[] = { @@ -203,7 +201,7 @@ MODULE_DEVICE_TABLE(of, rcar_cmm_of_table); static struct platform_driver rcar_cmm_platform_driver = { .probe = rcar_cmm_probe, - .remove = rcar_cmm_remove, + .remove_new = rcar_cmm_remove, .driver = { .name = "rcar-cmm", .of_match_table = rcar_cmm_of_table, diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index b9a94c5260e9..4a6bf50b5c49 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -685,7 +685,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(rcar_du_pm_ops, * Platform driver */ -static int rcar_du_remove(struct platform_device *pdev) +static void rcar_du_remove(struct platform_device *pdev) { struct rcar_du_device *rcdu = platform_get_drvdata(pdev); struct drm_device *ddev = &rcdu->ddev; @@ -694,8 +694,6 @@ static int rcar_du_remove(struct platform_device *pdev) drm_atomic_helper_shutdown(ddev); drm_kms_helper_poll_fini(ddev); - - return 0; } static void rcar_du_shutdown(struct platform_device *pdev) @@ -776,7 +774,7 @@ static int rcar_du_probe(struct platform_device *pdev) static struct platform_driver rcar_du_platform_driver = { .probe = rcar_du_probe, - .remove = rcar_du_remove, + .remove_new = rcar_du_remove, .shutdown = rcar_du_shutdown, .driver = { .name = "rcar-du", diff --git a/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c b/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c index 18ed14911b98..119d69d20b23 100644 --- a/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c +++ b/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c @@ -93,13 +93,11 @@ static int rcar_dw_hdmi_probe(struct platform_device *pdev) return 0; } -static int rcar_dw_hdmi_remove(struct platform_device *pdev) +static void rcar_dw_hdmi_remove(struct platform_device *pdev) { struct dw_hdmi *hdmi = platform_get_drvdata(pdev); dw_hdmi_remove(hdmi); - - return 0; } static const struct of_device_id rcar_dw_hdmi_of_table[] = { @@ -110,7 +108,7 @@ MODULE_DEVICE_TABLE(of, rcar_dw_hdmi_of_table); static struct platform_driver rcar_dw_hdmi_platform_driver = { .probe = rcar_dw_hdmi_probe, - .remove = rcar_dw_hdmi_remove, + .remove_new = rcar_dw_hdmi_remove, .driver = { .name = "rcar-dw-hdmi", .of_match_table = rcar_dw_hdmi_of_table, diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c index 260ea5d8624e..86d2ac204568 100644 --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c @@ -890,15 +890,13 @@ static int rcar_lvds_probe(struct platform_device *pdev) return 0; } -static int rcar_lvds_remove(struct platform_device *pdev) +static void rcar_lvds_remove(struct platform_device *pdev) { struct rcar_lvds *lvds = platform_get_drvdata(pdev); drm_bridge_remove(&lvds->bridge); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct rcar_lvds_device_info rcar_lvds_gen2_info = { @@ -994,7 +992,7 @@ static const struct dev_pm_ops rcar_lvds_pm_ops = { static struct platform_driver rcar_lvds_platform_driver = { .probe = rcar_lvds_probe, - .remove = rcar_lvds_remove, + .remove_new = rcar_lvds_remove, .driver = { .name = "rcar-lvds", .pm = &rcar_lvds_pm_ops, diff --git a/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c b/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c index e10e4d4b89a2..305123a671c6 100644 --- a/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c +++ b/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c @@ -1044,13 +1044,11 @@ static int rcar_mipi_dsi_probe(struct platform_device *pdev) return 0; } -static int rcar_mipi_dsi_remove(struct platform_device *pdev) +static void rcar_mipi_dsi_remove(struct platform_device *pdev) { struct rcar_mipi_dsi *dsi = platform_get_drvdata(pdev); mipi_dsi_host_unregister(&dsi->host); - - return 0; } static const struct rcar_mipi_dsi_device_info v3u_data = { @@ -1093,7 +1091,7 @@ MODULE_DEVICE_TABLE(of, rcar_mipi_dsi_of_table); static struct platform_driver rcar_mipi_dsi_platform_driver = { .probe = rcar_mipi_dsi_probe, - .remove = rcar_mipi_dsi_remove, + .remove_new = rcar_mipi_dsi_remove, .driver = { .name = "rcar-mipi-dsi", .of_match_table = rcar_mipi_dsi_of_table, diff --git a/drivers/gpu/drm/rcar-du/rzg2l_mipi_dsi.c b/drivers/gpu/drm/rcar-du/rzg2l_mipi_dsi.c index aa95b85a2964..a97fc4c5d1c8 100644 --- a/drivers/gpu/drm/rcar-du/rzg2l_mipi_dsi.c +++ b/drivers/gpu/drm/rcar-du/rzg2l_mipi_dsi.c @@ -782,14 +782,12 @@ static int rzg2l_mipi_dsi_probe(struct platform_device *pdev) return ret; } -static int rzg2l_mipi_dsi_remove(struct platform_device *pdev) +static void rzg2l_mipi_dsi_remove(struct platform_device *pdev) { struct rzg2l_mipi_dsi *dsi = platform_get_drvdata(pdev); mipi_dsi_host_unregister(&dsi->host); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id rzg2l_mipi_dsi_of_table[] = { @@ -801,7 +799,7 @@ MODULE_DEVICE_TABLE(of, rzg2l_mipi_dsi_of_table); static struct platform_driver rzg2l_mipi_dsi_platform_driver = { .probe = rzg2l_mipi_dsi_probe, - .remove = rzg2l_mipi_dsi_remove, + .remove_new = rzg2l_mipi_dsi_remove, .driver = { .name = "rzg2l-mipi-dsi", .pm = &rzg2l_mipi_pm_ops, From patchwork Sun May 7 16:26:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13233816 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C580C77B75 for ; Sun, 7 May 2023 16:27:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F18010E286; Sun, 7 May 2023 16:27:14 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id E02E510E252 for ; Sun, 7 May 2023 16:26:42 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDb-0002EL-LU; Sun, 07 May 2023 18:26:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDa-001nEI-LJ; Sun, 07 May 2023 18:26:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDZ-002Ai8-L0; Sun, 07 May 2023 18:26:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , David Airlie , Daniel Vetter Subject: [PATCH 38/53] drm/rockchip: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:01 +0200 Message-Id: <20230507162616.1368908-39-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=10868; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7YWiMjNlK5vigZPcUWUUm2Oq70Hr+k8aHUpg1rjBFaM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EQU2HqP7At6tRbkqdOxhRGTrLTJ+xp0h3hH WdrVmBKgpmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfREAAKCRCPgPtYfRL+ TgADB/0YHhn4oP4pb53aHbFIGLYMQZiKFen+8KTGvr3n/OskqyCPbn+UM8dODo8+O6XmEA6EAon 0yPVLXQhBqNE2myO8Vsd4gcE1fAMnsgCPEMkwT1Ln9IuF+lAwRaDPMXRFjIhT3x//mGjVgPYu0L l6J+nwck5tGLwp4LO4d+MsnGFPydu0HiV8d+Od1d2tCEyoQYpBS05nKdXw8PajSuebRdclKOxfK X+ec9WwKLmW0rTMrQX6i0xZHGOfmKUd9BLAcM/MasKFJHz9WonvXZs6/zLZiDLQg4VTRny9FYb7 cJ8HMwrejj+vNat2uRrTKasOD0KDh3AlW0lcl6PFD+LhE1Qb 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert rockchip drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Heiko Stuebner --- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 6 ++---- drivers/gpu/drm/rockchip/cdn-dp-core.c | 6 ++---- drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 6 ++---- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 6 ++---- drivers/gpu/drm/rockchip/inno_hdmi.c | 6 ++---- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 6 ++---- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 6 ++---- drivers/gpu/drm/rockchip/rockchip_lvds.c | 6 ++---- drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 6 ++---- drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 6 ++---- 10 files changed, 20 insertions(+), 40 deletions(-) diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c index ad2d3ae7e621..c497382fdb9b 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -419,14 +419,12 @@ static int rockchip_dp_probe(struct platform_device *pdev) return ret; } -static int rockchip_dp_remove(struct platform_device *pdev) +static void rockchip_dp_remove(struct platform_device *pdev) { struct rockchip_dp_device *dp = platform_get_drvdata(pdev); component_del(&pdev->dev, &rockchip_dp_component_ops); analogix_dp_remove(dp->adp); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -481,7 +479,7 @@ MODULE_DEVICE_TABLE(of, rockchip_dp_dt_ids); struct platform_driver rockchip_dp_driver = { .probe = rockchip_dp_probe, - .remove = rockchip_dp_remove, + .remove_new = rockchip_dp_remove, .driver = { .name = "rockchip-dp", .pm = &rockchip_dp_pm_ops, diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index 8526dda91931..8a55950c208f 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -1223,15 +1223,13 @@ static int cdn_dp_probe(struct platform_device *pdev) return component_add(dev, &cdn_dp_component_ops); } -static int cdn_dp_remove(struct platform_device *pdev) +static void cdn_dp_remove(struct platform_device *pdev) { struct cdn_dp_device *dp = platform_get_drvdata(pdev); platform_device_unregister(dp->audio_pdev); cdn_dp_suspend(dp->dev); component_del(&pdev->dev, &cdn_dp_component_ops); - - return 0; } static void cdn_dp_shutdown(struct platform_device *pdev) @@ -1248,7 +1246,7 @@ static const struct dev_pm_ops cdn_dp_pm_ops = { struct platform_driver cdn_dp_driver = { .probe = cdn_dp_probe, - .remove = cdn_dp_remove, + .remove_new = cdn_dp_remove, .shutdown = cdn_dp_shutdown, .driver = { .name = "cdn-dp", diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c index 7901c3babc8c..375572103fd9 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c @@ -1468,13 +1468,11 @@ static int dw_mipi_dsi_rockchip_probe(struct platform_device *pdev) return 0; } -static int dw_mipi_dsi_rockchip_remove(struct platform_device *pdev) +static void dw_mipi_dsi_rockchip_remove(struct platform_device *pdev) { struct dw_mipi_dsi_rockchip *dsi = platform_get_drvdata(pdev); dw_mipi_dsi_remove(dsi->dmd); - - return 0; } static const struct rockchip_dw_dsi_chip_data px30_chip_data[] = { @@ -1676,7 +1674,7 @@ MODULE_DEVICE_TABLE(of, dw_mipi_dsi_rockchip_dt_ids); struct platform_driver dw_mipi_dsi_rockchip_driver = { .probe = dw_mipi_dsi_rockchip_probe, - .remove = dw_mipi_dsi_rockchip_remove, + .remove_new = dw_mipi_dsi_rockchip_remove, .driver = { .of_match_table = dw_mipi_dsi_rockchip_dt_ids, .pm = &dw_mipi_dsi_rockchip_pm_ops, diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 2f4b8f64cbad..8c4011d4ca61 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -656,11 +656,9 @@ static int dw_hdmi_rockchip_probe(struct platform_device *pdev) return component_add(&pdev->dev, &dw_hdmi_rockchip_ops); } -static int dw_hdmi_rockchip_remove(struct platform_device *pdev) +static void dw_hdmi_rockchip_remove(struct platform_device *pdev) { component_del(&pdev->dev, &dw_hdmi_rockchip_ops); - - return 0; } static int __maybe_unused dw_hdmi_rockchip_resume(struct device *dev) @@ -678,7 +676,7 @@ static const struct dev_pm_ops dw_hdmi_rockchip_pm = { struct platform_driver dw_hdmi_rockchip_pltfm_driver = { .probe = dw_hdmi_rockchip_probe, - .remove = dw_hdmi_rockchip_remove, + .remove_new = dw_hdmi_rockchip_remove, .driver = { .name = "dwhdmi-rockchip", .pm = &dw_hdmi_rockchip_pm, diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index f51774866f41..6a63952a6c84 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -919,11 +919,9 @@ static int inno_hdmi_probe(struct platform_device *pdev) return component_add(&pdev->dev, &inno_hdmi_ops); } -static int inno_hdmi_remove(struct platform_device *pdev) +static void inno_hdmi_remove(struct platform_device *pdev) { component_del(&pdev->dev, &inno_hdmi_ops); - - return 0; } static const struct of_device_id inno_hdmi_dt_ids[] = { @@ -935,7 +933,7 @@ MODULE_DEVICE_TABLE(of, inno_hdmi_dt_ids); struct platform_driver inno_hdmi_driver = { .probe = inno_hdmi_probe, - .remove = inno_hdmi_remove, + .remove_new = inno_hdmi_remove, .driver = { .name = "innohdmi-rockchip", .of_match_table = inno_hdmi_dt_ids, diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index 90145ad96984..5e6ac27ea155 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -858,11 +858,9 @@ static int rk3066_hdmi_probe(struct platform_device *pdev) return component_add(&pdev->dev, &rk3066_hdmi_ops); } -static int rk3066_hdmi_remove(struct platform_device *pdev) +static void rk3066_hdmi_remove(struct platform_device *pdev) { component_del(&pdev->dev, &rk3066_hdmi_ops); - - return 0; } static const struct of_device_id rk3066_hdmi_dt_ids[] = { @@ -873,7 +871,7 @@ MODULE_DEVICE_TABLE(of, rk3066_hdmi_dt_ids); struct platform_driver rk3066_hdmi_driver = { .probe = rk3066_hdmi_probe, - .remove = rk3066_hdmi_remove, + .remove_new = rk3066_hdmi_remove, .driver = { .name = "rockchip-rk3066-hdmi", .of_match_table = rk3066_hdmi_dt_ids, diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 6e0788d14c10..dedee7a0cd68 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -450,13 +450,11 @@ static int rockchip_drm_platform_probe(struct platform_device *pdev) return 0; } -static int rockchip_drm_platform_remove(struct platform_device *pdev) +static void rockchip_drm_platform_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &rockchip_drm_ops); rockchip_drm_match_remove(&pdev->dev); - - return 0; } static void rockchip_drm_platform_shutdown(struct platform_device *pdev) @@ -475,7 +473,7 @@ MODULE_DEVICE_TABLE(of, rockchip_drm_dt_ids); static struct platform_driver rockchip_drm_platform_driver = { .probe = rockchip_drm_platform_probe, - .remove = rockchip_drm_platform_remove, + .remove_new = rockchip_drm_platform_remove, .shutdown = rockchip_drm_platform_shutdown, .driver = { .name = "rockchip-drm", diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c index 68f6ebb33460..582859387792 100644 --- a/drivers/gpu/drm/rockchip/rockchip_lvds.c +++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c @@ -739,19 +739,17 @@ static int rockchip_lvds_probe(struct platform_device *pdev) return ret; } -static int rockchip_lvds_remove(struct platform_device *pdev) +static void rockchip_lvds_remove(struct platform_device *pdev) { struct rockchip_lvds *lvds = platform_get_drvdata(pdev); component_del(&pdev->dev, &rockchip_lvds_component_ops); clk_unprepare(lvds->pclk); - - return 0; } struct platform_driver rockchip_lvds_driver = { .probe = rockchip_lvds_probe, - .remove = rockchip_lvds_remove, + .remove_new = rockchip_lvds_remove, .driver = { .name = "rockchip-lvds", .of_match_table = of_match_ptr(rockchip_lvds_dt_ids), diff --git a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c index 9d30aa73b542..62b573f282a7 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c @@ -264,16 +264,14 @@ static int vop2_probe(struct platform_device *pdev) return component_add(dev, &vop2_component_ops); } -static int vop2_remove(struct platform_device *pdev) +static void vop2_remove(struct platform_device *pdev) { component_del(&pdev->dev, &vop2_component_ops); - - return 0; } struct platform_driver vop2_platform_driver = { .probe = vop2_probe, - .remove = vop2_remove, + .remove_new = vop2_remove, .driver = { .name = "rockchip-vop2", .of_match_table = of_match_ptr(vop2_dt_match), diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c index 014f99e8928e..3e31e8e4e0fd 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -1145,16 +1145,14 @@ static int vop_probe(struct platform_device *pdev) return component_add(dev, &vop_component_ops); } -static int vop_remove(struct platform_device *pdev) +static void vop_remove(struct platform_device *pdev) { component_del(&pdev->dev, &vop_component_ops); - - return 0; } struct platform_driver vop_platform_driver = { .probe = vop_probe, - .remove = vop_remove, + .remove_new = vop_remove, .driver = { .name = "rockchip-vop", .of_match_table = vop_driver_dt_match, From patchwork Sun May 7 16:26: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: 13233800 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1979EC77B75 for ; Sun, 7 May 2023 16:27:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 602F710E236; Sun, 7 May 2023 16:26:56 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5989910E236 for ; Sun, 7 May 2023 16:26:42 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDb-0002Gp-PX; Sun, 07 May 2023 18:26:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDb-001nES-2t; Sun, 07 May 2023 18:26:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDZ-002AiD-SI; Sun, 07 May 2023 18:26:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laurent Pinchart , Kieran Bingham , David Airlie , Daniel Vetter Subject: [PATCH 39/53] drm/shmobile: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:02 +0200 Message-Id: <20230507162616.1368908-40-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1892; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0LIMDYZylv4By3Zcd95xcK7hynz+BYh5LZWLCVI++98=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9ERnLzR9Hck/Cu+47E3lEch5wZJ9TyTr8X2p kgclAcd6yiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfREQAKCRCPgPtYfRL+ TlA3CAClwSGs9ml9DPUp02Ls/ghuFx91jYYEWPLyyLGzCKTrgQxL5jWfPZjUnC08o/CFZwtfI4N SOr00dLArPdoaIJS/uqzjrXdEEXBY9o0oojtbm14X1LFbZSvX3kfCMNA8P2OGdSSxT5UjzNHwP5 3+ma+aMEo3xpGlcyskRkMithGwYRvM/WGY8g4FDPnMnBVsCBjOO1aEe5y1TELZNNs7jTyAbJPcN dQtn7zP6pxL4CWuKQuA7qSfH9TLleb+93swHdeXJMHC2VJjQde2V6+fA5cne1p5dYYy05B7QGpq dlB5MshmxQxlN75Kxs254qQbMo92TQmC3BONuKGh342uwdgU 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Laurent Pinchart Reviewed-by: Geert Uytterhoeven --- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c index faacfee24763..fa32115320ca 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c @@ -171,7 +171,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(shmob_drm_pm_ops, * Platform driver */ -static int shmob_drm_remove(struct platform_device *pdev) +static void shmob_drm_remove(struct platform_device *pdev) { struct shmob_drm_device *sdev = platform_get_drvdata(pdev); struct drm_device *ddev = sdev->ddev; @@ -180,8 +180,6 @@ static int shmob_drm_remove(struct platform_device *pdev) drm_kms_helper_poll_fini(ddev); free_irq(sdev->irq, ddev); drm_dev_put(ddev); - - return 0; } static int shmob_drm_probe(struct platform_device *pdev) @@ -285,7 +283,7 @@ static int shmob_drm_probe(struct platform_device *pdev) static struct platform_driver shmob_drm_platform_driver = { .probe = shmob_drm_probe, - .remove = shmob_drm_remove, + .remove_new = shmob_drm_remove, .driver = { .name = "shmob-drm", .pm = pm_sleep_ptr(&shmob_drm_pm_ops), From patchwork Sun May 7 16:26: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: 13233832 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7657C7EE2A for ; Sun, 7 May 2023 16:28:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BBC9D10E2BF; Sun, 7 May 2023 16:27:27 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9193B10E264 for ; Sun, 7 May 2023 16:26:51 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDb-0002Fl-PR; Sun, 07 May 2023 18:26:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDa-001nEL-T1; Sun, 07 May 2023 18:26:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDa-002AiH-3x; Sun, 07 May 2023 18:26:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: David Airlie , Daniel Vetter , Orson Zhai , Baolin Wang , Chunyan Zhang , Sam Ravnborg , Thomas Zimmermann , Danilo Krummrich , Laurent Pinchart , Jani Nikula , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Deepak R Varma , Alex Deucher Subject: [PATCH 40/53] drm/sprd: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:03 +0200 Message-Id: <20230507162616.1368908-41-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3321; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=pLT5lhpzuLs2ns17GxqjNNB42OX6O1EnE5ZdVE9uWmY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9ES5ib2B4rPB3eAl9BcHNzV7SSjrJ+G8kWH+ yYzWh6eOdWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfREgAKCRCPgPtYfRL+ TuErB/45VErk1eYEiSjrOaTUtSpwieyM8IffvHiyYrA2yq7enBe5dyeNRAByRDopbDPgtka+w+1 nl2USM4+MIPIj/FW9RbDBAgpBL9VQ8XZ7OKQWdyX0naRLkJqsh7ywM1ZV5W746CBkuMg+t32Tz6 NPX23YvYTPT9A3Z/ro/zgqpH4hG+/UQnzKDkA5UmZDFakEZ4iCF2M7qqHcyyhvAvNP8bUZv/PmN J8dz93YfsbWRRqmqwyNY8OJNWkuxrCmiRuYYx4Hsq8ZAG4QAFHV7j1X0+a5EVKJy/J7Adgprw4B grKiS7Genh95AHz8wI1HrZjlsAo+lIE728fbSPmCGNJZtrCD 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the sprd drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/sprd/sprd_dpu.c | 6 ++---- drivers/gpu/drm/sprd/sprd_drm.c | 5 ++--- drivers/gpu/drm/sprd/sprd_dsi.c | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/sprd/sprd_dpu.c b/drivers/gpu/drm/sprd/sprd_dpu.c index b96fc6837b0d..3b19b9788a29 100644 --- a/drivers/gpu/drm/sprd/sprd_dpu.c +++ b/drivers/gpu/drm/sprd/sprd_dpu.c @@ -861,16 +861,14 @@ static int sprd_dpu_probe(struct platform_device *pdev) return component_add(&pdev->dev, &dpu_component_ops); } -static int sprd_dpu_remove(struct platform_device *pdev) +static void sprd_dpu_remove(struct platform_device *pdev) { component_del(&pdev->dev, &dpu_component_ops); - - return 0; } struct platform_driver sprd_dpu_driver = { .probe = sprd_dpu_probe, - .remove = sprd_dpu_remove, + .remove_new = sprd_dpu_remove, .driver = { .name = "sprd-dpu-drv", .of_match_table = dpu_match_table, diff --git a/drivers/gpu/drm/sprd/sprd_drm.c b/drivers/gpu/drm/sprd/sprd_drm.c index be60c0d546a3..cadf23f52ce5 100644 --- a/drivers/gpu/drm/sprd/sprd_drm.c +++ b/drivers/gpu/drm/sprd/sprd_drm.c @@ -137,10 +137,9 @@ static int sprd_drm_probe(struct platform_device *pdev) return drm_of_component_probe(&pdev->dev, component_compare_of, &drm_component_ops); } -static int sprd_drm_remove(struct platform_device *pdev) +static void sprd_drm_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &drm_component_ops); - return 0; } static void sprd_drm_shutdown(struct platform_device *pdev) @@ -163,7 +162,7 @@ MODULE_DEVICE_TABLE(of, drm_match_table); static struct platform_driver sprd_drm_driver = { .probe = sprd_drm_probe, - .remove = sprd_drm_remove, + .remove_new = sprd_drm_remove, .shutdown = sprd_drm_shutdown, .driver = { .name = "sprd-drm-drv", diff --git a/drivers/gpu/drm/sprd/sprd_dsi.c b/drivers/gpu/drm/sprd/sprd_dsi.c index ab0e5cce7adb..d5b05379ceca 100644 --- a/drivers/gpu/drm/sprd/sprd_dsi.c +++ b/drivers/gpu/drm/sprd/sprd_dsi.c @@ -1053,18 +1053,16 @@ static int sprd_dsi_probe(struct platform_device *pdev) return mipi_dsi_host_register(&dsi->host); } -static int sprd_dsi_remove(struct platform_device *pdev) +static void sprd_dsi_remove(struct platform_device *pdev) { struct sprd_dsi *dsi = dev_get_drvdata(&pdev->dev); mipi_dsi_host_unregister(&dsi->host); - - return 0; } struct platform_driver sprd_dsi_driver = { .probe = sprd_dsi_probe, - .remove = sprd_dsi_remove, + .remove_new = sprd_dsi_remove, .driver = { .name = "sprd-dsi-drv", .of_match_table = dsi_match_table, From patchwork Sun May 7 16:26: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: 13233799 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F1DBC77B7C for ; Sun, 7 May 2023 16:27:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 076C810E260; Sun, 7 May 2023 16:26:55 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id B8ED610E236 for ; Sun, 7 May 2023 16:26:42 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDc-0002Gy-0r; Sun, 07 May 2023 18:26:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDb-001nEX-55; Sun, 07 May 2023 18:26:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDa-002AiK-CT; Sun, 07 May 2023 18:26:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alain Volmat , David Airlie , Daniel Vetter Subject: [PATCH 41/53] drm/sti: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:04 +0200 Message-Id: <20230507162616.1368908-42-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=7282; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=8NQkMvjdiL3CEAKvtjv4HC+bAfqmgGCkmw5ona1pD/c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9ETwB79bqVBoj3Cm7Kmo4pilQkYCocI2FQ7U TvU5ECj4myJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfREwAKCRCPgPtYfRL+ ThIuB/9d9yCPJMrEjVvrjM+vz3vgzXRGdTCEudGlMz3y0A9ge2YhKZU95/Q3ERBJ3XwMafRh2sT 3nf758ab421p1P5uY1PFSCy86cEcN0oW2jeJJLd3RhoiqCzPmU7pUeoGfwJlyH6eA7cNnsxevgY maDl4BBU/L+/2m1FHpsIWtrDAS7oorYBVn7htvbo3haHUj3MujetzcDWFLLxhiIa7cDL6uqf+PD oqr+GMbLJOCV6Jz8xM6hSyHxvNbtTPJgsosIWGM4Hmhk21sL0p+dFlL7k0Bu9dcgghoyyxdlQkc F8DISMUsGAofbcMk8TEVAH/Qlai0ZwuywsCow12GE0EuS2PT 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the sti drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Alain Volmat --- drivers/gpu/drm/sti/sti_compositor.c | 5 ++--- drivers/gpu/drm/sti/sti_drv.c | 6 ++---- drivers/gpu/drm/sti/sti_dvo.c | 5 ++--- drivers/gpu/drm/sti/sti_hda.c | 5 ++--- drivers/gpu/drm/sti/sti_hdmi.c | 6 ++---- drivers/gpu/drm/sti/sti_hqvdp.c | 5 ++--- drivers/gpu/drm/sti/sti_tvout.c | 5 ++--- 7 files changed, 14 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c index 142a8e1b4436..33487a1fed8f 100644 --- a/drivers/gpu/drm/sti/sti_compositor.c +++ b/drivers/gpu/drm/sti/sti_compositor.c @@ -258,10 +258,9 @@ static int sti_compositor_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sti_compositor_ops); } -static int sti_compositor_remove(struct platform_device *pdev) +static void sti_compositor_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sti_compositor_ops); - return 0; } struct platform_driver sti_compositor_driver = { @@ -270,7 +269,7 @@ struct platform_driver sti_compositor_driver = { .of_match_table = compositor_of_match, }, .probe = sti_compositor_probe, - .remove = sti_compositor_remove, + .remove_new = sti_compositor_remove, }; MODULE_AUTHOR("Benjamin Gaignard "); diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index ef6a4e63198f..451480041130 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -246,11 +246,9 @@ static int sti_platform_probe(struct platform_device *pdev) return component_master_add_with_match(dev, &sti_ops, match); } -static int sti_platform_remove(struct platform_device *pdev) +static void sti_platform_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &sti_ops); - - return 0; } static const struct of_device_id sti_dt_ids[] = { @@ -261,7 +259,7 @@ MODULE_DEVICE_TABLE(of, sti_dt_ids); static struct platform_driver sti_platform_driver = { .probe = sti_platform_probe, - .remove = sti_platform_remove, + .remove_new = sti_platform_remove, .driver = { .name = DRIVER_NAME, .of_match_table = sti_dt_ids, diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c index 577c477b5f46..0dca0048dd25 100644 --- a/drivers/gpu/drm/sti/sti_dvo.c +++ b/drivers/gpu/drm/sti/sti_dvo.c @@ -567,10 +567,9 @@ static int sti_dvo_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sti_dvo_ops); } -static int sti_dvo_remove(struct platform_device *pdev) +static void sti_dvo_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sti_dvo_ops); - return 0; } static const struct of_device_id dvo_of_match[] = { @@ -586,7 +585,7 @@ struct platform_driver sti_dvo_driver = { .of_match_table = dvo_of_match, }, .probe = sti_dvo_probe, - .remove = sti_dvo_remove, + .remove_new = sti_dvo_remove, }; MODULE_AUTHOR("Benjamin Gaignard "); diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c index 15097ac67931..6ee35612a14e 100644 --- a/drivers/gpu/drm/sti/sti_hda.c +++ b/drivers/gpu/drm/sti/sti_hda.c @@ -792,10 +792,9 @@ static int sti_hda_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sti_hda_ops); } -static int sti_hda_remove(struct platform_device *pdev) +static void sti_hda_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sti_hda_ops); - return 0; } static const struct of_device_id hda_of_match[] = { @@ -812,7 +811,7 @@ struct platform_driver sti_hda_driver = { .of_match_table = hda_of_match, }, .probe = sti_hda_probe, - .remove = sti_hda_remove, + .remove_new = sti_hda_remove, }; MODULE_AUTHOR("Benjamin Gaignard "); diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index 8539fe1fedc4..3d8ddceca845 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -1471,7 +1471,7 @@ static int sti_hdmi_probe(struct platform_device *pdev) return ret; } -static int sti_hdmi_remove(struct platform_device *pdev) +static void sti_hdmi_remove(struct platform_device *pdev) { struct sti_hdmi *hdmi = dev_get_drvdata(&pdev->dev); @@ -1479,8 +1479,6 @@ static int sti_hdmi_remove(struct platform_device *pdev) if (hdmi->audio_pdev) platform_device_unregister(hdmi->audio_pdev); component_del(&pdev->dev, &sti_hdmi_ops); - - return 0; } struct platform_driver sti_hdmi_driver = { @@ -1490,7 +1488,7 @@ struct platform_driver sti_hdmi_driver = { .of_match_table = hdmi_of_match, }, .probe = sti_hdmi_probe, - .remove = sti_hdmi_remove, + .remove_new = sti_hdmi_remove, }; MODULE_AUTHOR("Benjamin Gaignard "); diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 02b77279f6e4..0fb48ac044d8 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -1400,10 +1400,9 @@ static int sti_hqvdp_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sti_hqvdp_ops); } -static int sti_hqvdp_remove(struct platform_device *pdev) +static void sti_hqvdp_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sti_hqvdp_ops); - return 0; } static const struct of_device_id hqvdp_of_match[] = { @@ -1419,7 +1418,7 @@ struct platform_driver sti_hqvdp_driver = { .of_match_table = hqvdp_of_match, }, .probe = sti_hqvdp_probe, - .remove = sti_hqvdp_remove, + .remove_new = sti_hqvdp_remove, }; MODULE_AUTHOR("Benjamin Gaignard "); diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c index 2499715a69b7..64615638b79a 100644 --- a/drivers/gpu/drm/sti/sti_tvout.c +++ b/drivers/gpu/drm/sti/sti_tvout.c @@ -872,10 +872,9 @@ static int sti_tvout_probe(struct platform_device *pdev) return component_add(dev, &sti_tvout_ops); } -static int sti_tvout_remove(struct platform_device *pdev) +static void sti_tvout_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sti_tvout_ops); - return 0; } static const struct of_device_id tvout_of_match[] = { @@ -891,7 +890,7 @@ struct platform_driver sti_tvout_driver = { .of_match_table = tvout_of_match, }, .probe = sti_tvout_probe, - .remove = sti_tvout_remove, + .remove_new = sti_tvout_remove, }; MODULE_AUTHOR("Benjamin Gaignard "); From patchwork Sun May 7 16:26: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: 13233825 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A22EC77B7C for ; Sun, 7 May 2023 16:27:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0FB510E2AA; Sun, 7 May 2023 16:27:19 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id C953810E264 for ; Sun, 7 May 2023 16:26:55 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDc-0002Hp-6J; Sun, 07 May 2023 18:26:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDb-001nEc-C5; Sun, 07 May 2023 18:26:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDa-002AiN-KO; Sun, 07 May 2023 18:26:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , David Airlie , Daniel Vetter , Maxime Coquelin , Alexandre Torgue Subject: [PATCH 42/53] drm/stm: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:05 +0200 Message-Id: <20230507162616.1368908-43-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2934; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VBjQWjzqZ0JTQET5hvmN/Q6/iuJELmv5j/ynukd6X4A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EUK4Twf4RYXDa6P3NRl5LAxP6p01blYfQj+ sfuV37RNpuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRFAAKCRCPgPtYfRL+ Tn5BCACZXxqbkSEj64X4IO9Jl4UE5Fwcqo46zCGQPooOmtsJPnvHOMD2vrTWcdt89WbWa7HPyGW p68wJigwr8LgliEAG8bFBav809Ur+2IYDYVpkPTywsKw5waM0XrYaMLY2F1vodQugTwLttTS5Q9 NaXjOLbW5Hwxl7bjMEUkL79vmwX9GFQino3lvHJbJTNuRGj1Eir7GJWRvzNUJKyA3EmXZirKoS4 wQ47mFT617Y0LGi9fBYVJ7mRBGqo58eItCT6BRznJjnP6K88oRjUBE5Mzq8oNPv3DRhGwj+L5jF 9UwZ78x5QLVJ/VyxkuH6gcIlEVoNR80JhOcG5RX5cfRr76aW 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, linux-stm32@st-md-mailman.stormreply.com, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the stm drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Raphaël Gallais-Pou --- drivers/gpu/drm/stm/drv.c | 6 ++---- drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index 50410bd99dfe..be91b375a4d5 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -213,7 +213,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev) return ret; } -static int stm_drm_platform_remove(struct platform_device *pdev) +static void stm_drm_platform_remove(struct platform_device *pdev) { struct drm_device *ddev = platform_get_drvdata(pdev); @@ -222,8 +222,6 @@ static int stm_drm_platform_remove(struct platform_device *pdev) drm_dev_unregister(ddev); drv_unload(ddev); drm_dev_put(ddev); - - return 0; } static const struct of_device_id drv_dt_ids[] = { @@ -234,7 +232,7 @@ MODULE_DEVICE_TABLE(of, drv_dt_ids); static struct platform_driver stm_drm_platform_driver = { .probe = stm_drm_platform_probe, - .remove = stm_drm_platform_remove, + .remove_new = stm_drm_platform_remove, .driver = { .name = "stm32-display", .of_match_table = drv_dt_ids, diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c index 89897d5f5c72..a7c349404a7a 100644 --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c @@ -537,15 +537,13 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) return ret; } -static int dw_mipi_dsi_stm_remove(struct platform_device *pdev) +static void dw_mipi_dsi_stm_remove(struct platform_device *pdev) { struct dw_mipi_dsi_stm *dsi = platform_get_drvdata(pdev); dw_mipi_dsi_remove(dsi->dsi); clk_disable_unprepare(dsi->pllref_clk); regulator_disable(dsi->vdd_supply); - - return 0; } static int __maybe_unused dw_mipi_dsi_stm_suspend(struct device *dev) @@ -590,7 +588,7 @@ static const struct dev_pm_ops dw_mipi_dsi_stm_pm_ops = { static struct platform_driver dw_mipi_dsi_stm_driver = { .probe = dw_mipi_dsi_stm_probe, - .remove = dw_mipi_dsi_stm_remove, + .remove_new = dw_mipi_dsi_stm_remove, .driver = { .of_match_table = dw_mipi_dsi_stm_dt_ids, .name = "stm32-display-dsi", From patchwork Sun May 7 16:26: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: 13233833 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0E04C77B7C for ; Sun, 7 May 2023 16:28:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EACAA10E221; Sun, 7 May 2023 16:27:32 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 40E3E10E260 for ; Sun, 7 May 2023 16:26:51 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDd-0002Mz-7o; Sun, 07 May 2023 18:26:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDc-001nEx-IM; Sun, 07 May 2023 18:26:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDa-002AiR-ST; Sun, 07 May 2023 18:26:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Maxime Ripard , Chen-Yu Tsai , David Airlie , Daniel Vetter , Jernej Skrabec , Samuel Holland Subject: [PATCH 43/53] drm/sun4i: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:06 +0200 Message-Id: <20230507162616.1368908-44-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=11829; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ohgJo94kyt0RNLgyTYuJgk8dygZHofC9LVsJ+owdWP0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EVIA+iAJjFctTP6iRXt+HqZODQc1IA+/107 io8u7+9p7OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRFQAKCRCPgPtYfRL+ TsuXB/0VJzDkq314OTfzK50tWqSEw9KhIhLeCN5n6klG4+sI4fYe83X3qlOZRu55FRfuI9oOeoS ypX8RNoDNrtGs5783x+tpUaMPF6xi1T34pjvBv3Zni3MXDN40BzoAQANs2CqZ906iw1BxdaCuTK /3pZW+caA28MDlhceZq0sGZH0uFq102nlo9gts68X0yaZIGJpEpI0zyT/r5IfWdy40knbQhArpl 6HJ8zRC0Po+CD3EqcDxmSxm2g5cJ27+g5Nyk0gRJCOetCUakh+xL+gHN/6zwTwmg/Urvs0+HBp7 LPpS0NG+vWOP6VLFtBzU6RrWYGV0W12BGcM2vPzn76e910vo 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the sun4i drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/sun4i/sun4i_backend.c | 6 ++---- drivers/gpu/drm/sun4i/sun4i_drv.c | 6 ++---- drivers/gpu/drm/sun4i/sun4i_frontend.c | 6 ++---- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 6 ++---- drivers/gpu/drm/sun4i/sun4i_tcon.c | 6 ++---- drivers/gpu/drm/sun4i/sun4i_tv.c | 6 ++---- drivers/gpu/drm/sun4i/sun6i_drc.c | 6 ++---- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 6 ++---- drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 6 ++---- drivers/gpu/drm/sun4i/sun8i_mixer.c | 6 ++---- drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 6 ++---- 11 files changed, 22 insertions(+), 44 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index 38070fc261f3..b70950137bf1 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -965,11 +965,9 @@ static int sun4i_backend_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sun4i_backend_ops); } -static int sun4i_backend_remove(struct platform_device *pdev) +static void sun4i_backend_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sun4i_backend_ops); - - return 0; } static const struct sun4i_backend_quirks sun4i_backend_quirks = { @@ -1028,7 +1026,7 @@ MODULE_DEVICE_TABLE(of, sun4i_backend_of_table); static struct platform_driver sun4i_backend_platform_driver = { .probe = sun4i_backend_probe, - .remove = sun4i_backend_remove, + .remove_new = sun4i_backend_remove, .driver = { .name = "sun4i-backend", .of_match_table = sun4i_backend_of_table, diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index d6c741716167..1449b7ea66d3 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -408,11 +408,9 @@ static int sun4i_drv_probe(struct platform_device *pdev) return 0; } -static int sun4i_drv_remove(struct platform_device *pdev) +static void sun4i_drv_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &sun4i_drv_master_ops); - - return 0; } static const struct of_device_id sun4i_drv_of_table[] = { @@ -438,7 +436,7 @@ MODULE_DEVICE_TABLE(of, sun4i_drv_of_table); static struct platform_driver sun4i_drv_platform_driver = { .probe = sun4i_drv_probe, - .remove = sun4i_drv_remove, + .remove_new = sun4i_drv_remove, .driver = { .name = "sun4i-drm", .of_match_table = sun4i_drv_of_table, diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c index 799ab7460ae5..3872c91a85c7 100644 --- a/drivers/gpu/drm/sun4i/sun4i_frontend.c +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c @@ -634,11 +634,9 @@ static int sun4i_frontend_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sun4i_frontend_ops); } -static int sun4i_frontend_remove(struct platform_device *pdev) +static void sun4i_frontend_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sun4i_frontend_ops); - - return 0; } static int sun4i_frontend_runtime_resume(struct device *dev) @@ -719,7 +717,7 @@ MODULE_DEVICE_TABLE(of, sun4i_frontend_of_table); static struct platform_driver sun4i_frontend_driver = { .probe = sun4i_frontend_probe, - .remove = sun4i_frontend_remove, + .remove_new = sun4i_frontend_remove, .driver = { .name = "sun4i-frontend", .of_match_table = sun4i_frontend_of_table, diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c index c0df5e892fa7..c139e1262e03 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -693,11 +693,9 @@ static int sun4i_hdmi_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sun4i_hdmi_ops); } -static int sun4i_hdmi_remove(struct platform_device *pdev) +static void sun4i_hdmi_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sun4i_hdmi_ops); - - return 0; } static const struct of_device_id sun4i_hdmi_of_table[] = { @@ -710,7 +708,7 @@ MODULE_DEVICE_TABLE(of, sun4i_hdmi_of_table); static struct platform_driver sun4i_hdmi_driver = { .probe = sun4i_hdmi_probe, - .remove = sun4i_hdmi_remove, + .remove_new = sun4i_hdmi_remove, .driver = { .name = "sun4i-hdmi", .of_match_table = sun4i_hdmi_of_table, diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 523a6d787921..f0a3752878fe 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -1336,11 +1336,9 @@ static int sun4i_tcon_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sun4i_tcon_ops); } -static int sun4i_tcon_remove(struct platform_device *pdev) +static void sun4i_tcon_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sun4i_tcon_ops); - - return 0; } /* platform specific TCON muxing callbacks */ @@ -1575,7 +1573,7 @@ EXPORT_SYMBOL(sun4i_tcon_of_table); static struct platform_driver sun4i_tcon_platform_driver = { .probe = sun4i_tcon_probe, - .remove = sun4i_tcon_remove, + .remove_new = sun4i_tcon_remove, .driver = { .name = "sun4i-tcon", .of_match_table = sun4i_tcon_of_table, diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c index 9625a00a48ba..ec65d9d59de7 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tv.c +++ b/drivers/gpu/drm/sun4i/sun4i_tv.c @@ -546,11 +546,9 @@ static int sun4i_tv_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sun4i_tv_ops); } -static int sun4i_tv_remove(struct platform_device *pdev) +static void sun4i_tv_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sun4i_tv_ops); - - return 0; } static const struct of_device_id sun4i_tv_of_table[] = { @@ -561,7 +559,7 @@ MODULE_DEVICE_TABLE(of, sun4i_tv_of_table); static struct platform_driver sun4i_tv_platform_driver = { .probe = sun4i_tv_probe, - .remove = sun4i_tv_remove, + .remove_new = sun4i_tv_remove, .driver = { .name = "sun4i-tve", .of_match_table = sun4i_tv_of_table, diff --git a/drivers/gpu/drm/sun4i/sun6i_drc.c b/drivers/gpu/drm/sun4i/sun6i_drc.c index 4fbe9a6b5182..0d342f43fa93 100644 --- a/drivers/gpu/drm/sun4i/sun6i_drc.c +++ b/drivers/gpu/drm/sun4i/sun6i_drc.c @@ -95,11 +95,9 @@ static int sun6i_drc_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sun6i_drc_ops); } -static int sun6i_drc_remove(struct platform_device *pdev) +static void sun6i_drc_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sun6i_drc_ops); - - return 0; } static const struct of_device_id sun6i_drc_of_table[] = { @@ -114,7 +112,7 @@ MODULE_DEVICE_TABLE(of, sun6i_drc_of_table); static struct platform_driver sun6i_drc_platform_driver = { .probe = sun6i_drc_probe, - .remove = sun6i_drc_remove, + .remove_new = sun6i_drc_remove, .driver = { .name = "sun6i-drc", .of_match_table = sun6i_drc_of_table, diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 760ff05eabf4..4abf4f102007 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -1200,7 +1200,7 @@ static int sun6i_dsi_probe(struct platform_device *pdev) return ret; } -static int sun6i_dsi_remove(struct platform_device *pdev) +static void sun6i_dsi_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct sun6i_dsi *dsi = dev_get_drvdata(dev); @@ -1211,8 +1211,6 @@ static int sun6i_dsi_remove(struct platform_device *pdev) clk_rate_exclusive_put(dsi->mod_clk); regmap_mmio_detach_clk(dsi->regs); - - return 0; } static const struct sun6i_dsi_variant sun6i_a31_mipi_dsi_variant = { @@ -1246,7 +1244,7 @@ MODULE_DEVICE_TABLE(of, sun6i_dsi_of_table); static struct platform_driver sun6i_dsi_platform_driver = { .probe = sun6i_dsi_probe, - .remove = sun6i_dsi_remove, + .remove_new = sun6i_dsi_remove, .driver = { .name = "sun6i-mipi-dsi", .of_match_table = sun6i_dsi_of_table, diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c index 7cab4213a680..26dd8f0dde99 100644 --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c @@ -235,11 +235,9 @@ static int sun8i_dw_hdmi_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sun8i_dw_hdmi_ops); } -static int sun8i_dw_hdmi_remove(struct platform_device *pdev) +static void sun8i_dw_hdmi_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sun8i_dw_hdmi_ops); - - return 0; } static const struct sun8i_dw_hdmi_quirks sun8i_a83t_quirks = { @@ -266,7 +264,7 @@ MODULE_DEVICE_TABLE(of, sun8i_dw_hdmi_dt_ids); static struct platform_driver sun8i_dw_hdmi_pltfm_driver = { .probe = sun8i_dw_hdmi_probe, - .remove = sun8i_dw_hdmi_remove, + .remove_new = sun8i_dw_hdmi_remove, .driver = { .name = "sun8i-dw-hdmi", .of_match_table = sun8i_dw_hdmi_dt_ids, diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index bafee05f6b24..e4a73ca08365 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -555,11 +555,9 @@ static int sun8i_mixer_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sun8i_mixer_ops); } -static int sun8i_mixer_remove(struct platform_device *pdev) +static void sun8i_mixer_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sun8i_mixer_ops); - - return 0; } static const struct sun8i_mixer_cfg sun8i_a83t_mixer0_cfg = { @@ -711,7 +709,7 @@ MODULE_DEVICE_TABLE(of, sun8i_mixer_of_table); static struct platform_driver sun8i_mixer_platform_driver = { .probe = sun8i_mixer_probe, - .remove = sun8i_mixer_remove, + .remove_new = sun8i_mixer_remove, .driver = { .name = "sun8i-mixer", .of_match_table = sun8i_mixer_of_table, diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c index da97682b6835..2e8dd7723e29 100644 --- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c +++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c @@ -261,11 +261,9 @@ static int sun8i_tcon_top_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sun8i_tcon_top_ops); } -static int sun8i_tcon_top_remove(struct platform_device *pdev) +static void sun8i_tcon_top_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sun8i_tcon_top_ops); - - return 0; } static const struct sun8i_tcon_top_quirks sun8i_r40_tcon_top_quirks = { @@ -302,7 +300,7 @@ EXPORT_SYMBOL(sun8i_tcon_top_of_table); static struct platform_driver sun8i_tcon_top_platform_driver = { .probe = sun8i_tcon_top_probe, - .remove = sun8i_tcon_top_remove, + .remove_new = sun8i_tcon_top_remove, .driver = { .name = "sun8i-tcon-top", .of_match_table = sun8i_tcon_top_of_table, From patchwork Sun May 7 16:26:07 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: 13233801 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 20C8CC77B75 for ; Sun, 7 May 2023 16:27:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E26F510E267; Sun, 7 May 2023 16:26:56 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1B53810E236 for ; Sun, 7 May 2023 16:26:43 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDc-0002Jh-FM; Sun, 07 May 2023 18:26:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDb-001nEg-NA; Sun, 07 May 2023 18:26:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDb-002AiV-2v; Sun, 07 May 2023 18:26:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding , David Airlie , Daniel Vetter , Jonathan Hunter Subject: [PATCH 44/53] drm/tegra: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:07 +0200 Message-Id: <20230507162616.1368908-45-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-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=6Tyw8Au9KpeTmv6RYa0mwqi6I44JPDfcpUHMvWx+Rmc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EXNwL7pp3dWiytKFnM4XC2oa/JVP0OTwaHl urBYj6kcB+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRFwAKCRCPgPtYfRL+ Tu6VB/0cqMnaIjWL2FW5NonzbDFKrECGuIwQ3qn45j3OKE0whwo0lp1k46AMAfmx7z6OboLwqI8 mzMh9APc426bSrFJJjIEIi5/WEn4AZTGwR4olk2MzNYgujWL0m+xElanH1f5z6A/wW/i16x90E/ il/5AGzjeKGC7G4BXG7GvmJdDDGtdNqmcJ3l7vYf5Z0rzvZZcxQwIab9GdVsuq3RgcaOUARKRvH bvtDbWVWGhzfG6raSRcv5YE61xiDLkrReAtlX4ViDN+5DFSg/N4lLx4BVNh3iI+HPr2jDPWy70o wu3kTtwHiN5f/rB54kd3dnLru9QaI+kZ817JAemu8bWKu0vj 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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/gpu/drm/tegra/dpaux.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c index 3c84e73d5051..4d2677dcd831 100644 --- a/drivers/gpu/drm/tegra/dpaux.c +++ b/drivers/gpu/drm/tegra/dpaux.c @@ -579,7 +579,7 @@ static int tegra_dpaux_probe(struct platform_device *pdev) return 0; } -static int tegra_dpaux_remove(struct platform_device *pdev) +static void tegra_dpaux_remove(struct platform_device *pdev) { struct tegra_dpaux *dpaux = platform_get_drvdata(pdev); @@ -594,8 +594,6 @@ static int tegra_dpaux_remove(struct platform_device *pdev) mutex_lock(&dpaux_lock); list_del(&dpaux->list); mutex_unlock(&dpaux_lock); - - return 0; } static int tegra_dpaux_suspend(struct device *dev) @@ -695,7 +693,7 @@ struct platform_driver tegra_dpaux_driver = { .pm = pm_ptr(&tegra_dpaux_pm_ops), }, .probe = tegra_dpaux_probe, - .remove = tegra_dpaux_remove, + .remove_new = tegra_dpaux_remove, }; struct drm_dp_aux *drm_dp_aux_find_by_of_node(struct device_node *np) From patchwork Sun May 7 16:26: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: 13233836 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E8A3C77B7C for ; Sun, 7 May 2023 16:28:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AC18710E2C4; Sun, 7 May 2023 16:27:38 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id D6D1D10E263 for ; Sun, 7 May 2023 16:26:49 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDd-0002Mg-5Q; Sun, 07 May 2023 18:26:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDc-001nEt-BZ; Sun, 07 May 2023 18:26:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDb-002Aia-BC; Sun, 07 May 2023 18:26:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: David Airlie , Daniel Vetter , Maxime Ripard , =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , =?utf-8?q?Noralf_Tr=C3=B8nne?= =?utf-8?q?s?= Subject: [PATCH 45/53] drm/tests: helpers: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:08 +0200 Message-Id: <20230507162616.1368908-46-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1411; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/Wl1/d5wmThPaeOs36gLx2V+XCXAjo2ehAY2HF9yWDE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EYb0QBN/wqquX3jsjGowxwv+JNlGwVkVCj+ P1xIHfd8ZaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRGAAKCRCPgPtYfRL+ TuXeCACzZ27KjfHbWEtcx383YThpSo1MYVf9ddv5eiwVrgxYRusuF4Bjx99YoKRk9TwP1IN0+9t AP97kdZrUvEqc711/l0uKqTuypHL4KE6i8XBPpMdwg4PoMlYwbpm5ghb+htkRFb5xJ6nDoImh0i jxs/gYgApz7wm40J1czgLkY1ijUoKs14z5sslLtofl2hGUxSfjGdAbU2Nh1oeVaMTQyNHEDEKTB mkChMrPoH/EepAscZPA/okqL3VScmH/5Hl2AYwOmPro0khmLgQCBAH/Vx4X9Yo2gUnxsqHvCjA8 LeiWP03/nAGMa8K7cHmBHQNQ5c23mI+WhcBfOW8bZohVreYT 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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/gpu/drm/tests/drm_kunit_helpers.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.c b/drivers/gpu/drm/tests/drm_kunit_helpers.c index e98b4150f556..049b98daedbb 100644 --- a/drivers/gpu/drm/tests/drm_kunit_helpers.c +++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c @@ -19,14 +19,13 @@ static int fake_probe(struct platform_device *pdev) return 0; } -static int fake_remove(struct platform_device *pdev) +static void fake_remove(struct platform_device *pdev) { - return 0; } static struct platform_driver fake_platform_driver = { .probe = fake_probe, - .remove = fake_remove, + .remove_new = fake_remove, .driver = { .name = KUNIT_DEVICE_NAME, }, From patchwork Sun May 7 16:26: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: 13233830 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB08BC77B75 for ; Sun, 7 May 2023 16:27:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 59EE010E2B8; Sun, 7 May 2023 16:27:22 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9B86310E208 for ; Sun, 7 May 2023 16:26:45 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDd-0002Mf-0o; Sun, 07 May 2023 18:26:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDc-001nEp-9F; Sun, 07 May 2023 18:26:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDb-002Aie-JK; Sun, 07 May 2023 18:26:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jyri Sarha , Tomi Valkeinen , David Airlie , Daniel Vetter Subject: [PATCH 46/53] drm/tidss: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:09 +0200 Message-Id: <20230507162616.1368908-47-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1764; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ANtzq8/9UZCNsbM/IixKvj1bO4fEdw+5f3XsndyCFpk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EaAL0rDPIg0dHrT08sSCrCNpSJxIxKsO4TU TC3Lsz1PpGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRGgAKCRCPgPtYfRL+ TknQCACGiI4h0d+Cz1zbRoCsNjEDkjYUnJIZoeS+Y2qvDjDZK3oF/5LLQHIiJwXPX62ix2OSIRz zvIPICLoAo0pVFF5ihdNByco+M29AS1h4Xmc3lCAglCzuesBvK3y3xH1Xz7asTnx2uSo5uKF/P9 jZqZJJixne9aZJ98QiMGMfEOwraWtuhMBdnLXgGS8tWek8rlzWpQUrtjjgYwXjuJXqsyI/eGEL+ kiV48F3lDGasCwFYW4E0dErV9HhAC+mWiqw3MKo/wsXLWpAleOjFplrgcLOS0Huupx6BtM3QdDz e7BLVUNCw8BKTtrA1rnaxBKjaa/zklsU6k23G7kVk5IiCiXw 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c index 2dac8727d2f4..13177d58c8f9 100644 --- a/drivers/gpu/drm/tidss/tidss_drv.c +++ b/drivers/gpu/drm/tidss/tidss_drv.c @@ -197,7 +197,7 @@ static int tidss_probe(struct platform_device *pdev) return ret; } -static int tidss_remove(struct platform_device *pdev) +static void tidss_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct tidss_device *tidss = platform_get_drvdata(pdev); @@ -221,8 +221,6 @@ static int tidss_remove(struct platform_device *pdev) dispc_remove(tidss); dev_dbg(dev, "%s done\n", __func__); - - return 0; } static void tidss_shutdown(struct platform_device *pdev) @@ -241,7 +239,7 @@ MODULE_DEVICE_TABLE(of, tidss_of_table); static struct platform_driver tidss_platform_driver = { .probe = tidss_probe, - .remove = tidss_remove, + .remove_new = tidss_remove, .shutdown = tidss_shutdown, .driver = { .name = "tidss", From patchwork Sun May 7 16:26:10 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: 13233809 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0AABC7EE2C for ; Sun, 7 May 2023 16:27:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4EE9610E285; Sun, 7 May 2023 16:26:59 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id CA5E610E208 for ; Sun, 7 May 2023 16:26:44 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDd-0002NJ-Es; Sun, 07 May 2023 18:26:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDc-001nF2-M3; Sun, 07 May 2023 18:26:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDb-002Aii-UE; Sun, 07 May 2023 18:26:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jyri Sarha , David Airlie , Daniel Vetter Subject: [PATCH 47/53] drm/tilcdc: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:10 +0200 Message-Id: <20230507162616.1368908-48-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1813; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=wQYiy0fDSmEVU6s8ZTX35+j1+tLPKcW8seo/kSoEsOc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EboLQqKyB+U1xLhuk5p7gL/ni0E4o4pg86T S2yEzzh8s2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRGwAKCRCPgPtYfRL+ Th7oCACxD509e7JwbenUizQEG8m6LJ8klYLaV8DS4EANoZeooHsDAqMs1CmKG+5BHKZ9XjeSHQO zpr0xEAKz652qGxQR9wIqGxlA1ret2zuYymhXvd9NrDjzMUQA+4gWHPat9hTWCPRGC5XFhESt2q PQ5vJOqyfS1SOJHrdX8M+BW0/cyd0Q3rg2rHSDzM0t9+VHAVeM0kuu0UtVukQ2PVU+lnSMHO14L gWz7W9bNfooPDYVupdEyBgoaTJtGXqdS0ECBVGmKGvXwWV/brn9MzSk+eH7c7sucfavv/2X+llq /ofROSbDnTWtEXl+Wn2jYzgBMIi13MiBR5xrnh5bx2dNb0ei 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org, Tomi Valkeinen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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/gpu/drm/tilcdc/tilcdc_panel.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c index 2729e16bc053..9aefd010acde 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c @@ -374,7 +374,7 @@ static int panel_probe(struct platform_device *pdev) return ret; } -static int panel_remove(struct platform_device *pdev) +static void panel_remove(struct platform_device *pdev) { struct tilcdc_module *mod = dev_get_platdata(&pdev->dev); struct panel_module *panel_mod = to_panel_module(mod); @@ -387,8 +387,6 @@ static int panel_remove(struct platform_device *pdev) tilcdc_module_cleanup(mod); kfree(panel_mod->info); - - return 0; } static const struct of_device_id panel_of_match[] = { @@ -398,7 +396,7 @@ static const struct of_device_id panel_of_match[] = { static struct platform_driver panel_driver = { .probe = panel_probe, - .remove = panel_remove, + .remove_new = panel_remove, .driver = { .name = "tilcdc-panel", .of_match_table = panel_of_match, From patchwork Sun May 7 16:26:11 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: 13233793 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B9BDC7EE2A for ; Sun, 7 May 2023 16:27:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F60510E208; Sun, 7 May 2023 16:26:47 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4665910E222 for ; Sun, 7 May 2023 16:26:44 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDd-0002NU-Ms; Sun, 07 May 2023 18:26:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDc-001nF5-Sl; Sun, 07 May 2023 18:26:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDc-002Ail-5j; Sun, 07 May 2023 18:26:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alexey Brodkin , David Airlie , Daniel Vetter Subject: [PATCH 48/53] drm/tiny: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:11 +0200 Message-Id: <20230507162616.1368908-49-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1636; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YBWtrG3wx/uqLLlEiAeg9FqxCra+wH9O9gIXPtRKyGU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9Ec4lbjiJrzAtey6HhHPKlo2qIjI1BqX2cjI OX1QQSNqQqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRHAAKCRCPgPtYfRL+ TtwSB/9h9ZcS35pUGgxUS59cDYpIfirsfj2dH3bgS8Jn7xdaR7uugdvFZsjpOYAU/GUUIko+8c1 k3CyU0oLABszbYLxmgBiLtvurugO2kSMFe4od3Y406o7f5qTJiv8WITWd/fGSyA9JXsWsXNlJXy g895P2yBmf4dev/PyG0zjjGuZfmVDp+s8Ga1DG+bBWS5GWasUUr71ywt6B2R5lgDbFVfE/TMisg OQYsuJXOmuWJwde4ofEIoe5mmcdqAYCmlez4JpFnp/4rxLdx0xq7XByr7V4i6UDc5l+ela7n/A5 e590VSbQuSNBTXyu+/QsCZ7L6Gk2Tv0PwnMQ8Jr9vzOz+axe 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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/gpu/drm/tiny/arcpgu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c index 611bbee15071..a1f998a85ce8 100644 --- a/drivers/gpu/drm/tiny/arcpgu.c +++ b/drivers/gpu/drm/tiny/arcpgu.c @@ -404,14 +404,12 @@ static int arcpgu_probe(struct platform_device *pdev) return ret; } -static int arcpgu_remove(struct platform_device *pdev) +static void arcpgu_remove(struct platform_device *pdev) { struct drm_device *drm = platform_get_drvdata(pdev); drm_dev_unregister(drm); arcpgu_unload(drm); - - return 0; } static const struct of_device_id arcpgu_of_table[] = { @@ -423,7 +421,7 @@ MODULE_DEVICE_TABLE(of, arcpgu_of_table); static struct platform_driver arcpgu_platform_driver = { .probe = arcpgu_probe, - .remove = arcpgu_remove, + .remove_new = arcpgu_remove, .driver = { .name = "arcpgu", .of_match_table = arcpgu_of_table, From patchwork Sun May 7 16:26: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: 13233821 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5DF77C77B7C for ; Sun, 7 May 2023 16:27:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6414C10E29D; Sun, 7 May 2023 16:27:15 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id ADC4910E222 for ; Sun, 7 May 2023 16:26:44 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDd-0002Nj-Pe; Sun, 07 May 2023 18:26:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDd-001nF8-1H; Sun, 07 May 2023 18:26:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDc-002Aip-DD; Sun, 07 May 2023 18:26:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thomas Zimmermann , Javier Martinez Canillas , David Airlie , Daniel Vetter Subject: [PATCH 49/53] drm/tiny: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:12 +0200 Message-Id: <20230507162616.1368908-50-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2584; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=dYYyyo4+LY/VFUeJLkEEbZWS3DQydlOZFHCyvkhaKYA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EddWGFQBeefgXyua+MHnBKutu6XfSOK8+3g sT2WAENx4mJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRHQAKCRCPgPtYfRL+ ThsnB/4ycJgfp8m++ktlHzN5yXTLJPI3wCW7OeujkfNaVq+de7BFsMqPvLanj1vBuQq5AEYzyRs J1bN3b0TmZiXpy2tqMJleLIbAVA+Ukd4YnqlIs1HzY4f/aVxbtQzAOpf9VTAKm2PhqyJ6G2d6jS ZEg2YwpU3nZkmvy8RRaj4dMs8rPM5niGdwccEq3yTVim9qkZfJEVRAJyXtD20vMZf/2zg220ja0 6t2zZC004S2x5yqRH9A4m6GX/gOFyDfm85Xi+lOGfOaPPjjN9nn/uJwRpFH7rvoC11QP+m7kcSu vH2T6C5DVcrfaxjjv6sSiEKSCQRNUQX+fMVpoWAJPmBONaGD 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the tiny drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/tiny/ofdrm.c | 6 ++---- drivers/gpu/drm/tiny/simpledrm.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/gpu/drm/tiny/ofdrm.c index 6e349ca42485..e110f2e2c2a5 100644 --- a/drivers/gpu/drm/tiny/ofdrm.c +++ b/drivers/gpu/drm/tiny/ofdrm.c @@ -1373,13 +1373,11 @@ static int ofdrm_probe(struct platform_device *pdev) return 0; } -static int ofdrm_remove(struct platform_device *pdev) +static void ofdrm_remove(struct platform_device *pdev) { struct drm_device *dev = platform_get_drvdata(pdev); drm_dev_unplug(dev); - - return 0; } static const struct of_device_id ofdrm_of_match_display[] = { @@ -1394,7 +1392,7 @@ static struct platform_driver ofdrm_platform_driver = { .of_match_table = ofdrm_of_match_display, }, .probe = ofdrm_probe, - .remove = ofdrm_remove, + .remove_new = ofdrm_remove, }; module_platform_driver(ofdrm_platform_driver); diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index 63881a3754f8..369c236a2fad 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -875,14 +875,12 @@ static int simpledrm_probe(struct platform_device *pdev) return 0; } -static int simpledrm_remove(struct platform_device *pdev) +static void simpledrm_remove(struct platform_device *pdev) { struct simpledrm_device *sdev = platform_get_drvdata(pdev); struct drm_device *dev = &sdev->dev; drm_dev_unplug(dev); - - return 0; } static const struct of_device_id simpledrm_of_match_table[] = { @@ -897,7 +895,7 @@ static struct platform_driver simpledrm_platform_driver = { .of_match_table = simpledrm_of_match_table, }, .probe = simpledrm_probe, - .remove = simpledrm_remove, + .remove_new = simpledrm_remove, }; module_platform_driver(simpledrm_platform_driver); From patchwork Sun May 7 16:26: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: 13233822 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 910F8C77B75 for ; Sun, 7 May 2023 16:27:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB66410E2AB; Sun, 7 May 2023 16:27:16 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id A553E10E208 for ; Sun, 7 May 2023 16:26:44 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDe-0002Pf-C3; Sun, 07 May 2023 18:26:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDd-001nFH-Lh; Sun, 07 May 2023 18:26:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDc-002Aiv-U3; Sun, 07 May 2023 18:26:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , David Airlie , Daniel Vetter Subject: [PATCH 50/53] drm/tve200: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:13 +0200 Message-Id: <20230507162616.1368908-51-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1811; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=vGjJBvcivbnBp25/14A4nQLu3+v6C3xFZKaEa1GpKhE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EevaQMVw1ArLbyv9Hud2+I17hSIG+Pk4NJ/ KvrD7vksOOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRHgAKCRCPgPtYfRL+ TvYOB/9mtUnY/c3yAncAydaqELq/kF9B/P3JROZohg+pYObecw+2k7xtzKL+3ojmJR8NvNvp8Be CceWdgt6MxzgLRtKEXgF5K6vLAEuRVmDb1mkurL3MX6ECJFkjAlbWVKcQy4MtXe2bZHaTsQo3Od PLRP4mb2/dpiImkuxHuLVVtLD0tv2j1OWkgjl6gjU3F+pL/pWxYplW94vgBbdqUh/7WL2Kx+PFW gXL6hxSx9eQjbdm5V1dM4Z/kMaobxNJRiMz2sdmCUTWAcE16C9nfiGnIvxAPI0eRHnzQukK7b0r 3YRXeibsrOucma4wJDW9EIw/5uhpul754Tkf4H/xF69fawcz 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Linus Walleij --- drivers/gpu/drm/tve200/tve200_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c index 0d05c386d303..0d98939d7aed 100644 --- a/drivers/gpu/drm/tve200/tve200_drv.c +++ b/drivers/gpu/drm/tve200/tve200_drv.c @@ -238,7 +238,7 @@ static int tve200_probe(struct platform_device *pdev) return ret; } -static int tve200_remove(struct platform_device *pdev) +static void tve200_remove(struct platform_device *pdev) { struct drm_device *drm = platform_get_drvdata(pdev); struct tve200_drm_dev_private *priv = drm->dev_private; @@ -249,8 +249,6 @@ static int tve200_remove(struct platform_device *pdev) drm_mode_config_cleanup(drm); clk_disable_unprepare(priv->pclk); drm_dev_put(drm); - - return 0; } static const struct of_device_id tve200_of_match[] = { @@ -266,7 +264,7 @@ static struct platform_driver tve200_driver = { .of_match_table = of_match_ptr(tve200_of_match), }, .probe = tve200_probe, - .remove = tve200_remove, + .remove_new = tve200_remove, }; drm_module_platform_driver(tve200_driver); From patchwork Sun May 7 16:26: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: 13233811 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F143CC7EE2C for ; Sun, 7 May 2023 16:27:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6CC1010E26B; Sun, 7 May 2023 16:26:59 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id D1D7B10E208 for ; Sun, 7 May 2023 16:26:45 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDe-0002R0-Oe; Sun, 07 May 2023 18:26:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDe-001nFR-1f; Sun, 07 May 2023 18:26:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDd-002Aj0-5B; Sun, 07 May 2023 18:26:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Emma Anholt , Melissa Wen , David Airlie , Daniel Vetter Subject: [PATCH 51/53] drm/v3d: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:14 +0200 Message-Id: <20230507162616.1368908-52-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1724; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rMBHnjxgwGUtU5HMMbHtzInmZ9Ibbm8DlkCjpcN9FwI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9Eg+twY47vhfug3B3L4Uu0QfWL4oYUFj/xj2 w29bzIfT/GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRIAAKCRCPgPtYfRL+ Tq1sB/40PEdwHUmzI5Vn5wd/ByMgnSULZZuMRp7n0/pacZgvFdtLBRqulrNbNHHnWYX7kOBzOgL bc8kawFD8uVk9URZ27uR4Pf5lF23m1NxSWU+kfIcRodB8B2H5xBTQN/BEHydxPjvcujegrXYh5u CCabJVAPJMqIQC06ghWQaPyh5D2Ry+lsCnasF4swFgQjgVS8/bhOmvKp1y//NQP3a70O/l66Od0 NlDpGGlqSnOlPjl1Q2KF1CGa+2lE6yTFankdoAgRtn5A9UFjnnfjyKfwXYgcuaDnh4odokxR2Ll vjmaHBSJWVqQdkHPC2iIapPAQn3cdeedCkfi5xugcuiuLhMh 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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/gpu/drm/v3d/v3d_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c index 478f1f0f60de..71f9fdde24b4 100644 --- a/drivers/gpu/drm/v3d/v3d_drv.c +++ b/drivers/gpu/drm/v3d/v3d_drv.c @@ -295,7 +295,7 @@ static int v3d_platform_drm_probe(struct platform_device *pdev) return ret; } -static int v3d_platform_drm_remove(struct platform_device *pdev) +static void v3d_platform_drm_remove(struct platform_device *pdev) { struct drm_device *drm = platform_get_drvdata(pdev); struct v3d_dev *v3d = to_v3d_dev(drm); @@ -306,13 +306,11 @@ static int v3d_platform_drm_remove(struct platform_device *pdev) dma_free_wc(v3d->drm.dev, 4096, v3d->mmu_scratch, v3d->mmu_scratch_paddr); - - return 0; } static struct platform_driver v3d_platform_driver = { .probe = v3d_platform_drm_probe, - .remove = v3d_platform_drm_remove, + .remove_new = v3d_platform_drm_remove, .driver = { .name = "v3d", .of_match_table = v3d_of_match, From patchwork Sun May 7 16:26:15 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: 13233815 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A93FC7EE24 for ; Sun, 7 May 2023 16:27:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D61010E270; Sun, 7 May 2023 16:27:14 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 443BA10E208 for ; Sun, 7 May 2023 16:26:46 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDf-0002RV-3j; Sun, 07 May 2023 18:26:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDe-001nFV-Cw; Sun, 07 May 2023 18:26:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDd-002Aj3-O7; Sun, 07 May 2023 18:26:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Emma Anholt , Maxime Ripard , David Airlie , Daniel Vetter Subject: [PATCH 52/53] drm/vc4: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:15 +0200 Message-Id: <20230507162616.1368908-53-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=8630; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nfrfwqYQjIm1czb9ptBsTxPEmdWlCN2i4J/5GgZbvJw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EheAE6OUCeSKp98EdfGdLhk3UXQ/pBU6myd JoDWPh6vQqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRIQAKCRCPgPtYfRL+ Tio+CACAj74kEXLdn9At3/ysMSkqlaBX37C2Ax3Dg1CM2QkJlwCk7+zfqdhWgu2oQfdfVPj4lcY 3xY1P6o0sfbLDgG3FZKOq6tgPHMBRN95BDkKwsC3Xcp7lxLXipoTcVbdX6IoEjcS1Pb8/TivLQB C5c0A4iRnjxYmDPGLCUCq02EUchUQ3A6pkSF9rofYWncfpIqoGAMXLGY13iRpdGRnrTjmrwN/RV RK4fiVGiDNdhf1sQHMAIdL+InV02foyC9m6lGI4q7PhwnVkmDQTgaS3J2I+0UyqsoM2r9WaEBXg G1wjFlgLRO93YbxbDSdcvkN+ZzlyGQ82q3tuAAjtyX0XHplU 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. Trivially convert the vc4 drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Dave Stevenson --- drivers/gpu/drm/vc4/vc4_crtc.c | 5 ++--- drivers/gpu/drm/vc4/vc4_dpi.c | 5 ++--- drivers/gpu/drm/vc4/vc4_drv.c | 6 ++---- drivers/gpu/drm/vc4/vc4_dsi.c | 6 ++---- drivers/gpu/drm/vc4/vc4_hdmi.c | 5 ++--- drivers/gpu/drm/vc4/vc4_hvs.c | 5 ++--- drivers/gpu/drm/vc4/vc4_txp.c | 5 ++--- drivers/gpu/drm/vc4/vc4_v3d.c | 5 ++--- drivers/gpu/drm/vc4/vc4_vec.c | 5 ++--- 9 files changed, 18 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index bef9d45ef1df..7610e841ef3c 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -1450,15 +1450,14 @@ static int vc4_crtc_dev_probe(struct platform_device *pdev) return component_add(&pdev->dev, &vc4_crtc_ops); } -static int vc4_crtc_dev_remove(struct platform_device *pdev) +static void vc4_crtc_dev_remove(struct platform_device *pdev) { component_del(&pdev->dev, &vc4_crtc_ops); - return 0; } struct platform_driver vc4_crtc_driver = { .probe = vc4_crtc_dev_probe, - .remove = vc4_crtc_dev_remove, + .remove_new = vc4_crtc_dev_remove, .driver = { .name = "vc4_crtc", .of_match_table = vc4_crtc_dt_match, diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c index f518d6e59ed6..e67856ae9d75 100644 --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c @@ -391,15 +391,14 @@ static int vc4_dpi_dev_probe(struct platform_device *pdev) return component_add(&pdev->dev, &vc4_dpi_ops); } -static int vc4_dpi_dev_remove(struct platform_device *pdev) +static void vc4_dpi_dev_remove(struct platform_device *pdev) { component_del(&pdev->dev, &vc4_dpi_ops); - return 0; } struct platform_driver vc4_dpi_driver = { .probe = vc4_dpi_dev_probe, - .remove = vc4_dpi_dev_remove, + .remove_new = vc4_dpi_dev_remove, .driver = { .name = "vc4_dpi", .of_match_table = vc4_dpi_dt_match, diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 0ccaee57fe9a..cee41e318bf9 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -439,11 +439,9 @@ static int vc4_platform_drm_probe(struct platform_device *pdev) return component_master_add_with_match(dev, &vc4_drm_ops, match); } -static int vc4_platform_drm_remove(struct platform_device *pdev) +static void vc4_platform_drm_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &vc4_drm_ops); - - return 0; } static const struct of_device_id vc4_of_match[] = { @@ -456,7 +454,7 @@ MODULE_DEVICE_TABLE(of, vc4_of_match); static struct platform_driver vc4_platform_driver = { .probe = vc4_platform_drm_probe, - .remove = vc4_platform_drm_remove, + .remove_new = vc4_platform_drm_remove, .driver = { .name = "vc4-drm", .of_match_table = vc4_of_match, diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c index a5c075f802e4..839d7d682842 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -1830,20 +1830,18 @@ static int vc4_dsi_dev_probe(struct platform_device *pdev) return 0; } -static int vc4_dsi_dev_remove(struct platform_device *pdev) +static void vc4_dsi_dev_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct vc4_dsi *dsi = dev_get_drvdata(dev); mipi_dsi_host_unregister(&dsi->dsi_host); vc4_dsi_put(dsi); - - return 0; } struct platform_driver vc4_dsi_driver = { .probe = vc4_dsi_dev_probe, - .remove = vc4_dsi_dev_remove, + .remove_new = vc4_dsi_dev_remove, .driver = { .name = "vc4_dsi", .of_match_table = vc4_dsi_dt_match, diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index ea22c9bf223a..0c4aef532521 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -3561,10 +3561,9 @@ static int vc4_hdmi_dev_probe(struct platform_device *pdev) return component_add(&pdev->dev, &vc4_hdmi_ops); } -static int vc4_hdmi_dev_remove(struct platform_device *pdev) +static void vc4_hdmi_dev_remove(struct platform_device *pdev) { component_del(&pdev->dev, &vc4_hdmi_ops); - return 0; } static const struct vc4_hdmi_variant bcm2835_variant = { @@ -3660,7 +3659,7 @@ static const struct dev_pm_ops vc4_hdmi_pm_ops = { struct platform_driver vc4_hdmi_driver = { .probe = vc4_hdmi_dev_probe, - .remove = vc4_hdmi_dev_remove, + .remove_new = vc4_hdmi_dev_remove, .driver = { .name = "vc4_hdmi", .of_match_table = vc4_hdmi_dt_match, diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 4da66ef96783..04af672caacb 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -1061,10 +1061,9 @@ static int vc4_hvs_dev_probe(struct platform_device *pdev) return component_add(&pdev->dev, &vc4_hvs_ops); } -static int vc4_hvs_dev_remove(struct platform_device *pdev) +static void vc4_hvs_dev_remove(struct platform_device *pdev) { component_del(&pdev->dev, &vc4_hvs_ops); - return 0; } static const struct of_device_id vc4_hvs_dt_match[] = { @@ -1075,7 +1074,7 @@ static const struct of_device_id vc4_hvs_dt_match[] = { struct platform_driver vc4_hvs_driver = { .probe = vc4_hvs_dev_probe, - .remove = vc4_hvs_dev_remove, + .remove_new = vc4_hvs_dev_remove, .driver = { .name = "vc4_hvs", .of_match_table = vc4_hvs_dt_match, diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c index ef5cab2a3aa9..8152c8325c13 100644 --- a/drivers/gpu/drm/vc4/vc4_txp.c +++ b/drivers/gpu/drm/vc4/vc4_txp.c @@ -577,10 +577,9 @@ static int vc4_txp_probe(struct platform_device *pdev) return component_add(&pdev->dev, &vc4_txp_ops); } -static int vc4_txp_remove(struct platform_device *pdev) +static void vc4_txp_remove(struct platform_device *pdev) { component_del(&pdev->dev, &vc4_txp_ops); - return 0; } static const struct of_device_id vc4_txp_dt_match[] = { @@ -590,7 +589,7 @@ static const struct of_device_id vc4_txp_dt_match[] = { struct platform_driver vc4_txp_driver = { .probe = vc4_txp_probe, - .remove = vc4_txp_remove, + .remove_new = vc4_txp_remove, .driver = { .name = "vc4_txp", .of_match_table = vc4_txp_dt_match, diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c index 29a664c8bf44..04ac7805e6d5 100644 --- a/drivers/gpu/drm/vc4/vc4_v3d.c +++ b/drivers/gpu/drm/vc4/vc4_v3d.c @@ -532,10 +532,9 @@ static int vc4_v3d_dev_probe(struct platform_device *pdev) return component_add(&pdev->dev, &vc4_v3d_ops); } -static int vc4_v3d_dev_remove(struct platform_device *pdev) +static void vc4_v3d_dev_remove(struct platform_device *pdev) { component_del(&pdev->dev, &vc4_v3d_ops); - return 0; } const struct of_device_id vc4_v3d_dt_match[] = { @@ -547,7 +546,7 @@ const struct of_device_id vc4_v3d_dt_match[] = { struct platform_driver vc4_v3d_driver = { .probe = vc4_v3d_dev_probe, - .remove = vc4_v3d_dev_remove, + .remove_new = vc4_v3d_dev_remove, .driver = { .name = "vc4_v3d", .of_match_table = vc4_v3d_dt_match, diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c index a3782d05cd66..0bbda1872881 100644 --- a/drivers/gpu/drm/vc4/vc4_vec.c +++ b/drivers/gpu/drm/vc4/vc4_vec.c @@ -818,15 +818,14 @@ static int vc4_vec_dev_probe(struct platform_device *pdev) return component_add(&pdev->dev, &vc4_vec_ops); } -static int vc4_vec_dev_remove(struct platform_device *pdev) +static void vc4_vec_dev_remove(struct platform_device *pdev) { component_del(&pdev->dev, &vc4_vec_ops); - return 0; } struct platform_driver vc4_vec_driver = { .probe = vc4_vec_dev_probe, - .remove = vc4_vec_dev_remove, + .remove_new = vc4_vec_dev_remove, .driver = { .name = "vc4_vec", .of_match_table = vc4_vec_dt_match, From patchwork Sun May 7 16:26: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: 13233826 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 33A2CC7EE24 for ; Sun, 7 May 2023 16:27:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C5ACC10E2A8; Sun, 7 May 2023 16:27:19 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id ECF1810E236 for ; Sun, 7 May 2023 16:26:47 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvhDf-0002St-Lm; Sun, 07 May 2023 18:26:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvhDe-001nFb-Tt; Sun, 07 May 2023 18:26:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvhDd-002Aj7-Uo; Sun, 07 May 2023 18:26:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hyun Kwon , Laurent Pinchart , David Airlie , Daniel Vetter , Michal Simek Subject: [PATCH 53/53] drm/xlnx/zynqmp_dpsub: Convert to platform remove callback returning void Date: Sun, 7 May 2023 18:26:16 +0200 Message-Id: <20230507162616.1368908-54-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1811; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=1OFs8gq9rcSiY3GC5R+mWCCoyWzrijWJ9r/w+MBqonM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkV9EiTx+gk5mp2TKtlfxQrqKj9xImTutMUGqlq xnaa0ezCZyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZFfRIgAKCRCPgPtYfRL+ TjZ7B/44JNFHQi7+aKJ3eO+2lyO5+Em+POl0KA03pQ4VsKrqTw+ZawNSVn+nSm3rFfQkbZSLBkE 2TZaYI1DDTeuPOSOyJUg2emUJYdnoo8kYLgSd7FznkF4sZ0SUiq3JQ8EV3lBXu1I0r41QU5dAJK wETBQ8O2eaPInIKYtugHbGQ9ei0n5UdEmC+p5O12jJ3M7JW75HTc1XLef2iAkdX/kA1rD5/izpw d2LJepHvVtIUup6BZ9F/UY/D+ZKZVX73GXFOsBxGyxaB7o37fnptz4VB4/RAfb90y0vXFLreX5S w3/gSGgXMtP3retHvz5gXqNCeMKw3AOj4ouY4QQviGaQD/6p 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 (mostly) ignored 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. 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: Laurent Pinchart --- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c index bab862484d42..9d64a8d98372 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c @@ -280,7 +280,7 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev) return ret; } -static int zynqmp_dpsub_remove(struct platform_device *pdev) +static void zynqmp_dpsub_remove(struct platform_device *pdev) { struct zynqmp_dpsub *dpsub = platform_get_drvdata(pdev); @@ -298,8 +298,6 @@ static int zynqmp_dpsub_remove(struct platform_device *pdev) if (!dpsub->drm) zynqmp_dpsub_release(dpsub); - - return 0; } static void zynqmp_dpsub_shutdown(struct platform_device *pdev) @@ -320,7 +318,7 @@ MODULE_DEVICE_TABLE(of, zynqmp_dpsub_of_match); static struct platform_driver zynqmp_dpsub_driver = { .probe = zynqmp_dpsub_probe, - .remove = zynqmp_dpsub_remove, + .remove_new = zynqmp_dpsub_remove, .shutdown = zynqmp_dpsub_shutdown, .driver = { .name = "zynqmp-dpsub",