From patchwork Sun Mar 26 14:31: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: 13188112 X-Patchwork-Delegate: kieran@bingham.xyz 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 57C26C6FD1C for ; Sun, 26 Mar 2023 14:32:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232458AbjCZOcu (ORCPT ); Sun, 26 Mar 2023 10:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232447AbjCZOcs (ORCPT ); Sun, 26 Mar 2023 10:32:48 -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 0EE077DAA for ; Sun, 26 Mar 2023 07:32:46 -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 1pgRQF-0008Hp-SW; Sun, 26 Mar 2023 16:32: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 1pgRQD-006rcb-F0; Sun, 26 Mar 2023 16:32:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQB-0088Wn-PH; Sun, 26 Mar 2023 16:32:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laurent Pinchart , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 047/117] media: rcar-fcp: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:14 +0200 Message-Id: <20230326143224.572654-50-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1809; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=HOnp3fnDdiAtu7mHXeRwe9TTiGOr9s+ukY2fTy4ZTHQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa/vEI9nBE95QuR5cH6f2HZre7YZAMERty65 1pd7vHi6LuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWvwAKCRCPgPtYfRL+ TiguB/4yBR0TtvQip2NJtIemL1cL+qLnjmfJqNI4o19veEIdOkNqVIWw1qlJ4KzZwUN5SQC3CBX 681lfq3cr2F1/dl1Q9/J5d1A/uGPEohkjSfGKIwkpNkCQeTjIGBhD5FwgDoqe6YbdR4pMJJyRnB WJD1hPakjGmgB00oIKYz8vnFBmdE77lak1/Nhmc1B3J8k+pz/WavsYZJXtImnNlKIzVs8xxdPbd 18Ita8YSdtxFU39yJlKnwn0a0hn+ZhlWvBNufy+RFW2tq+K40lF5J6o25GIengM/eu1fL6B4Axq FaN9iAodcVck+LrCNf64YIz1Xp1RrSFjWxYU2D9pcGJ1rYSk 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-renesas-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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: Geert Uytterhoeven --- drivers/media/platform/renesas/rcar-fcp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rcar-fcp.c b/drivers/media/platform/renesas/rcar-fcp.c index eb59a3ba6d0f..bcef7b87da7c 100644 --- a/drivers/media/platform/renesas/rcar-fcp.c +++ b/drivers/media/platform/renesas/rcar-fcp.c @@ -144,7 +144,7 @@ static int rcar_fcp_probe(struct platform_device *pdev) return 0; } -static int rcar_fcp_remove(struct platform_device *pdev) +static void rcar_fcp_remove(struct platform_device *pdev) { struct rcar_fcp_device *fcp = platform_get_drvdata(pdev); @@ -153,8 +153,6 @@ static int rcar_fcp_remove(struct platform_device *pdev) mutex_unlock(&fcp_lock); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id rcar_fcp_of_match[] = { @@ -166,7 +164,7 @@ MODULE_DEVICE_TABLE(of, rcar_fcp_of_match); static struct platform_driver rcar_fcp_platform_driver = { .probe = rcar_fcp_probe, - .remove = rcar_fcp_remove, + .remove_new = rcar_fcp_remove, .driver = { .name = "rcar-fcp", .of_match_table = rcar_fcp_of_match, From patchwork Sun Mar 26 14:31: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: 13188114 X-Patchwork-Delegate: kieran@bingham.xyz 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 17D5FC74A5B for ; Sun, 26 Mar 2023 14:32:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232470AbjCZOcv (ORCPT ); Sun, 26 Mar 2023 10:32:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232452AbjCZOcs (ORCPT ); Sun, 26 Mar 2023 10:32:48 -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 7B0C4769A for ; Sun, 26 Mar 2023 07:32:47 -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 1pgRQF-0008HU-Qh; Sun, 26 Mar 2023 16:32: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 1pgRQD-006rcU-BR; Sun, 26 Mar 2023 16:32:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQB-0088Wr-VA; Sun, 26 Mar 2023 16:32:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: =?utf-8?q?Niklas_S=C3=B6derlund?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 048/117] media: rcar-isp: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:15 +0200 Message-Id: <20230326143224.572654-51-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1727; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=H9Xij91+DKvF0GTkIvcfnoR7RIAl5lpT4bjYw1+Gjos=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbAX2oI45PUtkLYtVUOoiHXyCd+iOyR7uw6+ ewMsqY0CamJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWwAAKCRCPgPtYfRL+ TtWhB/4oYTKCPZNvN/lgdaue4UPzzDUOjxMt3d4N6SW967pr66irUwiKHHrSVd76YQjKl30CEJq KFaShNOMfUtNEX+GA6pi7V3KK3Gpek0IMStW5BZVnXGCT2Xx14frztX8GdGn0+f5AkezqWh37Hd TUcCRGCBeSS22UXkFuDfsWjFvt6n4GrcNSflBRhH36XP4qt7IdMS2k6UlGdzxMBRY2beEFj9aDy NsdhapSuMhUmEg1fUNrvZ8qskfIMd1sUVYCmWzaZzZT3/EQFBVUrAlRF9fD6QOMyO0FFlUUZLUA LoSZI2O2M+vGg9UzkFz5+X2Yqa7KgiHsv0lKa7Pi+/Z66IC3 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-renesas-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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: Geert Uytterhoeven Reviewed-by: Niklas Söderlund --- drivers/media/platform/renesas/rcar-isp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rcar-isp.c b/drivers/media/platform/renesas/rcar-isp.c index 10b3474f93a4..27fe71931a04 100644 --- a/drivers/media/platform/renesas/rcar-isp.c +++ b/drivers/media/platform/renesas/rcar-isp.c @@ -503,7 +503,7 @@ static int risp_probe(struct platform_device *pdev) return ret; } -static int risp_remove(struct platform_device *pdev) +static void risp_remove(struct platform_device *pdev) { struct rcar_isp *isp = platform_get_drvdata(pdev); @@ -515,8 +515,6 @@ static int risp_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); mutex_destroy(&isp->lock); - - return 0; } static struct platform_driver rcar_isp_driver = { @@ -525,7 +523,7 @@ static struct platform_driver rcar_isp_driver = { .of_match_table = risp_of_id_table, }, .probe = risp_probe, - .remove = risp_remove, + .remove_new = risp_remove, }; module_platform_driver(rcar_isp_driver); From patchwork Sun Mar 26 14:31: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: 13188113 X-Patchwork-Delegate: kieran@bingham.xyz 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 E3197C77B6C for ; Sun, 26 Mar 2023 14:32:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232453AbjCZOcv (ORCPT ); Sun, 26 Mar 2023 10:32:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232449AbjCZOcs (ORCPT ); Sun, 26 Mar 2023 10:32:48 -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 0EFC57DAD for ; Sun, 26 Mar 2023 07:32:46 -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 1pgRQF-0008HV-O5; Sun, 26 Mar 2023 16:32: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 1pgRQD-006rcW-Cb; Sun, 26 Mar 2023 16:32:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQC-0088Wu-5A; Sun, 26 Mar 2023 16:32:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: =?utf-8?q?Niklas_S=C3=B6derlund?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 049/117] media: rcar-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:16 +0200 Message-Id: <20230326143224.572654-52-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1821; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=95eFlYcFS5rE4SExkOimIwf5tFvBzgFzhyqxLBhy9Is=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbBootwkPzYp0dHDwnmM9s0TK9ambTS6fbVT hrfQtVEAdqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWwQAKCRCPgPtYfRL+ TgkLCACYFPdUV7Ap/CvPFrD8z760nwgR3D2L+LvXZNMGzegLv32zNlO9WyFvfWhKBQG2afZ0JO9 Tz+J57MkWsmBTkE6wca4F7C0/QD42QOgxgas5x2kEmqHEJN3w7SXh36MqhpmjBPMLX7gMJBI0sw eat1X53sN3E/ij0SB1Tqc29QGFNXC8Dup9lxDxQxAM2BxlxjsxAVfOls2+GUZRxDjZBM1i1QptU w7/yZBARxmEHX/ElLEdlkOuJnsHVuyUHNeTr8g4g47Wlk7mxeG3sbCRNeAJ9o+0NKO+uLQqD2w9 JnnOSp1sqoKhF8Pqk8KW4fGPh4ae7QX/Y78K/9+JxZBppvGd 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-renesas-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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: Geert Uytterhoeven Reviewed-by: Niklas Söderlund --- drivers/media/platform/renesas/rcar-vin/rcar-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c index 5e53d6b7036c..1398f147e5c2 100644 --- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c +++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c @@ -1442,7 +1442,7 @@ static int rcar_vin_probe(struct platform_device *pdev) return 0; } -static int rcar_vin_remove(struct platform_device *pdev) +static void rcar_vin_remove(struct platform_device *pdev) { struct rvin_dev *vin = platform_get_drvdata(pdev); @@ -1458,8 +1458,6 @@ static int rcar_vin_remove(struct platform_device *pdev) rvin_parallel_cleanup(vin); rvin_dma_unregister(vin); - - return 0; } static SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume); @@ -1472,7 +1470,7 @@ static struct platform_driver rcar_vin_driver = { .of_match_table = rvin_of_id_table, }, .probe = rcar_vin_probe, - .remove = rcar_vin_remove, + .remove_new = rcar_vin_remove, }; module_platform_driver(rcar_vin_driver); From patchwork Sun Mar 26 14:31:17 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: 13188116 X-Patchwork-Delegate: kieran@bingham.xyz 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 2E490C761AF for ; Sun, 26 Mar 2023 14:32:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232471AbjCZOcy (ORCPT ); Sun, 26 Mar 2023 10:32:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232433AbjCZOcs (ORCPT ); Sun, 26 Mar 2023 10:32:48 -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 2DBAC6593 for ; Sun, 26 Mar 2023 07:32:48 -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 1pgRQG-0008L7-Nu; Sun, 26 Mar 2023 16:32: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 1pgRQE-006rcm-1N; Sun, 26 Mar 2023 16:32:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQC-0088Wx-BZ; Sun, 26 Mar 2023 16:32:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: =?utf-8?q?Niklas_S=C3=B6derlund?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 050/117] media: rcar-csi2: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:17 +0200 Message-Id: <20230326143224.572654-53-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1664; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rzzlIfWXqPfQU48/T+BYrThE5NalpaIZnC0ld3lBsWA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbCWdtnUZl+ZiAtPZ1QpSW5IVlI1DgRmbxAD VeqTmBvtQOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWwgAKCRCPgPtYfRL+ TiNeB/9Fxn4R0AAaRllcZFfQdvxhpCUHV8JuvXgYX5C7yjr6Qn59zpKIZeQcTApPBQ21WnGBiFh 47Z+uNGixCd4hVfmgB0ndDj8hDPTeGYfjQP76bFbBz52eAEgD9vEd7bSRAL00nOqjMCCxl4HvgH PbKoSzoHbQp4Catf6TpDSGfF0nneWq3r6dWKIbXI8bPdUwqbAkKzlRxXjMYQ4VClFr48iZBzcg6 giYRe+tQH9P3KfLevKDDRU1JKqax5F2QwmWnhti0ZPlW7sHxeR2vVa6tnE8YNSHZHUJt58WzFY4 /yWYOigmLVAjbDcsCrmcH3MfZMjGmF0wB078FUYEmDzUN+9+ 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-renesas-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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: Geert Uytterhoeven Reviewed-by: Niklas Söderlund --- drivers/media/platform/renesas/rcar-vin/rcar-csi2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c index 174aa6176f54..1632c9a53ac4 100644 --- a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c +++ b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c @@ -1574,7 +1574,7 @@ static int rcsi2_probe(struct platform_device *pdev) return ret; } -static int rcsi2_remove(struct platform_device *pdev) +static void rcsi2_remove(struct platform_device *pdev) { struct rcar_csi2 *priv = platform_get_drvdata(pdev); @@ -1585,12 +1585,10 @@ static int rcsi2_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); mutex_destroy(&priv->lock); - - return 0; } static struct platform_driver rcar_csi2_pdrv = { - .remove = rcsi2_remove, + .remove_new = rcsi2_remove, .probe = rcsi2_probe, .driver = { .name = "rcar-csi2", From patchwork Sun Mar 26 14:31:18 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: 13188119 X-Patchwork-Delegate: kieran@bingham.xyz 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 389BEC77B6E for ; Sun, 26 Mar 2023 14:32:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232460AbjCZOc4 (ORCPT ); Sun, 26 Mar 2023 10:32:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232462AbjCZOcv (ORCPT ); Sun, 26 Mar 2023 10:32:51 -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 AFD767D84 for ; Sun, 26 Mar 2023 07:32:49 -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 1pgRQI-0008Qd-5v; Sun, 26 Mar 2023 16:32: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 1pgRQF-006rd9-9r; Sun, 26 Mar 2023 16:32:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQC-0088X0-HR; Sun, 26 Mar 2023 16:32:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Fabrizio Castro , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 051/117] media: rcar_drif: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:18 +0200 Message-Id: <20230326143224.572654-54-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1810; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nwKCJTOdxQv7E7M26+wkLn98oSNhE7D9Vkt7wczeeVg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbEK/1kkf6o5gM9he+H8/sE9QVvHxSzHMUWj 1F3uqRa1SCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWxAAKCRCPgPtYfRL+ TqggB/429FZpW1zigRZFsRKsuXBXU3GZQqCRMsaILtA23xmYgBYOBM5uyGOR8+/vY8F7lZaM0Qb tQYTzNl4suGeQmKTXMiLsULULaWxS+i0zp1DdWAz8PHdCiHfWQUhmBBVPOVYl7NA4k6LHAmHIhu lYyKoS15UKShVdEvuY1udzoKOyBZazbXJOCKArn1uLVSR5RlJyKvq7mVf9z4BgEdSpCXztFencO S3mDZ6JGlX9VODDlQJIgx1dpSFUrCtUvI8k5z0Mol5z+Gb4E9GOqq69LkIRBHWkBp5Dg5iGnlmQ Vf3B2taDEKtbzFk24hJsc3lSc5WasFgHUGTy9Lh6huWHojNQ 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-renesas-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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: Geert Uytterhoeven Reviewed-by: Fabrizio Castro --- drivers/media/platform/renesas/rcar_drif.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/renesas/rcar_drif.c b/drivers/media/platform/renesas/rcar_drif.c index 3fec41f6e964..3a92f4535c18 100644 --- a/drivers/media/platform/renesas/rcar_drif.c +++ b/drivers/media/platform/renesas/rcar_drif.c @@ -1433,19 +1433,17 @@ static int rcar_drif_probe(struct platform_device *pdev) } /* DRIF channel remove */ -static int rcar_drif_remove(struct platform_device *pdev) +static void rcar_drif_remove(struct platform_device *pdev) { struct rcar_drif *ch = platform_get_drvdata(pdev); struct rcar_drif_sdr *sdr = ch->sdr; /* Channel 0 will be the SDR instance */ if (ch->num) - return 0; + return; /* SDR instance */ rcar_drif_sdr_remove(sdr); - - return 0; } /* FIXME: Implement suspend/resume support */ @@ -1476,7 +1474,7 @@ static struct platform_driver rcar_drif_driver = { .pm = &rcar_drif_pm_ops, }, .probe = rcar_drif_probe, - .remove = rcar_drif_remove, + .remove_new = rcar_drif_remove, }; module_platform_driver(rcar_drif_driver); From patchwork Sun Mar 26 14:31:19 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: 13188115 X-Patchwork-Delegate: kieran@bingham.xyz 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 71BC3C77B61 for ; Sun, 26 Mar 2023 14:32:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232486AbjCZOcx (ORCPT ); Sun, 26 Mar 2023 10:32:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232424AbjCZOcs (ORCPT ); Sun, 26 Mar 2023 10:32:48 -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 CDDB87A80 for ; Sun, 26 Mar 2023 07:32:47 -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 1pgRQG-0008Kg-5n; Sun, 26 Mar 2023 16:32: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 1pgRQD-006rck-Uv; Sun, 26 Mar 2023 16:32:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQC-0088X7-Oi; Sun, 26 Mar 2023 16:32:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Kieran Bingham , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 052/117] media: rcar_fdp1: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:19 +0200 Message-Id: <20230326143224.572654-55-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1828; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ep66JiQpFd5B636ftLdcfjXYfarPiHk1fH4HK7o52wk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbFxHZo/YFxsqg6Y4hXlUqd6K7dWubV5/PkH sdNQo6+aEqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWxQAKCRCPgPtYfRL+ TqaWB/4hyb5B5K0WPDi9mQwEtmg0ckboPZCjuTO4Zyp5B+KEhDkv70k/wDuy0kv/7cNl8tQLjum USYJ1p+yQi6lqUyCjX/VwshMVy27bRh9fAF60oWUk/+pf/6uWVT3Y7VWCcn421E81U6OScOSMAc TQeHRZU3EZxrk4qUR8lypz63FD48hGQpJ0F96jHWzurnQB0bq5LaixG1S2i7FqLxhfXqKLWziOw QfZ5J5r8xCh7fdK0Tg2jafxocOE7riUN2unrhqNpfKLGWARYZMMyTCRguzCqgXfPnBOT0byepDK g78vo+6OdhoXSho91zU1q9G8byF9+kME9c86PS+ixQRhfm+v 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-renesas-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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: Geert Uytterhoeven Reviewed-by: Kieran Bingham --- drivers/media/platform/renesas/rcar_fdp1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c index 37ecf489d112..d80b3214dfae 100644 --- a/drivers/media/platform/renesas/rcar_fdp1.c +++ b/drivers/media/platform/renesas/rcar_fdp1.c @@ -2396,7 +2396,7 @@ static int fdp1_probe(struct platform_device *pdev) return ret; } -static int fdp1_remove(struct platform_device *pdev) +static void fdp1_remove(struct platform_device *pdev) { struct fdp1_dev *fdp1 = platform_get_drvdata(pdev); @@ -2404,8 +2404,6 @@ static int fdp1_remove(struct platform_device *pdev) video_unregister_device(&fdp1->vfd); v4l2_device_unregister(&fdp1->v4l2_dev); pm_runtime_disable(&pdev->dev); - - return 0; } static int __maybe_unused fdp1_pm_runtime_suspend(struct device *dev) @@ -2441,7 +2439,7 @@ MODULE_DEVICE_TABLE(of, fdp1_dt_ids); static struct platform_driver fdp1_pdrv = { .probe = fdp1_probe, - .remove = fdp1_remove, + .remove_new = fdp1_remove, .driver = { .name = DRIVER_NAME, .of_match_table = fdp1_dt_ids, From patchwork Sun Mar 26 14:31:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188118 X-Patchwork-Delegate: kieran@bingham.xyz 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 5536BC77B70 for ; Sun, 26 Mar 2023 14:32:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232499AbjCZOcz (ORCPT ); Sun, 26 Mar 2023 10:32:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232460AbjCZOcu (ORCPT ); Sun, 26 Mar 2023 10:32:50 -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 3AA4561B1 for ; Sun, 26 Mar 2023 07:32:49 -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 1pgRQH-0008Ot-Jw; Sun, 26 Mar 2023 16:32: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 1pgRQE-006rcy-T6; Sun, 26 Mar 2023 16:32:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQC-0088XA-V1; Sun, 26 Mar 2023 16:32:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mikhail Ulyanov , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 053/117] media: rcar_jpu: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:20 +0200 Message-Id: <20230326143224.572654-56-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1771; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=UC83YHmOk2BnQQT107sHqxKNVaZy0TsF7OXm3Ya2aec=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbGZpPNJXshYJpSZIZPl7ON0Mv3wqX3a9uDe 73Tu+VHWP2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWxgAKCRCPgPtYfRL+ TtW8B/9hjmx3lhg/gDaDsBClWctoiJQOeg5+Iz+4DsJC6iqi0PXY63AU1esmV4yR2B/6IZFvdqN P1rEu2PWOz2ipOCoXqzW0MhBIM1IaVAYNqI8JehuUXskj0zFgg7svFLmD1mmayi6ObQqtI8/RwR RN1Skl0aW7v9U98MR3ZWhQQLQwQdOjb+5SNKwciXyDPgYmRyP9VPXBmxgtjtqfsfLRKWSiDFvzP ir6oGtgz5JTUwwmmeVk4TFc0AvX5LrJS3AOaFhRJbRfuxl97oeSQJUIrRsXTd7OL8u1xfiB0EYJ xtsFbiTm8ba48Te+3wpDoKJh6Uy4gaH5Elm0o7kISyEqxXVG 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-renesas-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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: Geert Uytterhoeven --- drivers/media/platform/renesas/rcar_jpu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rcar_jpu.c b/drivers/media/platform/renesas/rcar_jpu.c index 2f4377cfbb42..e7f604807825 100644 --- a/drivers/media/platform/renesas/rcar_jpu.c +++ b/drivers/media/platform/renesas/rcar_jpu.c @@ -1702,7 +1702,7 @@ static int jpu_probe(struct platform_device *pdev) return ret; } -static int jpu_remove(struct platform_device *pdev) +static void jpu_remove(struct platform_device *pdev) { struct jpu *jpu = platform_get_drvdata(pdev); @@ -1710,8 +1710,6 @@ static int jpu_remove(struct platform_device *pdev) video_unregister_device(&jpu->vfd_encoder); v4l2_m2m_release(jpu->m2m_dev); v4l2_device_unregister(&jpu->v4l2_dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1746,7 +1744,7 @@ static const struct dev_pm_ops jpu_pm_ops = { static struct platform_driver jpu_driver = { .probe = jpu_probe, - .remove = jpu_remove, + .remove_new = jpu_remove, .driver = { .of_match_table = jpu_dt_ids, .name = DRV_NAME, From patchwork Sun Mar 26 14:31:21 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: 13188120 X-Patchwork-Delegate: kieran@bingham.xyz 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 D3B7FC77B72 for ; Sun, 26 Mar 2023 14:32:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232508AbjCZOc4 (ORCPT ); Sun, 26 Mar 2023 10:32:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232468AbjCZOcv (ORCPT ); Sun, 26 Mar 2023 10:32:51 -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 328777D90 for ; Sun, 26 Mar 2023 07:32:49 -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 1pgRQI-0008QU-68; Sun, 26 Mar 2023 16:32: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 1pgRQF-006rd8-97; Sun, 26 Mar 2023 16:32:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQD-0088XD-5M; Sun, 26 Mar 2023 16:32:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jacopo Mondi , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 054/117] media: renesas-ceu: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:21 +0200 Message-Id: <20230326143224.572654-57-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1768; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=u7QKai25ZD7du91fx2gh05IHciAlfyNOryov1W77jCE=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsOMVd/3zfu9OZj9q2cr1MlY4aKG99wNB9iM9N3gY1 1z4/lS7k9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJrFBm/8NZp1tyMaC9S1Jm 9sP1vHyNa3fW5F/n9OA1dndecSHK8kmOXNIUu+NO/js1LCpLXSfllx7tPmZ20v3fEjHT4If6Dqk Nti+ZLp9mcVWMURHY2X+pouIJ+w7F+DXla6Wu2lyu/nz9gGpYxydP1/gjnC+T/siF81YfZwx3cp fv2tpvueJwcqbQxhJN3XrjOWLNNm9XJ/dO/r20eKa37/xtjrkxs5jv/P65+1urVnvgJSXxW0V8c T2LXsQK3r2wdWJfXeuPsp6Np4XSJRLVJblPVncJbS8Izg0UVbAVStki77b+7kaNk6mTcxZwCS1+ fu3+lpS1Di/2SLbHsO2Ymmeolv2zbdm3aT7qpUF5u+wA 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-renesas-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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: Geert Uytterhoeven --- drivers/media/platform/renesas/renesas-ceu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c index f70f91b006b7..02d1ab23d76d 100644 --- a/drivers/media/platform/renesas/renesas-ceu.c +++ b/drivers/media/platform/renesas/renesas-ceu.c @@ -1709,7 +1709,7 @@ static int ceu_probe(struct platform_device *pdev) return ret; } -static int ceu_remove(struct platform_device *pdev) +static void ceu_remove(struct platform_device *pdev) { struct ceu_device *ceudev = platform_get_drvdata(pdev); @@ -1722,8 +1722,6 @@ static int ceu_remove(struct platform_device *pdev) v4l2_device_unregister(&ceudev->v4l2_dev); video_unregister_device(&ceudev->vdev); - - return 0; } static const struct dev_pm_ops ceu_pm_ops = { @@ -1739,7 +1737,7 @@ static struct platform_driver ceu_driver = { .of_match_table = of_match_ptr(ceu_of_match), }, .probe = ceu_probe, - .remove = ceu_remove, + .remove_new = ceu_remove, }; module_platform_driver(ceu_driver); From patchwork Sun Mar 26 14:31: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: 13188117 X-Patchwork-Delegate: kieran@bingham.xyz 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 B4A79C77B6D for ; Sun, 26 Mar 2023 14:32:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232496AbjCZOcz (ORCPT ); Sun, 26 Mar 2023 10:32:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232459AbjCZOcu (ORCPT ); Sun, 26 Mar 2023 10:32:50 -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 8EF267AAB for ; Sun, 26 Mar 2023 07:32:49 -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 1pgRQI-0008Rv-5H; Sun, 26 Mar 2023 16:32: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 1pgRQF-006rdM-Og; Sun, 26 Mar 2023 16:32:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQE-0088XU-0M; Sun, 26 Mar 2023 16:32:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laurent Pinchart , Kieran Bingham , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 058/117] media: vsp1_drv: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:25 +0200 Message-Id: <20230326143224.572654-61-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1772; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=EjRcTYlo35y82/L20Z81gnE14v2Xv5gdgq+8cV2/JKk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbMOk/UOndLqfRzqpes0DNym0NOJWfrjM61O Dy7cqSuJ/WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWzAAKCRCPgPtYfRL+ Tr8sB/4gUbHY3UrlevoJV054i3j8+uqfuciL5D7OsMmV2uyEGiX8GxkUgXrz2XwHfQzyddkNhC5 YWSUnk+ThKJsdqa5JGQcBU2L27bow3btqgg88MfaJQe0tHiiYmX7MguUkdI4iKPbbyHajUOhqXu yyEFnm8nLMgx+5kkVSw7732Lyb6R7SIsb40GP2o7n3uYLQ9RB5TwA334Vj+xI/3uUDEGRsB3rQj lQnSzvR6W0qCsXcEkf5a9h9J7ouM15cy1nu2NJL1wyJWNb1mIzBWcs2D8BaBVEw0dTZ9SO5MGKD eERDqs+s1TG3wHdar4udoZSP9OYPlwEO5wgMhSMGRjq1jzde 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-renesas-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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: Geert Uytterhoeven Reviewed-by: Kieran Bingham --- drivers/media/platform/renesas/vsp1/vsp1_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c index 5710152d6511..c1c28f98bd10 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c @@ -977,7 +977,7 @@ static int vsp1_probe(struct platform_device *pdev) return ret; } -static int vsp1_remove(struct platform_device *pdev) +static void vsp1_remove(struct platform_device *pdev) { struct vsp1_device *vsp1 = platform_get_drvdata(pdev); @@ -985,8 +985,6 @@ static int vsp1_remove(struct platform_device *pdev) rcar_fcp_put(vsp1->fcp); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id vsp1_of_match[] = { @@ -999,7 +997,7 @@ MODULE_DEVICE_TABLE(of, vsp1_of_match); static struct platform_driver vsp1_platform_driver = { .probe = vsp1_probe, - .remove = vsp1_remove, + .remove_new = vsp1_remove, .driver = { .name = "vsp1", .pm = &vsp1_pm_ops,