From patchwork Sun Mar 26 14:30:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 667346 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 78F23C6FD1C for ; Sun, 26 Mar 2023 14:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232388AbjCZOci (ORCPT ); Sun, 26 Mar 2023 10:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232375AbjCZOch (ORCPT ); Sun, 26 Mar 2023 10:32:37 -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 8A7A07A8F for ; Sun, 26 Mar 2023 07:32:34 -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 1pgRQ4-0007kx-CV; Sun, 26 Mar 2023 16:32:28 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ3-006rYz-Lv; Sun, 26 Mar 2023 16:32:27 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ2-0088U9-RW; Sun, 26 Mar 2023 16:32:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Marek Szyprowski , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 006/117] media: s5p_cec: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:33 +0200 Message-Id: <20230326143224.572654-9-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=1775; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=tcL5tkmuSnS1HmL16JCmXlgKNGuUJ0rYD9dyuN308RI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFZ9l7PCy4kTO1trNzbj+ciNYh9efVmRJt/RW G9iM/wommaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWfQAKCRCPgPtYfRL+ TjAxCACYlbgxZ3vtA7orhIDBO1GfWZ5YMpAmrpb3TuUcz7zhPFbfjOe7YgIlYmQ5BbWhpk8TgpX EvoHt845y/GnxBsYEx3d7oVYZyv0J7fr2V5fYQIai0HgxJXHKsOFxMBDC0ddjbZwsnYy9O4JuBG LKIkWoYCTEzG8iQgJwazfLOOiwgVHV9UJB5zKLqXxZQU1eggfbOMCH8STL/P7xEoGEwzZ/SU5AF sOLQUaeJs/7XaHVTtArKHCsAp4Pr9rgE5ZXwsNIxQreVWIxznM0BLd0KQOceFmI/AzOV0DKJz09 8JfW+0OordTnpai/X3cNIKqB2deGntXcxa/+hlEIXO1GdBrM 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-samsung-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-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 --- drivers/media/cec/platform/s5p/s5p_cec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/cec/platform/s5p/s5p_cec.c b/drivers/media/cec/platform/s5p/s5p_cec.c index 0a30e7acdc10..51ab4a80aafe 100644 --- a/drivers/media/cec/platform/s5p/s5p_cec.c +++ b/drivers/media/cec/platform/s5p/s5p_cec.c @@ -249,14 +249,13 @@ static int s5p_cec_probe(struct platform_device *pdev) return ret; } -static int s5p_cec_remove(struct platform_device *pdev) +static void s5p_cec_remove(struct platform_device *pdev) { struct s5p_cec_dev *cec = platform_get_drvdata(pdev); cec_notifier_cec_adap_unregister(cec->notifier, cec->adap); cec_unregister_adapter(cec->adap); pm_runtime_disable(&pdev->dev); - return 0; } static int __maybe_unused s5p_cec_runtime_suspend(struct device *dev) @@ -295,7 +294,7 @@ MODULE_DEVICE_TABLE(of, s5p_cec_match); static struct platform_driver s5p_cec_pdrv = { .probe = s5p_cec_probe, - .remove = s5p_cec_remove, + .remove_new = s5p_cec_remove, .driver = { .name = CEC_NAME, .of_match_table = s5p_cec_match, From patchwork Sun Mar 26 14:31:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 667342 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 B8422C77B6D for ; Sun, 26 Mar 2023 14:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232101AbjCZOdN (ORCPT ); Sun, 26 Mar 2023 10:33:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232557AbjCZOdK (ORCPT ); Sun, 26 Mar 2023 10:33:10 -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 C559A2D5F for ; Sun, 26 Mar 2023 07:32:59 -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 1pgRQJ-0008TG-FG; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdi-EY; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQE-0088Xf-LM; Sun, 26 Mar 2023 16:32:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , Krzysztof Kozlowski , =?utf-8?q?Uwe_Kleine-?= =?utf-8?q?K=C3=B6nig?= , Colin Ian King , Hans Verkuil Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 061/117] media: gsc-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:28 +0200 Message-Id: <20230326143224.572654-64-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=1804; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=eCSifVDAXW1X9cqwaaO+CIz3Ffo9A6DmGqCvAijEceE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbPr3FL7OeCsFMG8fuH3lucwcXA/JAft3Z+O qnuaKUrJFKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWzwAKCRCPgPtYfRL+ To6mB/0b1uRTMan64x+JAXAbjBLCzuNlTD0aJ1JMcGvaw+HooBDUHxkZcBGqZjOXYNh9JX7fzl/ +2rowxWYNLnHCr8MUHenj1HqA1ZncCV5VbOp7yfbxP5ZZocsRrD/w8bkWFiFfpRq5PhwLmGes0P rSdZZwLEfSto6Hn9dC2D9gE3zfVEydSwcAstdD7aSp3Hcgcsn9Jfot61Qx3xWnKHXA29W5t2BuA UnhBg2/5zUbbgTUPFSGkDsEVcGOWzchrapyd77nC+/pXrOfbIeW9yTXtY0xWrZV8H/6pwmWRgj4 yWzbKvRkT6iE7TEPef8MsoFq7j0VyZKUqw5Zrg0mP5ej8ogf 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-samsung-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-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 --- drivers/media/platform/samsung/exynos-gsc/gsc-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/exynos-gsc/gsc-core.c b/drivers/media/platform/samsung/exynos-gsc/gsc-core.c index b147c645ae0b..1fb34de70649 100644 --- a/drivers/media/platform/samsung/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/samsung/exynos-gsc/gsc-core.c @@ -1201,7 +1201,7 @@ static int gsc_probe(struct platform_device *pdev) return ret; } -static int gsc_remove(struct platform_device *pdev) +static void gsc_remove(struct platform_device *pdev) { struct gsc_dev *gsc = platform_get_drvdata(pdev); int i; @@ -1220,7 +1220,6 @@ static int gsc_remove(struct platform_device *pdev) pm_runtime_set_suspended(&pdev->dev); dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name); - return 0; } #ifdef CONFIG_PM @@ -1311,7 +1310,7 @@ static const struct dev_pm_ops gsc_pm_ops = { static struct platform_driver gsc_driver = { .probe = gsc_probe, - .remove = gsc_remove, + .remove_new = gsc_remove, .driver = { .name = GSC_MODULE_NAME, .pm = &gsc_pm_ops, From patchwork Sun Mar 26 14:31:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 667344 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 6483FC77B62 for ; Sun, 26 Mar 2023 14:33:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232410AbjCZOdK (ORCPT ); Sun, 26 Mar 2023 10:33:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232547AbjCZOdF (ORCPT ); Sun, 26 Mar 2023 10:33:05 -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 78CEE4EF7 for ; Sun, 26 Mar 2023 07:32:57 -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 1pgRQJ-0008TS-2D; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdm-H0; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQE-0088Xj-TH; Sun, 26 Mar 2023 16:32:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 062/117] media: fimc-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:29 +0200 Message-Id: <20230326143224.572654-65-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=1811; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/gDAR1WFxT/u1905dx4UD+u34Zk0RMlD2WklQfEDbLo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbQBClHyYs1RkuSAjmGh5nHyF+BlFnLftIh5 Bfb9lq1o9WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW0AAKCRCPgPtYfRL+ ToYzB/9PhprinAEP2a6NE/p3ZLk9AKr1ROKjrPbWJ5s84Fyn8wsyV06m5YRYexA+pfPDdpIiyKU ayWr1KTlQcJrjoVp0SL2Edu4Jm7mPWjPImNWH7diNSt4OJxsCyj8YWUbjFfGU143vAOR5qoGqY0 dWCUU1LfW03fhfJW3ZCoGucwhNc1St54axxmgB4llWoigbe3YqkTpl/nuXeAMD6IMoskYWd4oJh C79rA6cyXWx9+98FRvwllEHi9oHZdmRnpfWdQIOt3NTyfU9UuQuz6kh7lGrUP2Z8JQDXwkwVL4j 13nQfHiQehjA2NOyDa6AD3llDlW1OcoYfKzdYciQyPRi+SCr 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-samsung-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-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 --- drivers/media/platform/samsung/exynos4-is/fimc-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-core.c b/drivers/media/platform/samsung/exynos4-is/fimc-core.c index 1791100b6935..a2034ade8b9e 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-core.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-core.c @@ -1092,7 +1092,7 @@ static int fimc_suspend(struct device *dev) } #endif /* CONFIG_PM_SLEEP */ -static int fimc_remove(struct platform_device *pdev) +static void fimc_remove(struct platform_device *pdev) { struct fimc_dev *fimc = platform_get_drvdata(pdev); @@ -1108,7 +1108,6 @@ static int fimc_remove(struct platform_device *pdev) fimc_clk_put(fimc); dev_info(&pdev->dev, "driver unloaded\n"); - return 0; } /* S5PV210, S5PC110 */ @@ -1160,7 +1159,7 @@ static const struct dev_pm_ops fimc_pm_ops = { static struct platform_driver fimc_driver = { .probe = fimc_probe, - .remove = fimc_remove, + .remove_new = fimc_remove, .driver = { .of_match_table = fimc_of_match, .name = FIMC_DRIVER_NAME, From patchwork Sun Mar 26 14:31:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 667816 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 07493C74A5B for ; Sun, 26 Mar 2023 14:33:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232411AbjCZOdL (ORCPT ); Sun, 26 Mar 2023 10:33:11 -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 S232535AbjCZOdG (ORCPT ); Sun, 26 Mar 2023 10:33:06 -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 C906872B2 for ; Sun, 26 Mar 2023 07:32:58 -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 1pgRQJ-0008Sy-63; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdb-89; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQF-0088Xn-44; Sun, 26 Mar 2023 16:32:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 063/117] media: fimc-is-i2c: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:30 +0200 Message-Id: <20230326143224.572654-66-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=1806; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=i+uDo4jAoLfrwRj3SSb0wmrkT9SbZrsAL2MdBaehurE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbSwhAIKDaQG3wDPivDtC81w4My9SJOmHk4k MWcw2JmNV6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW0gAKCRCPgPtYfRL+ ToRHB/47kZKeCTKZgtMr/NS5F5UgfOlxSXsPdOUXaEt0vei8n98JGv2xGLtjCK1JFhfLiLECG9q tyqU+QjDIRvl1E5o4CeTb/GLu2/P1/E1pJNWjzQJFVeEk6e+8z2V38ZsJEoaSJvX/PlpdIggv4c GoACo8J1sVq82UttDNeguwTs5KVtg56cY+KaPNyv1X4IigXYjFGMGGA5YunkgXtVRMPi5QPLQzZ /X4vKDpiPP4j2zrAKeOKqyTxrovcVuzIxECoo0B23rM4QJUxelaPCNKJzfqSGGOz3u0w/I+puzG 7aHgWM3xCaoLINVcrh3z+bWCToumQVOiizbL8B5vxliUNgDK 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-samsung-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-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 --- drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c b/drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c index 83a28ef8e099..bef6e9b4a25e 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c @@ -82,14 +82,12 @@ static int fimc_is_i2c_probe(struct platform_device *pdev) return ret; } -static int fimc_is_i2c_remove(struct platform_device *pdev) +static void fimc_is_i2c_remove(struct platform_device *pdev) { struct fimc_is_i2c *isp_i2c = platform_get_drvdata(pdev); pm_runtime_disable(&pdev->dev); i2c_del_adapter(&isp_i2c->adapter); - - return 0; } #ifdef CONFIG_PM @@ -140,7 +138,7 @@ static const struct of_device_id fimc_is_i2c_of_match[] = { static struct platform_driver fimc_is_i2c_driver = { .probe = fimc_is_i2c_probe, - .remove = fimc_is_i2c_remove, + .remove_new = fimc_is_i2c_remove, .driver = { .of_match_table = fimc_is_i2c_of_match, .name = "fimc-isp-i2c", From patchwork Sun Mar 26 14:31:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 667817 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 4A4F6C761AF for ; Sun, 26 Mar 2023 14:33:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232520AbjCZOdJ (ORCPT ); Sun, 26 Mar 2023 10:33:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232523AbjCZOdE (ORCPT ); Sun, 26 Mar 2023 10:33:04 -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 78E9F61B5 for ; Sun, 26 Mar 2023 07:32:57 -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 1pgRQJ-0008TA-7P; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdf-Bt; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQF-0088Xq-C4; Sun, 26 Mar 2023 16:32:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 064/117] media: fimc-is: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:31 +0200 Message-Id: <20230326143224.572654-67-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=1910; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YoQhZHlKBWG3AsLKqLOSSczqOknOqCR/k6LMBg0SGGA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbT3jVoeYt9UEn3O4P1tY69DK+FCDa5okK2Y KCo1VaGbd6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW0wAKCRCPgPtYfRL+ TlfEB/0RmiaPfSi7/Id07Mc3czBQtlK/Ppgyf/m2bHrpHFeCvm6YnFfiCH807E42bCxgYJAaqBE zMAIn+Olsji48KVxXrPLUAZik93EOLufRPEesy7zhf60FT44zKoT0OhFqXaNX+ZDBIYV/ou5CRu OrWCW9DJPYBx50iEGp9u3u+e1LYVT//iGJdARFaxLuF7nD+8WqRmH6LuGgg0CvyNhOyAGZdIntZ Rd4rxs4uDopXdAVbEbWLoGF1KkzQ1pzpuHsMwTe21gL9V+06ueWMtprTHzUMiHxFocHCtnXaqJR eucJHGeDhYKlEImTTlyUkKXoaSOZPOQs2SPOVSuijEeCrRF5 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-samsung-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-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 --- drivers/media/platform/samsung/exynos4-is/fimc-is.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c index a7704ff069d6..530a148fe4d3 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c @@ -915,7 +915,7 @@ static int fimc_is_suspend(struct device *dev) } #endif /* CONFIG_PM_SLEEP */ -static int fimc_is_remove(struct platform_device *pdev) +static void fimc_is_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct fimc_is *is = dev_get_drvdata(dev); @@ -932,8 +932,6 @@ static int fimc_is_remove(struct platform_device *pdev) fimc_is_debugfs_remove(is); release_firmware(is->fw.f_w); fimc_is_free_cpu_memory(is); - - return 0; } static const struct of_device_id fimc_is_of_match[] = { @@ -950,7 +948,7 @@ static const struct dev_pm_ops fimc_is_pm_ops = { static struct platform_driver fimc_is_driver = { .probe = fimc_is_probe, - .remove = fimc_is_remove, + .remove_new = fimc_is_remove, .driver = { .of_match_table = fimc_is_of_match, .name = FIMC_IS_DRV_NAME, From patchwork Sun Mar 26 14:31:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 667815 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 0B9F6C77B61 for ; Sun, 26 Mar 2023 14:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232555AbjCZOdN (ORCPT ); Sun, 26 Mar 2023 10:33:13 -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 S232525AbjCZOdJ (ORCPT ); Sun, 26 Mar 2023 10:33:09 -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 A4FED6EAD for ; Sun, 26 Mar 2023 07:32:58 -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 1pgRQJ-0008Te-Ho; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rds-Kc; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQF-0088Xv-I5; Sun, 26 Mar 2023 16:32:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 065/117] media: fimc-lite: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:32 +0200 Message-Id: <20230326143224.572654-68-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=1909; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0uTItUIXkJCcUJYvgXMkvGjLYPdx5nocsdSdg4jWtgM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbU1UKsF/Rg/nCtZNSPCovev4z3jgC0qdYgp gq16TJd04yJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW1AAKCRCPgPtYfRL+ TrngB/9ZNdWqKHaggV70vY7by3ZFUjstBhusa4RkF/7A014pqcK4cJR9k49TFrGqenACY2HjKF2 MjSuMPLhaWbk2I9nJhA6MbvAfNmpubvB/g9IPxVqTDVMbdOSc3Zj1rfTbfE5v0xqNCABFhSoV+U Qnr56j8xs9IWKOKfgw21GK0Q8VXOZbut4USgUfN/WtyNsBp55TiuBKwy8i4vuoZmnMsCQKkUwaO BqCsOveuoxMfzwjolnFeM3BiFMRkCJ2aE5ij60PtguqGDX2LLvxlJ4gVlvpt9lhHx1RlC29qUoA 6O4aXV2q4Dp/xuXVL66LYoGTppaUA70r5iGYiRV1PkP8akZv 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-samsung-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-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 --- drivers/media/platform/samsung/exynos4-is/fimc-lite.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-lite.c b/drivers/media/platform/samsung/exynos4-is/fimc-lite.c index e185a40305a8..2fadb18560d7 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-lite.c @@ -1595,7 +1595,7 @@ static int fimc_lite_suspend(struct device *dev) } #endif /* CONFIG_PM_SLEEP */ -static int fimc_lite_remove(struct platform_device *pdev) +static void fimc_lite_remove(struct platform_device *pdev) { struct fimc_lite *fimc = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -1610,7 +1610,6 @@ static int fimc_lite_remove(struct platform_device *pdev) fimc_lite_clk_put(fimc); dev_info(dev, "Driver unloaded\n"); - return 0; } static const struct dev_pm_ops fimc_lite_pm_ops = { @@ -1656,7 +1655,7 @@ MODULE_DEVICE_TABLE(of, flite_of_match); static struct platform_driver fimc_lite_driver = { .probe = fimc_lite_probe, - .remove = fimc_lite_remove, + .remove_new = fimc_lite_remove, .driver = { .of_match_table = flite_of_match, .name = FIMC_LITE_DRV_NAME, From patchwork Sun Mar 26 14:31:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 667343 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 595A0C6FD1C for ; Sun, 26 Mar 2023 14:33:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232271AbjCZOdM (ORCPT ); Sun, 26 Mar 2023 10:33:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232556AbjCZOdJ (ORCPT ); Sun, 26 Mar 2023 10:33:09 -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 794C76598 for ; Sun, 26 Mar 2023 07:32:57 -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 1pgRQJ-0008TT-Dp; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdn-HA; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQF-0088Y0-Or; Sun, 26 Mar 2023 16:32:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 066/117] media: media-dev: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:33 +0200 Message-Id: <20230326143224.572654-69-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=2075; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=fR+7i0Q7VbhWWGpxbF+Or52vl4QTHp55EWAHRayMtsU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbV3gGUC0NrekqDM5AUKULJFCGOs7suvsmPj cDwQMcppZyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW1QAKCRCPgPtYfRL+ TtYNB/9moN33etmJ1WhTaL/TZZlnRdoZBEgv3KSIC2tje1scrWqkirUOHf43V5AWsQqMAYf2Qan oqhtsIQeb5IiiKS1gGvPyv6bAwqIrGzKQkOvXZljiWmy1m/L+9aSanjU1wBoFmLE+UaMuLly2wh PZiXt1cLED/yKhbp0YBNN9VtnMOrf5j1APjV6uGIXpnIlieXaHBHW7aBMW3yGnOo02xZy5TdCps hT4TuNZDrQmMZvmzx9STXyzDljeZLB8kmd2rEpfzRRCEGVa4MQgKnlhzX1SQ5e+eXPYNpQaUq4H QTOzMkGAqMi6u8A6dz4P1XM/Lw8DSapqhjVkJOWae907+R2R 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-samsung-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-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 --- drivers/media/platform/samsung/exynos4-is/media-dev.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/media-dev.c b/drivers/media/platform/samsung/exynos4-is/media-dev.c index 98a60f01129d..5ca78fee7804 100644 --- a/drivers/media/platform/samsung/exynos4-is/media-dev.c +++ b/drivers/media/platform/samsung/exynos4-is/media-dev.c @@ -1530,12 +1530,12 @@ static int fimc_md_probe(struct platform_device *pdev) return ret; } -static int fimc_md_remove(struct platform_device *pdev) +static void fimc_md_remove(struct platform_device *pdev) { struct fimc_md *fmd = platform_get_drvdata(pdev); if (!fmd) - return 0; + return; fimc_md_unregister_clk_provider(fmd); v4l2_async_nf_unregister(&fmd->subdev_notifier); @@ -1548,8 +1548,6 @@ static int fimc_md_remove(struct platform_device *pdev) media_device_unregister(&fmd->media_dev); media_device_cleanup(&fmd->media_dev); fimc_md_put_clocks(fmd); - - return 0; } static const struct platform_device_id fimc_driver_ids[] __always_unused = { @@ -1566,7 +1564,7 @@ MODULE_DEVICE_TABLE(of, fimc_md_of_match); static struct platform_driver fimc_md_driver = { .probe = fimc_md_probe, - .remove = fimc_md_remove, + .remove_new = fimc_md_remove, .driver = { .of_match_table = of_match_ptr(fimc_md_of_match), .name = "s5p-fimc-md", From patchwork Sun Mar 26 14:31:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 667345 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 6AE4AC6FD1C for ; Sun, 26 Mar 2023 14:33:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232542AbjCZOdD (ORCPT ); Sun, 26 Mar 2023 10:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232518AbjCZOc6 (ORCPT ); Sun, 26 Mar 2023 10:32:58 -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 0D3D710B for ; Sun, 26 Mar 2023 07:32:54 -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 1pgRQJ-0008Ti-Im; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdu-MN; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQF-0088Y5-V8; Sun, 26 Mar 2023 16:32:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 067/117] media: mipi-csis: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:34 +0200 Message-Id: <20230326143224.572654-70-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=1899; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=mY73QFpgRxNcKjqUvYcR4GWNYI+mT0BWY3J0eONn9xc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbWO5mJP7fcRhNOKip7n58IkQutGAFFw0tCn 3XtNW0/HoKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW1gAKCRCPgPtYfRL+ TlytB/wJRDahhP6YpwzaZN3S3D+YHv6A77HB2H+9jXKah5qqwWRdG1N6FsSlR7Ehaz5ZWaWmXuD eUdrfnrNjvCU86XRu80cQoaIey949jP+/F67rNG6N4KjBEVm+ghLU5pzeJUK6PgibR/fj47HCNA fxAlnVJypSCRI668qPINBlkx2awlUK86Bj5KO97zw/KMIawkBKAoPCg6dxbvJPsOJCuF3SGzJPQ pFy9uV5YY+hlXl7fxlCnXRZlciRpgWgD8wLz6bC1Jdr9HnvTqx5jEEENgx5gaDjrUDuZQBqhT0o q5wEZnKfIlqg0zNls+ei6J+dPoiXALNVsyfBZaorJloYYSUw 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-samsung-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-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 --- drivers/media/platform/samsung/exynos4-is/mipi-csis.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c index 6a0d35f33e8c..686ca8753ba2 100644 --- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c @@ -975,7 +975,7 @@ static int s5pcsis_runtime_resume(struct device *dev) } #endif -static int s5pcsis_remove(struct platform_device *pdev) +static void s5pcsis_remove(struct platform_device *pdev) { struct v4l2_subdev *sd = platform_get_drvdata(pdev); struct csis_state *state = sd_to_csis_state(sd); @@ -987,8 +987,6 @@ static int s5pcsis_remove(struct platform_device *pdev) s5pcsis_clk_put(state); media_entity_cleanup(&state->sd.entity); - - return 0; } static const struct dev_pm_ops s5pcsis_pm_ops = { @@ -1022,7 +1020,7 @@ MODULE_DEVICE_TABLE(of, s5pcsis_of_match); static struct platform_driver s5pcsis_driver = { .probe = s5pcsis_probe, - .remove = s5pcsis_remove, + .remove_new = s5pcsis_remove, .driver = { .of_match_table = s5pcsis_of_match, .name = CSIS_DRIVER_NAME, From patchwork Sun Mar 26 14:31:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 667818 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 EBC64C77B6F for ; Sun, 26 Mar 2023 14:32:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232495AbjCZOcy (ORCPT ); Sun, 26 Mar 2023 10:32:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232474AbjCZOcw (ORCPT ); Sun, 26 Mar 2023 10:32:52 -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 AC4BA7A80 for ; Sun, 26 Mar 2023 07:32:50 -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 1pgRQJ-0008UF-Iv; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQH-006re1-0O; Sun, 26 Mar 2023 16:32:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQG-0088Y8-6n; Sun, 26 Mar 2023 16:32:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 068/117] media: camif-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:35 +0200 Message-Id: <20230326143224.572654-71-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=1950; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Cv5AoPt1iE8Vv29bdDGa7hcCGTrahdWceom2lSpe14o=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsOvetjV81Q58Fbt+rNTmzeWvryg6HCmmy155oZhvp kXXvB+djMYsDIxcDLJiiiz2jWsyrarkIjvX/rsMM4iVCWQKAxenAEzkwhkOhllX1jeY7Huz/WXT LZ3bbfcvOiV9Yn8uvDfXmGemWEbLc77vrQms3P+d9NnM11SHaGV7zldsOtVyiPXvjMfWBive+K4 rij4X4uWa8LChStZhYmiCaYp8ScmEwrxnTfGrNe9tv73i24UV9k32hzhLDQ33R+s328YI/Wh43m xWuLvm+0oJ476jVeU/ndYmsmeK+k4QNBHUu+oSHtiyY36Ml8LeE2JbNRI9FRuiym+YZ3EFX0h+y jm3rEPhtMJaxV5b40k1+gcm7PkQ+3rG7duGn52yXy4qei607aD84zcPJ8xyWtButscyP8yx3/HV q9MvJpzf4DOxSjBpXubX193Gr/5qbW3cLrbmgPEtpThPAA== 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-samsung-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-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 --- drivers/media/platform/samsung/s3c-camif/camif-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/samsung/s3c-camif/camif-core.c b/drivers/media/platform/samsung/s3c-camif/camif-core.c index 6e8ef86566b7..0b50183d9230 100644 --- a/drivers/media/platform/samsung/s3c-camif/camif-core.c +++ b/drivers/media/platform/samsung/s3c-camif/camif-core.c @@ -507,7 +507,7 @@ static int s3c_camif_probe(struct platform_device *pdev) return ret; } -static int s3c_camif_remove(struct platform_device *pdev) +static void s3c_camif_remove(struct platform_device *pdev) { struct camif_dev *camif = platform_get_drvdata(pdev); struct s3c_camif_plat_data *pdata = &camif->pdata; @@ -521,8 +521,6 @@ static int s3c_camif_remove(struct platform_device *pdev) camif_clk_put(camif); s3c_camif_unregister_subdev(camif); pdata->gpio_put(); - - return 0; } static int s3c_camif_runtime_resume(struct device *dev) @@ -623,7 +621,7 @@ static const struct dev_pm_ops s3c_camif_pm_ops = { static struct platform_driver s3c_camif_driver = { .probe = s3c_camif_probe, - .remove = s3c_camif_remove, + .remove_new = s3c_camif_remove, .id_table = s3c_camif_driver_ids, .driver = { .name = S3C_CAMIF_DRIVER_NAME,