From patchwork Mon Apr 3 15:39: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: 13198316 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1159C77B6C for ; Mon, 3 Apr 2023 15:40:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232921AbjDCPkg (ORCPT ); Mon, 3 Apr 2023 11:40:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232959AbjDCPkd (ORCPT ); Mon, 3 Apr 2023 11:40:33 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 488AD26B9 for ; Mon, 3 Apr 2023 08:40:32 -0700 (PDT) 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 1pjMIA-0004bc-RK; Mon, 03 Apr 2023 17:40:22 +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 1pjMI7-008iar-4k; Mon, 03 Apr 2023 17:40:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pjMI6-00AHwh-53; Mon, 03 Apr 2023 17:40:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Eugen Hristev , Mauro Carvalho Chehab , Greg Kroah-Hartman , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 06/24] staging: media: atmel-sama5d2-isc: Convert to platform remove callback returning void Date: Mon, 3 Apr 2023 17:39:56 +0200 Message-Id: <20230403154014.2564054-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> References: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1907; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=3eWA9wqLohjTkdU86NEwfGho6Mb4eBfhtOu2ZNBEJRM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKvM7k50m5cP0X2ccwpM4B8PZF/oH0lUbfXssN 8SepfYAIL2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCrzOwAKCRCPgPtYfRL+ TtzHB/9I6LdPHbPBc3TvWgIX077VkCy8Pchxdxs3b5gBVFsvuYNu6eppwxpzNTfYlDUzKyDuThh dDcXIurj1WoAS+baufacQxpgeFI6zL6xgQTLIMAZWi9mDdxgHcMyDRb26GdywuHRJb4ND312yVu 3QJdN9lr/5mkY88sXbvFJkIDLlhEAD3hhpu19H4cWsYhbV0H+ROmk42Bk5HF2lw84iXSCeFdxHc cYl2F9O5TR1EOXpXoABlMRiP2k2hsWZkeL9r+EU2P27LQKlEDEAQ4y8VbQ22ZqHP55phnTKngBO oE+2I1UyF+7c14QPUylwxyGAbUWJ7cDNcYwsGF4PlvzF2DMd 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: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (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: Nicolas Ferre --- drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c index ba0614f981a2..cc744cea1d0e 100644 --- a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c +++ b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c @@ -580,7 +580,7 @@ static int atmel_isc_probe(struct platform_device *pdev) return ret; } -static int atmel_isc_remove(struct platform_device *pdev) +static void atmel_isc_remove(struct platform_device *pdev) { struct isc_device *isc = platform_get_drvdata(pdev); @@ -594,8 +594,6 @@ static int atmel_isc_remove(struct platform_device *pdev) clk_disable_unprepare(isc->hclock); atmel_isc_clk_cleanup(isc); - - return 0; } static int __maybe_unused isc_runtime_suspend(struct device *dev) @@ -638,7 +636,7 @@ MODULE_DEVICE_TABLE(of, atmel_isc_of_match); static struct platform_driver atmel_isc_driver = { .probe = atmel_isc_probe, - .remove = atmel_isc_remove, + .remove_new = atmel_isc_remove, .driver = { .name = "atmel-sama5d2-isc", .pm = &atmel_isc_dev_pm_ops, From patchwork Mon Apr 3 15:39: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: 13198314 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB6DCC76188 for ; Mon, 3 Apr 2023 15:40:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232953AbjDCPke (ORCPT ); Mon, 3 Apr 2023 11:40:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232494AbjDCPkb (ORCPT ); Mon, 3 Apr 2023 11:40:31 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03A6E26B9 for ; Mon, 3 Apr 2023 08:40:30 -0700 (PDT) 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 1pjMIA-0004bH-RH; Mon, 03 Apr 2023 17:40:22 +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 1pjMI6-008ial-Tq; Mon, 03 Apr 2023 17:40:18 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pjMI6-00AHwl-Af; Mon, 03 Apr 2023 17:40:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Eugen Hristev , Mauro Carvalho Chehab , Greg Kroah-Hartman , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 07/24] staging: media: atmel-sama7g5-isc: Convert to platform remove callback returning void Date: Mon, 3 Apr 2023 17:39:57 +0200 Message-Id: <20230403154014.2564054-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> References: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1963; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=PHGREWo2RAqblSSs7lBsLYizzIYrsqvK+Qz5kWHfbdU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKvM8+D49gK4/2jF8TWbzmsUsAeMKa9vJCnp6Q vqAH1YXy0uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCrzPAAKCRCPgPtYfRL+ TgA1B/wLsryHSyT86s6sV+KB/Si4tL/MaiP1ctGQTRkLE5P/5Kh8wICdHdJcGCHdQ36CisWJ8o3 ovHs1vazP9YACwhk+40sSfz6Y8TKP8rbCtiOLfLiI0iMemR53w5vAHT3daAPjbhZS2aGIsD1TkR Nw2oUquEacZxZ7YxDZMe1zxPppmjrLLgnVc+7j9ambJcWNVSk2/c1zom/jgVpu4/hoWgZvHt9Os xg/wTVDeZRhbZ4mvzkYE15mL6e5f7PyHQ4fEDUcImpojiH7LNf3DLQWadhOEt9ps78rvYIAgFxu je7xf30o302lNmqKI/ab2xIhDNcwTMPcTxdHqvmMlaxLn+ZQ 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: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (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: Nicolas Ferre --- drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c index 01ababdfcbd9..315bfc4ac4ff 100644 --- a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c +++ b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c @@ -549,7 +549,7 @@ static int microchip_xisc_probe(struct platform_device *pdev) return ret; } -static int microchip_xisc_remove(struct platform_device *pdev) +static void microchip_xisc_remove(struct platform_device *pdev) { struct isc_device *isc = platform_get_drvdata(pdev); @@ -562,8 +562,6 @@ static int microchip_xisc_remove(struct platform_device *pdev) clk_disable_unprepare(isc->hclock); atmel_isc_clk_cleanup(isc); - - return 0; } static int __maybe_unused xisc_runtime_suspend(struct device *dev) @@ -601,7 +599,7 @@ MODULE_DEVICE_TABLE(of, microchip_xisc_of_match); static struct platform_driver microchip_xisc_driver = { .probe = microchip_xisc_probe, - .remove = microchip_xisc_remove, + .remove_new = microchip_xisc_remove, .driver = { .name = "microchip-sama7g5-xisc", .pm = µchip_xisc_dev_pm_ops, From patchwork Mon Apr 3 15:39: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: 13198312 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4585AC761A6 for ; Mon, 3 Apr 2023 15:40:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232957AbjDCPkd (ORCPT ); Mon, 3 Apr 2023 11:40:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbjDCPk3 (ORCPT ); Mon, 3 Apr 2023 11:40:29 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B941B272C for ; Mon, 3 Apr 2023 08:40:28 -0700 (PDT) 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 1pjMI8-0004bd-A2; Mon, 03 Apr 2023 17:40:20 +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 1pjMI7-008iaq-4L; Mon, 03 Apr 2023 17:40:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pjMI6-00AHwq-HE; Mon, 03 Apr 2023 17:40:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer Cc: Fabio Estevam , NXP Linux Team , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 08/24] staging: media: imx-media-csi: Convert to platform remove callback returning void Date: Mon, 3 Apr 2023 17:39:58 +0200 Message-Id: <20230403154014.2564054-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> References: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1875; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/TgJlWqh3E9BEiNSqoilb4b5PZadfxSh2GHf60q4XpY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKvM+qqUplz861HdJ2wRrV6oCtko8eses/2DWN jkrZC4Kk9yJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCrzPgAKCRCPgPtYfRL+ TjufCACMa0Vd/1PVq1lmXPLJr+WxD4KOvyaUd7o+ljm+kjacOqifklFTV1/IGe9ORfHyKMCfpfR KFSioMkfg5PFNPM4nXE2o+7uO3wvPRsM3NdHWtxfOUcOqV+47G2TnT+/ODcTN5Ky22u9x/+tLjb D3T/i2lpDuQTrLDTzt8AviIomvaJbXvPq8FL5QMP2J5ATYsGQC/aPy2hiLfVz3XeisWE0Qm/504 1yrifrpJ3ZB/NJMA04/m+Q6n3DuWjaXP98Bf9T4b/V8sed6wUyOmYGGbo6+y/w8f7pahQPR+sd5 sY6PEizqNO2hXw0Oh9ZwcedLioDOjHdSbNdbhWpMBHMO9ni7 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: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (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: Philipp Zabel --- drivers/staging/media/imx/imx-media-csi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index 44d87fe30d52..097171bb930d 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -2041,7 +2041,7 @@ static int imx_csi_probe(struct platform_device *pdev) return ret; } -static int imx_csi_remove(struct platform_device *pdev) +static void imx_csi_remove(struct platform_device *pdev) { struct v4l2_subdev *sd = platform_get_drvdata(pdev); struct csi_priv *priv = sd_to_dev(sd); @@ -2052,8 +2052,6 @@ static int imx_csi_remove(struct platform_device *pdev) v4l2_async_nf_cleanup(&priv->notifier); v4l2_async_unregister_subdev(sd); media_entity_cleanup(&sd->entity); - - return 0; } static const struct platform_device_id imx_csi_ids[] = { @@ -2064,7 +2062,7 @@ MODULE_DEVICE_TABLE(platform, imx_csi_ids); static struct platform_driver imx_csi_driver = { .probe = imx_csi_probe, - .remove = imx_csi_remove, + .remove_new = imx_csi_remove, .id_table = imx_csi_ids, .driver = { .name = "imx-ipuv3-csi", From patchwork Mon Apr 3 15:39: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: 13198315 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0DC2C761A6 for ; Mon, 3 Apr 2023 15:40:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232958AbjDCPkf (ORCPT ); Mon, 3 Apr 2023 11:40:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232954AbjDCPkb (ORCPT ); Mon, 3 Apr 2023 11:40:31 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACB3E2703 for ; Mon, 3 Apr 2023 08:40:30 -0700 (PDT) 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 1pjMI8-0004c5-Cd; Mon, 03 Apr 2023 17:40:20 +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 1pjMI7-008ib3-LZ; Mon, 03 Apr 2023 17:40:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pjMI6-00AHx1-MH; Mon, 03 Apr 2023 17:40:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer Cc: Fabio Estevam , NXP Linux Team , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 09/24] staging: media: imx-media-dev: Convert to platform remove callback returning void Date: Mon, 3 Apr 2023 17:39:59 +0200 Message-Id: <20230403154014.2564054-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> References: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1887; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=NfhFuPcQjvCDS+hPh2b2lfedYrohw4g+Wp/gtONhiGU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKvM/opFPgRJzRAhQ0djBHR+kH4ijtoQZPxQSH vRqdlr0X0OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCrzPwAKCRCPgPtYfRL+ TqPrB/9lhe/gnMCeqND74AwxIS0CZ3tnSl3XYP4sBB4SzKl5yi/apYC5nuVR4nyttzMCh/U8YcB M2eGZJ9NSsA+GeU8NlBYLVr61c92He+T8fZQvcXwszDnmse8145ZtYfc0ek0fLnQSARM9jtpTJN ZrBz+68WjU+W3GJAnCfQl+/8lpKvrML3CD2Ex4uHYgUerRQxERxjelNJXphrB9QJB3DMbOerG3t D2i+09jtILM/XMTy9dn9QtvR4V4cZtngP9Zu9ziYzJzmV+GLgSiLpxyl70XfXxKEPc6OKtpRIQB mP6NdUb0C5YCppdg5Li38YiTkyPp10G3sSZ7T3r6uIkUBBS0 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: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (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: Philipp Zabel --- drivers/staging/media/imx/imx-media-dev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c index f85462214e22..c80113905069 100644 --- a/drivers/staging/media/imx/imx-media-dev.c +++ b/drivers/staging/media/imx/imx-media-dev.c @@ -101,7 +101,7 @@ static int imx_media_probe(struct platform_device *pdev) return ret; } -static int imx_media_remove(struct platform_device *pdev) +static void imx_media_remove(struct platform_device *pdev) { struct imx_media_dev *imxmd = (struct imx_media_dev *)platform_get_drvdata(pdev); @@ -119,8 +119,6 @@ static int imx_media_remove(struct platform_device *pdev) media_device_unregister(&imxmd->md); v4l2_device_unregister(&imxmd->v4l2_dev); media_device_cleanup(&imxmd->md); - - return 0; } static const struct of_device_id imx_media_dt_ids[] = { @@ -131,7 +129,7 @@ MODULE_DEVICE_TABLE(of, imx_media_dt_ids); static struct platform_driver imx_media_pdrv = { .probe = imx_media_probe, - .remove = imx_media_remove, + .remove_new = imx_media_remove, .driver = { .name = "imx-media", .of_match_table = imx_media_dt_ids, From patchwork Mon Apr 3 15:40: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: 13198313 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF870C76196 for ; Mon, 3 Apr 2023 15:40:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232964AbjDCPke (ORCPT ); Mon, 3 Apr 2023 11:40:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232921AbjDCPkb (ORCPT ); Mon, 3 Apr 2023 11:40:31 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECC2D26AF for ; Mon, 3 Apr 2023 08:40:29 -0700 (PDT) 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 1pjMI9-0004fz-IM; Mon, 03 Apr 2023 17:40:21 +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 1pjMI8-008ibS-Ko; Mon, 03 Apr 2023 17:40:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pjMI6-00AHx5-RU; Mon, 03 Apr 2023 17:40:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer Cc: Fabio Estevam , NXP Linux Team , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 10/24] staging: media: imx6-mipi-csi2: Convert to platform remove callback returning void Date: Mon, 3 Apr 2023 17:40:00 +0200 Message-Id: <20230403154014.2564054-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> References: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1806; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VesGfwY/ab0E1llkf0F+Vslp4R6aXn1eFkcaZUb2W4Q=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKvNACvBqADPgwr9lh28+4Lhr5AMNZU5h8/1to pxo6FjU3KeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCrzQAAKCRCPgPtYfRL+ TufhCAChTeHFINMnRjLTCpO32W6HiMcXL5Sxx2hNavwpVrNk84jzdUB4NFBkJe1uLyGlV/V2tQC CFAyUmV4wNi+1D4mW3EaI1vqOTF10psjCNG2Fl6CzG9xiEKwNlM3otzSds5HHxLbi8Qw03YXuTY rJMk8begR7/6IlN9KZSjEMux7HUz3j+Kp3WgfcJ1lbcRr48oTwSxGCK7ZwnjJFECeoiSEUpiZuH SCrQ+4o1kSgMc6yzZJx5llt0V4H5lvkIoLN8lHjI+kNxfYYhxpF2kE1pYnTAx6drRzBFAMVEU2U XmykB4tdmpKvBgA5HpCo89iP26B17CnEz8qMqphcYUDHKUj3 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: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (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: Philipp Zabel --- drivers/staging/media/imx/imx6-mipi-csi2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/imx/imx6-mipi-csi2.c b/drivers/staging/media/imx/imx6-mipi-csi2.c index c4cb558a85c6..c07994ea6e96 100644 --- a/drivers/staging/media/imx/imx6-mipi-csi2.c +++ b/drivers/staging/media/imx/imx6-mipi-csi2.c @@ -765,7 +765,7 @@ static int csi2_probe(struct platform_device *pdev) return ret; } -static int csi2_remove(struct platform_device *pdev) +static void csi2_remove(struct platform_device *pdev) { struct v4l2_subdev *sd = platform_get_drvdata(pdev); struct csi2_dev *csi2 = sd_to_dev(sd); @@ -777,8 +777,6 @@ static int csi2_remove(struct platform_device *pdev) clk_disable_unprepare(csi2->pllref_clk); mutex_destroy(&csi2->lock); media_entity_cleanup(&sd->entity); - - return 0; } static const struct of_device_id csi2_dt_ids[] = { @@ -793,7 +791,7 @@ static struct platform_driver csi2_driver = { .of_match_table = csi2_dt_ids, }, .probe = csi2_probe, - .remove = csi2_remove, + .remove_new = csi2_remove, }; module_platform_driver(csi2_driver); From patchwork Mon Apr 3 15:40: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: 13198311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A273C76196 for ; Mon, 3 Apr 2023 15:40:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232946AbjDCPkb (ORCPT ); Mon, 3 Apr 2023 11:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231416AbjDCPk3 (ORCPT ); Mon, 3 Apr 2023 11:40:29 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E01602D47 for ; Mon, 3 Apr 2023 08:40:28 -0700 (PDT) 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 1pjMI8-0004cC-Gm; Mon, 03 Apr 2023 17:40:20 +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 1pjMI7-008ib7-RN; Mon, 03 Apr 2023 17:40:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pjMI7-00AHx9-0l; Mon, 03 Apr 2023 17:40:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer Cc: Fabio Estevam , NXP Linux Team , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 11/24] staging: media: imx8mq-mipi-csi2: Convert to platform remove callback returning void Date: Mon, 3 Apr 2023 17:40:01 +0200 Message-Id: <20230403154014.2564054-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> References: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1999; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=BtEupVcCCs7RO1/F1BhIdgmaaCRS1Hi4HokSIQLkgic=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKvNBWzJPSO90ZsLptRzns82L5qn/LE0Y/2q7e 76i2+H4qRyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCrzQQAKCRCPgPtYfRL+ TsZpB/4v/W0DpX6l95huhebk1ypvr/q3/3/4xTiCnFeGyuUTOgYOemjEdkfCHrjC68uYmXqEjs5 6LCXVf04pJZIN4gQS32XZ28d4dXXaSuZvKtxOYYoCgYQJdoa13yiYo/wCc96LGnEpRtaz7vpDXh cdFw6TVmpEueaSOSpfYKNDDGLCn2m1vNR4aLilP2cnbqywwcQw7ghPIfTFsxkcWB2qEKDeNSEkA o+5zXpyh8o1aKBxHW8sDP13CkGnbaMA4Pa4y34sqX9tSI4ODe8JV499FLJfPwqXZaFjJto/yds9 ps9HkYh4ihIXBihHiaGf1k0Z10TpzrG2L8+Fen8A4Elw4AGx 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: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (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: Philipp Zabel --- drivers/staging/media/imx/imx8mq-mipi-csi2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c index 83194328d010..4317f6b71892 100644 --- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c +++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c @@ -961,7 +961,7 @@ static int imx8mq_mipi_csi_probe(struct platform_device *pdev) return ret; } -static int imx8mq_mipi_csi_remove(struct platform_device *pdev) +static void imx8mq_mipi_csi_remove(struct platform_device *pdev) { struct v4l2_subdev *sd = platform_get_drvdata(pdev); struct csi_state *state = mipi_sd_to_csi2_state(sd); @@ -976,8 +976,6 @@ static int imx8mq_mipi_csi_remove(struct platform_device *pdev) mutex_destroy(&state->lock); pm_runtime_set_suspended(&pdev->dev); imx8mq_mipi_csi_release_icc(pdev); - - return 0; } static const struct of_device_id imx8mq_mipi_csi_of_match[] = { @@ -988,7 +986,7 @@ MODULE_DEVICE_TABLE(of, imx8mq_mipi_csi_of_match); static struct platform_driver imx8mq_mipi_csi_driver = { .probe = imx8mq_mipi_csi_probe, - .remove = imx8mq_mipi_csi_remove, + .remove_new = imx8mq_mipi_csi_remove, .driver = { .of_match_table = imx8mq_mipi_csi_of_match, .name = MIPI_CSI2_DRIVER_NAME, From patchwork Mon Apr 3 15:40: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: 13198309 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83BB7C761AF for ; Mon, 3 Apr 2023 15:40:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232948AbjDCPk1 (ORCPT ); Mon, 3 Apr 2023 11:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232929AbjDCPk0 (ORCPT ); Mon, 3 Apr 2023 11:40:26 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0A4326B9 for ; Mon, 3 Apr 2023 08:40:25 -0700 (PDT) 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 1pjMI8-0004cF-Pm; Mon, 03 Apr 2023 17:40:20 +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 1pjMI7-008ibA-U6; Mon, 03 Apr 2023 17:40:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pjMI7-00AHxC-6k; Mon, 03 Apr 2023 17:40:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Neil Armstrong , Mauro Carvalho Chehab , Greg Kroah-Hartman , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 12/24] staging: media: meson: vdec: Convert to platform remove callback returning void Date: Mon, 3 Apr 2023 17:40:02 +0200 Message-Id: <20230403154014.2564054-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> References: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1583; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=P35Ck+M/VCEEhMxrFcldV2WJMFcTdpa/K3Pjr50rJgY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKvNC+Co7HXuwCgK9dynbHKEeaG/SrHOkFUjJf PSTTykY77WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCrzQgAKCRCPgPtYfRL+ Tq8iB/9x4510NGqWNWqDe3F7xIdKw4MHr48k3D6ErVInKJ8cbY2e9hxwfh+QDDN2NrfyEORhugN dAVuUglboK+yBgqO2sRgzqPeiCe4YxZ0DSE8qz+ZWFeja9SnkRipTWUYSlvA/j79DeEK6qkp+z6 1U1iy14P7YzLKp53mlAYIzl3dRTWwjzsNGPfjxMBxBmDPkztxADjGiTbtewobyMMP6ciUNY0atm D2kYwZNSDgy5gX00iy1hHAj69rYE9VGYUgikPMjRT3vifLU5IiaHa0CL0d2nb1PZNTCa4hqxXt1 Q7+vQd/NqegyuVe3qIBq99mNdpZje2hyLylux42jeV10bvTj 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: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (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: Martin Blumenstingl --- drivers/staging/media/meson/vdec/vdec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c index 52f224d8def1..5ca4b1200831 100644 --- a/drivers/staging/media/meson/vdec/vdec.c +++ b/drivers/staging/media/meson/vdec/vdec.c @@ -1106,19 +1106,17 @@ static int vdec_probe(struct platform_device *pdev) return ret; } -static int vdec_remove(struct platform_device *pdev) +static void vdec_remove(struct platform_device *pdev) { struct amvdec_core *core = platform_get_drvdata(pdev); video_unregister_device(core->vdev_dec); v4l2_device_unregister(&core->v4l2_dev); - - return 0; } static struct platform_driver meson_vdec_driver = { .probe = vdec_probe, - .remove = vdec_remove, + .remove_new = vdec_remove, .driver = { .name = "meson-vdec", .of_match_table = vdec_dt_match, From patchwork Mon Apr 3 15:40: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: 13198308 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EEB5C76196 for ; Mon, 3 Apr 2023 15:40:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232942AbjDCPk0 (ORCPT ); Mon, 3 Apr 2023 11:40:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbjDCPkZ (ORCPT ); Mon, 3 Apr 2023 11:40:25 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A576726A5 for ; Mon, 3 Apr 2023 08:40:24 -0700 (PDT) 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 1pjMI9-0004dE-EM; Mon, 03 Apr 2023 17:40:21 +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 1pjMI8-008ibF-9k; Mon, 03 Apr 2023 17:40:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pjMI7-00AHxH-C1; Mon, 03 Apr 2023 17:40:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laurent Pinchart , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 13/24] staging: media: omap4iss: Convert to platform remove callback returning void Date: Mon, 3 Apr 2023 17:40:03 +0200 Message-Id: <20230403154014.2564054-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> References: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1710; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=LmttZmjRipsYfunmAVzJW77JKrXaCtcrPUXwbO+3O+o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKvNEs/ISVMXu+uvDduq6KvwDWXFnAeckCQiAJ K6+3i+469aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCrzRAAKCRCPgPtYfRL+ Tvw8B/4yHEFO6+EDpP4SnSGogp/Z2+nk8ljGPuz0Huq4ih/Atu70vz35GiRFCSBNOCLvHk4oqVA X2Xln/pEg8nHoBfT4JqHx4xv9zeMZF7enIQLUk0yIGjRiW0bGLadKBmtGn6GYmp0QVIyy/aPD4z uYagMWp7KNB9t44WH2F9emFxhNbBGi8QU7wOxSUgKOvdpRsFqO6yrnirz2FoBBkbuB26srB8vA5 8oVOfijSGh7HxUD2ghdR5wnlfifaPCg/WRVD5MLy6pSOgn9bm01xChiA4HVbTXvAFSIraqXC82m kY7KDY1cNT5gHMziSJyAkWVhwcNMVNds1PO8rj6qDlnMTKAk 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: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (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/staging/media/omap4iss/iss.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c index fa2a36d829d3..0c4283bb48ad 100644 --- a/drivers/staging/media/omap4iss/iss.c +++ b/drivers/staging/media/omap4iss/iss.c @@ -1323,15 +1323,13 @@ static int iss_probe(struct platform_device *pdev) return ret; } -static int iss_remove(struct platform_device *pdev) +static void iss_remove(struct platform_device *pdev) { struct iss_device *iss = platform_get_drvdata(pdev); iss_unregister_entities(iss); media_entity_enum_cleanup(&iss->crashed); iss_cleanup_modules(iss); - - return 0; } static const struct platform_device_id omap4iss_id_table[] = { @@ -1342,7 +1340,7 @@ MODULE_DEVICE_TABLE(platform, omap4iss_id_table); static struct platform_driver iss_driver = { .probe = iss_probe, - .remove = iss_remove, + .remove_new = iss_remove, .id_table = omap4iss_id_table, .driver = { .name = "omap4iss", From patchwork Mon Apr 3 15:40: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: 13198310 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2853C77B6C for ; Mon, 3 Apr 2023 15:40:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232950AbjDCPk2 (ORCPT ); Mon, 3 Apr 2023 11:40:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbjDCPk1 (ORCPT ); Mon, 3 Apr 2023 11:40:27 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CBA226AF for ; Mon, 3 Apr 2023 08:40:26 -0700 (PDT) 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 1pjMIB-0004fG-6D; Mon, 03 Apr 2023 17:40:23 +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 1pjMI8-008ibL-GH; Mon, 03 Apr 2023 17:40:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pjMI7-00AHxK-HR; Mon, 03 Apr 2023 17:40:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Ezequiel Garcia , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 14/24] staging: media: rkvdec: Convert to platform remove callback returning void Date: Mon, 3 Apr 2023 17:40:04 +0200 Message-Id: <20230403154014.2564054-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> References: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1703; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=aYW8yQnBrMkMM77Xam+1yHywljoTQ6r3WzFLmSM8zHo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKvNFHj+rVqhEcmHGr+5GVmb/w2GoHnRBwVd0l EQflEQSGxqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCrzRQAKCRCPgPtYfRL+ Tor+B/9aiLVMyDmNRvI39fdjAvqB99aUsPoL2ns6k0IdyGNhJZsa/VB/3bcOZJIKLG+q7KTZA3Y VOhuzpRAzuLGUDcSz8VKLO9wr17bwM7rGjOA4jHFwgDUf0FCdf629s5l+GinjNKEJwoirx8fXOY Ca8ETjl3uI7nNA36R2Tb67iSyU5GWXm3DblCSQJbT7Q3VkBk5qHPQreaCgd+FMceqqS3Y4yuY1R uni9mOF1vu1RdzRe65jqwpRFPQflADqX61/KWpbBM+AjDrawAFLEek0NgwPB0LdQUEf/MMILvrD l2w3j6sJO82LkdtdsEjBMViNFWATJFAZvNw7yXwPnxiaWW7D 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: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (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/staging/media/rkvdec/rkvdec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c index 7bab7586918c..3df977653ba5 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -1062,14 +1062,13 @@ static int rkvdec_probe(struct platform_device *pdev) return ret; } -static int rkvdec_remove(struct platform_device *pdev) +static void rkvdec_remove(struct platform_device *pdev) { struct rkvdec_dev *rkvdec = platform_get_drvdata(pdev); rkvdec_v4l2_cleanup(rkvdec); pm_runtime_disable(&pdev->dev); pm_runtime_dont_use_autosuspend(&pdev->dev); - return 0; } #ifdef CONFIG_PM @@ -1099,7 +1098,7 @@ static const struct dev_pm_ops rkvdec_pm_ops = { static struct platform_driver rkvdec_driver = { .probe = rkvdec_probe, - .remove = rkvdec_remove, + .remove_new = rkvdec_remove, .driver = { .name = "rkvdec", .of_match_table = of_rkvdec_match, From patchwork Mon Apr 3 15:40: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: 13198317 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B2ADC76188 for ; Mon, 3 Apr 2023 15:40:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231927AbjDCPkh (ORCPT ); Mon, 3 Apr 2023 11:40:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232966AbjDCPkd (ORCPT ); Mon, 3 Apr 2023 11:40:33 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFAFA26BB for ; Mon, 3 Apr 2023 08:40:32 -0700 (PDT) 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 1pjMIA-0004fs-PB; Mon, 03 Apr 2023 17:40:22 +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 1pjMI8-008ibO-Iq; Mon, 03 Apr 2023 17:40:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pjMI7-00AHxO-PK; Mon, 03 Apr 2023 17:40:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Maxime Ripard , Paul Kocialkowski , Mauro Carvalho Chehab , Greg Kroah-Hartman , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 15/24] staging: media: sunxi: cedrus: Convert to platform remove callback returning void Date: Mon, 3 Apr 2023 17:40:05 +0200 Message-Id: <20230403154014.2564054-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> References: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1827; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4rphF2uHdZojhekW3CCbPpn9xzSOrNxB1a5CNnkqM/Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKvNGCAxk1Yw6v6inzB0LxE1nLpf9y0i0UlnlJ uMkbhjSmkeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCrzRgAKCRCPgPtYfRL+ TmzoB/kBkgPlrDjtaABO5jHJwmcsB0ibjdBZPI9YQ8M2/tgDnWxIVgjlP1mzf4NVX4bo9b4tseR cOXSnMqLda1tnct8CzrSV+c6v2RINzXW/t8iLStrhwZeSf3j0O9K/Y7lv5TNZMaXE9NV3zfKvfY BU9DnI5tRlHzBZD4t8Bp6Hs4n1RlRS2nfh47kpMiJv8lSL0buMxS1EurMtA6jUM7nKhn1OcbrNM 540mJ1J+BD8pvsqzbppYZ95z043X6XKy4RRyj8FPxfJKK927u/eSLPqidLzE+bfx6KH/HstEZu8 mDrD+uOFrdo5A4enCB4VQ3trxt//70b2IQmN3MXAXiLvp7yy 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: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (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: Paul Kocialkowski Acked-by: Jernej Skrabec --- drivers/staging/media/sunxi/cedrus/cedrus.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c index a43d5ff66716..3c62376c3e94 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -543,7 +543,7 @@ static int cedrus_probe(struct platform_device *pdev) return ret; } -static int cedrus_remove(struct platform_device *pdev) +static void cedrus_remove(struct platform_device *pdev) { struct cedrus_dev *dev = platform_get_drvdata(pdev); @@ -558,8 +558,6 @@ static int cedrus_remove(struct platform_device *pdev) v4l2_device_unregister(&dev->v4l2_dev); cedrus_hw_remove(dev); - - return 0; } static const struct cedrus_variant sun4i_a10_cedrus_variant = { @@ -706,7 +704,7 @@ static const struct dev_pm_ops cedrus_dev_pm_ops = { static struct platform_driver cedrus_driver = { .probe = cedrus_probe, - .remove = cedrus_remove, + .remove_new = cedrus_remove, .driver = { .name = CEDRUS_NAME, .of_match_table = of_match_ptr(cedrus_dt_match), From patchwork Mon Apr 3 15:40: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: 13198318 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 803EBC76196 for ; Mon, 3 Apr 2023 15:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232619AbjDCPki (ORCPT ); Mon, 3 Apr 2023 11:40:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232494AbjDCPke (ORCPT ); Mon, 3 Apr 2023 11:40:34 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E5432703 for ; Mon, 3 Apr 2023 08:40:33 -0700 (PDT) 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 1pjMIA-0004gM-PC; Mon, 03 Apr 2023 17:40:22 +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 1pjMI8-008ibY-Re; Mon, 03 Apr 2023 17:40:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pjMI7-00AHxU-UW; Mon, 03 Apr 2023 17:40:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Mauro Carvalho Chehab , Greg Kroah-Hartman , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 16/24] staging: media: sun6i-isp: Convert to platform remove callback returning void Date: Mon, 3 Apr 2023 17:40:06 +0200 Message-Id: <20230403154014.2564054-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> References: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1917; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=At1mdpo78r3qN9rDJ8RZgj+BLaFnIaR/L2rgQkSSSDo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkKvNHZoIWpo2JJ6E9tawZMnCv2y0P/Cw4dLLxh npuaLRuEzCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCrzRwAKCRCPgPtYfRL+ TjQIB/9cc1/waoZmGnVeCyEGIPw4CIhnllwgel/LUA5RNBEOkcr8vJoL/jjmU11VUHo8pK306vR AdSjMrgCWWwhiBBjg+/IQEPOqA4UXtbmAezsF2TsnfdoF3NVeiDRwy6hNe1HINKxr2k0M3LYA1B sWEFxbaCrxoP2SpuK0RQMqWExCW2m8DqImxcK20qTUw1Zbr57gTDOtoeg+dpGBlfShWhOr/Ardh temJFRgMl1BJG6Ns6vjA2w+dtsOiPmRxJF468lDxl5omtSBWB+UIdSa1qcRa8T623UXsP+B5LoE 5DXGWQbN6kdoHsDs/ajNvlZZUrp9C189ty/93WPDjcS+gvQM 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: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (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: Paul Kocialkowski Acked-by: Jernej Skrabec --- drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c index 7b7947509b69..0dc75adbd9d8 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c @@ -493,7 +493,7 @@ static int sun6i_isp_probe(struct platform_device *platform_dev) return ret; } -static int sun6i_isp_remove(struct platform_device *platform_dev) +static void sun6i_isp_remove(struct platform_device *platform_dev) { struct sun6i_isp_device *isp_dev = platform_get_drvdata(platform_dev); @@ -503,8 +503,6 @@ static int sun6i_isp_remove(struct platform_device *platform_dev) sun6i_isp_v4l2_cleanup(isp_dev); sun6i_isp_tables_cleanup(isp_dev); sun6i_isp_resources_cleanup(isp_dev); - - return 0; } /* @@ -540,7 +538,7 @@ MODULE_DEVICE_TABLE(of, sun6i_isp_of_match); static struct platform_driver sun6i_isp_platform_driver = { .probe = sun6i_isp_probe, - .remove = sun6i_isp_remove, + .remove_new = sun6i_isp_remove, .driver = { .name = SUN6I_ISP_NAME, .of_match_table = of_match_ptr(sun6i_isp_of_match),