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: 669954 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 --- 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: 669955 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 --- 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: 669956 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 --- 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: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: 669958 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: 669957 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: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: 669953 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 --- 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),