From patchwork Sun Mar 26 14:30: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: 13188320 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEAFEC761AF for ; Sun, 26 Mar 2023 15:46:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oMby8xqW42uDqpcIut3is/oGDily6FCEkZB9ptTXcSs=; b=l3ZpDkjOH9X/u8 3AOJ8fD4U77uFAdy7V3X7o1OqE6fUVHpv4Dl9+VTrNVul9RC/sInYV8tCaOZ/REaYYaS6Fp4eiFMW Wx0wEz+16CCPNsj1t28nGzi8t5G/3HKFFXWfJRuudyXitz2EGlNrxqj/+sUrnc674SwH/h2WXLPhQ qNc+o/cszIY7xe887rgE8+kA1NwPHG1M3D3QliLB6Afp6Fa5IsO1KGd7kT/Mfa8TNHQ6rUm70G/h4 SvXC6SsQ/SfXQf6aYIZrkxZp+n1vIZOlDaKquRLvcFqGad4puGLm1Q58p3WhT6ndXARVbM3L+C9g2 muc7opNDgmEOBjDT/6Dw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSYU-008jVa-0w; Sun, 26 Mar 2023 15:45:14 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQG-008YMl-2z for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:42 +0000 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-0007kr-D7; 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-006rYy-LC; 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-0088U2-Ca; Sun, 26 Mar 2023 16:32:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Neil Armstrong , Hans Verkuil , Mauro Carvalho Chehab , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 004/117] media: ao-cec-g12a: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:31 +0200 Message-Id: <20230326143224.572654-7-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=2005; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=v1wYGsh94W2lZgFeQJwM78nPF+W6bmgfpxjhbc5mNVE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFZ71dphtajewDN9c9hG2KxI9Sc8tzx2SkZbo HDC3rcHxbKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWewAKCRCPgPtYfRL+ Tr6rCACJ5dd9wV3bKSu9kvblrZbNIhyIOzeYRxGMF/5SPdamElcP0qqsv960558Vb6Nz1qeTP3t EhZAqGmghQIP7sia/5v9oWXOQyCtaRoHecq7X+TdL2E1BmiGmGGAh4EWX4PS2etoZ0Cp6Llblr6 yucTSe3Anc9LELmrN5Kq1TCU8/Sxv3L0dGvLR2k+yppvduOlWsD3gZAVlwmRsbVDy7/+mqTu323 GEZb18L83DSZh3DWo8felBcyQVCd+jo/agxDgy7Q+nsBzOzoRjvzMgh6JUI1c8wWCPXvQhNDcwX 92epQ4KNdNKMDy/UhyqnQyHbQtSQgdIb6hS63u8u6hH03pPC 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_073241_008891_92441462 X-CRM114-Status: GOOD ( 16.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: Martin Blumenstingl --- drivers/media/cec/platform/meson/ao-cec-g12a.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/meson/ao-cec-g12a.c b/drivers/media/cec/platform/meson/ao-cec-g12a.c index 68fe6d6a8178..51294b9b6cd5 100644 --- a/drivers/media/cec/platform/meson/ao-cec-g12a.c +++ b/drivers/media/cec/platform/meson/ao-cec-g12a.c @@ -744,7 +744,7 @@ static int meson_ao_cec_g12a_probe(struct platform_device *pdev) return ret; } -static int meson_ao_cec_g12a_remove(struct platform_device *pdev) +static void meson_ao_cec_g12a_remove(struct platform_device *pdev) { struct meson_ao_cec_g12a_device *ao_cec = platform_get_drvdata(pdev); @@ -753,8 +753,6 @@ static int meson_ao_cec_g12a_remove(struct platform_device *pdev) cec_notifier_cec_adap_unregister(ao_cec->notify, ao_cec->adap); cec_unregister_adapter(ao_cec->adap); - - return 0; } static const struct meson_ao_cec_g12a_data ao_cec_g12a_data = { @@ -780,7 +778,7 @@ MODULE_DEVICE_TABLE(of, meson_ao_cec_g12a_of_match); static struct platform_driver meson_ao_cec_g12a_driver = { .probe = meson_ao_cec_g12a_probe, - .remove = meson_ao_cec_g12a_remove, + .remove_new = meson_ao_cec_g12a_remove, .driver = { .name = "meson-ao-cec-g12a", .of_match_table = of_match_ptr(meson_ao_cec_g12a_of_match), From patchwork Sun Mar 26 14:30: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: 13188321 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B8D0C6FD1C for ; Sun, 26 Mar 2023 15:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DIaAcnYeiSI5Tx57kmGGcfFoyerPKQGiKbDgH0QVbHw=; b=kRsDYGe+H1VDiR HjtRaAmy+Edb2IHmig7SmX7dAEWxznsEP7HexTzSgo5Tc/+uU2nLMUt1z7jdVsRhMtJD/AC/ell/+ h9OFG4JAWrkacHK+J61bdgBjnc1PmJoLY3WMo6mNssGsVzi7MNXL7lvFLDW0RvVpf7usjpVUADeHs RmY0Yt0n9FSRlBZvC9aaCZscnoBue/6ynTeeM2UmqqgAIaJm3Vbip7TF5Fgaa2M8t5EiQwl1rxiZ0 5OjJfMMBr++9fVNS182V18PPaw8QAi9f63bDFApaoBUa1hGA3TZXylsOvtsZmzNeEMuqBjfnymK+k eKFecV5+17mjmKMseh7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSYW-008jWW-1f; Sun, 26 Mar 2023 15:45:16 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQG-008YMe-2z for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:44 +0000 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-0007lN-Qf; 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 1pgRQ4-006rZC-4F; Sun, 26 Mar 2023 16:32:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ2-0088U6-JU; Sun, 26 Mar 2023 16:32:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Neil Armstrong , Hans Verkuil , Mauro Carvalho Chehab , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 005/117] media: ao-cec: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:32 +0200 Message-Id: <20230326143224.572654-8-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=1917; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=T42yo2zTTmIkn3GXSFDOaa/xozG97/RfNm55diexSxI=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsJovD344vJ19Nu3j9tuvcjkPH01uN1b2VZC26H36b 1vXTO9pnYzGLAyMXAyyYoos9o1rMq2q5CI71/67DDOIlQlkCgMXpwBMZMYCDoZOlmdfKxeylh38 lMt5wERbf8WFaq/GQGH5Sn2xpErPvyfjAy4fv/r83K2bHRJqXoX2J8uDo0OuXG7Sd/xkZeCpdjB gxu/88iklj4OcNuZKrPNMVYu4retkYd528P37NVmc+VYMBhHXM1vSlNmetLL28LxJSuruPJR/W6 v3+NUl+u28m1sbjSzCyrZlXImrzk943WZasXL7f9XbiY93nTxbs7F+tmJW7temi6/f+703u1K8J 7Uq7dbFnEeLjtWba5n8nvby0uvGD40CQd98izLrbk34+s80S9NI+5uoU5SA7++m0N1PtaV+W6om TpK+5CNlbNO25ALr8buOYl/MXnAfmPbnpezztVvazWrMAQ== 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_073241_035431_0B8BFFCE X-CRM114-Status: GOOD ( 16.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: Martin Blumenstingl --- drivers/media/cec/platform/meson/ao-cec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/meson/ao-cec.c b/drivers/media/cec/platform/meson/ao-cec.c index 6b440f0635d9..f6f51a34f7bd 100644 --- a/drivers/media/cec/platform/meson/ao-cec.c +++ b/drivers/media/cec/platform/meson/ao-cec.c @@ -696,7 +696,7 @@ static int meson_ao_cec_probe(struct platform_device *pdev) return ret; } -static int meson_ao_cec_remove(struct platform_device *pdev) +static void meson_ao_cec_remove(struct platform_device *pdev) { struct meson_ao_cec_device *ao_cec = platform_get_drvdata(pdev); @@ -704,8 +704,6 @@ static int meson_ao_cec_remove(struct platform_device *pdev) cec_notifier_cec_adap_unregister(ao_cec->notify, ao_cec->adap); cec_unregister_adapter(ao_cec->adap); - - return 0; } static const struct of_device_id meson_ao_cec_of_match[] = { @@ -716,7 +714,7 @@ MODULE_DEVICE_TABLE(of, meson_ao_cec_of_match); static struct platform_driver meson_ao_cec_driver = { .probe = meson_ao_cec_probe, - .remove = meson_ao_cec_remove, + .remove_new = meson_ao_cec_remove, .driver = { .name = "meson-ao-cec", .of_match_table = of_match_ptr(meson_ao_cec_of_match), From patchwork Sun Mar 26 14:30:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188327 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 09F82C6FD1C for ; Sun, 26 Mar 2023 15:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iI/rGlOIb55Td0vGH4lWX35VoXyg/2Zmb4cUxPMme6c=; b=Ej6Z2Gno7/Msyz Jo7XFlDZLIGcUhD/gzOzkrgRAOEM2LNvG/hH1CZ5F7LVRzvPbhdv9UbZnl2ZxPT48H5btMmJ53ODB +9ckRT3JsazKWkWINz1GfQTSBDhiWEUMjN42KB8ochTU9mhbubKDpSVNJ1P6XAMrOtXxUCwnui1x/ eNy3pq6Xa2vkjbK6x976An0C026xatgDT9KDn1FAxuBq/R3FknGb/eC7xdkLiP184b29q6P6GGR+3 JJsCl+O3RZRrszwB78rV7rJuyzir90B2j8nNVXiWlSk7TZqWRx/xUabZv7xKwfTKLr/CTj74ovn+D W83yhyKkgJNyeRb26gGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSaE-008kQT-20; Sun, 26 Mar 2023 15:47:02 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgSa4-008kJi-05 for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 15:46:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=Hrncta8x0FE60yCCjQU5KOo6ArWCG7IDNe/wYDefuHE=; b=YrSwKTWtezbguPpt/2pehoswl6 kMX+eeTdoMPC9/d2r53paF32DuOcF9IvBZNPL8vQjxyVa0tQccYUELu0KcdiKWQXiA/kWWkjKmnzo hX/eKe8X0LgJeg/BmJPmH6QGg9RqOSJ2wuqeD/eu70tAEaG6IE12npen1TDnP05DVwqiJGpmZGLFh Ggh9oukQDchQSYfv6ZXWB3Gd6hgr657fJhhPzKQ6TAtJBzikcmeXjo1j+WzGLavj03Q0TMPSmDEdA WAn2z04g9GeioqyK5JrQGOsIozhrZPqhV2wwRyREBeI61KGR/GR3YVqwM2bGgh14kVGwPlE5hgG9/ pgXFAA6A==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQT-005qlm-2H for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:59 +0000 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 1pgRQ7-0007lc-KK; Sun, 26 Mar 2023 16:32:31 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ4-006rZG-7s; Sun, 26 Mar 2023 16:32:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ3-0088UK-G3; Sun, 26 Mar 2023 16:32:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans Verkuil , Mauro Carvalho Chehab , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Sean Young , Sakari Ailus , Ricardo Ribalda , Laurent Pinchart , Yang Yingliang Cc: linux-media@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 009/117] media: stm32-cec: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:36 +0200 Message-Id: <20230326143224.572654-12-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=1831; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=D/UAC+t+fl8c6EjlWf6JDxvuYAMHu5bYFNCcxsw+JGM=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsAbrwF6Dzy1NElLhi5qCVORf8/NW/5rkxW5prSeRa Ppenr2T0ZiFgZGLQVZMkcW+cU2mVZVcZOfaf5dhBrEygUxh4OIUgIloHuRgmPi/2ny+i9XGX9Hv cj8K8asKTHh7eOVSu2VnF1Xrap96r//j2r8PXm1LZ6xN8T5y9nTDdL5ZNQEmzcbVCluNXV/Z2P2 4d0Yz3ldfqP2a+K3Sf3wTdoT9bj0uZ7imZNLdiAU9x49XX9os3W8lemcCVxrrveKYloCYXdW/rH NncoQvWm+w9eq5dTlt3r+dV+09eFp8456QY14NBdtvPt/9RtT4XiKPEUPz3uj8AoX4lhLbZo9NE Rf7PNj3bym/KJ6z4ofQ1rtlH1Tz2F5t0An+d5XbjKnvL9dEnzUiXLUvnRl6ixTMfnVJ5Vw4O+3k i2hB/bkutcdYEi2rN9Z4Kz374r53G5N/sU+X2vp325QTAQ== 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153253_851069_35ECB477 X-CRM114-Status: GOOD ( 16.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/stm32/stm32-cec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/stm32/stm32-cec.c b/drivers/media/cec/platform/stm32/stm32-cec.c index 7b2db46a5722..ada3d153362a 100644 --- a/drivers/media/cec/platform/stm32/stm32-cec.c +++ b/drivers/media/cec/platform/stm32/stm32-cec.c @@ -344,7 +344,7 @@ static int stm32_cec_probe(struct platform_device *pdev) return ret; } -static int stm32_cec_remove(struct platform_device *pdev) +static void stm32_cec_remove(struct platform_device *pdev) { struct stm32_cec *cec = platform_get_drvdata(pdev); @@ -352,8 +352,6 @@ static int stm32_cec_remove(struct platform_device *pdev) clk_unprepare(cec->clk_hdmi_cec); cec_unregister_adapter(cec->adap); - - return 0; } static const struct of_device_id stm32_cec_of_match[] = { @@ -364,7 +362,7 @@ MODULE_DEVICE_TABLE(of, stm32_cec_of_match); static struct platform_driver stm32_cec_driver = { .probe = stm32_cec_probe, - .remove = stm32_cec_remove, + .remove_new = stm32_cec_remove, .driver = { .name = CEC_NAME, .of_match_table = stm32_cec_of_match, From patchwork Sun Mar 26 14:30:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188271 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 272EAC761AF for ; Sun, 26 Mar 2023 14:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LhtYcGCATOI+LePwHLAhfVRgEpJ1kInY1arU0FJNlgo=; b=jsC9WyvhFJgSQ5 GPmALAMIhKbqwTVfnvileuwwxicJu9wRBo9qHC7YwVFYCaVbW49YN4QXtcrHJ99gvcXNeZvEkGc/r ZeFc0iYxpWpxMHFkZHr8VsoTxfS8oG46aCWyZN3NbnSvAusKc14qjFg67VJ5sAg6ttaYbNRgvGHjL 8Im0eGYRVWprcxIJZJcCvJBiDHKsf8EQa3MPICNKSHpkv0AeGFRz8Q0j3xBsXRxnxDivRN5nMKWku qj+UNBu9EorrFBRnnViXjdxZFPuYC+I5u+ZJt92uTiRqyZGcUCsLSk/dQJmqUvwgLy3+64nSvYJI0 iGAXyBdP3Q13KE6Kkktg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQU-008Ygr-1a; Sun, 26 Mar 2023 14:32:54 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQG-008YNg-2z for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:44 +0000 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 1pgRQ6-0007pl-GU; Sun, 26 Mar 2023 16:32:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ5-006rZp-KM; Sun, 26 Mar 2023 16:32:29 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ4-0088Ug-I6; Sun, 26 Mar 2023 16:32:28 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Neil Armstrong , Mauro Carvalho Chehab , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 014/117] media: ge2d: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:41 +0200 Message-Id: <20230326143224.572654-17-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=1851; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=1Y2LMBpcPDvt234Wp0dDVBnpVYLd4OVe9vUMJb/0CJo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaPHpPZLurdzamlVy431QhD+mjXxTj3yEi11 b3JX4DQ1+eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWjwAKCRCPgPtYfRL+ TokHB/oCVX586LRzYvkBN8oWwTVDT73e7QvszRskadSAbTyrdfG0dcliNNP2ISe6ZClTGMsX//c ojHnF2SfwNbxw1J/KhNver2BUCsy1bQ0sMHPsVpJ1HHhQ7ZxOAT3MYwydcrytIyk+UHZ0K5wcWU jLAfkcBDkCvQfzI5fcZPFEsnUpHmslqTLrKCpVtu0wJ/kgwOSL4yHDt95bFIICKuWj5W6hjEYjn 1ibxLueJ8kwI6/hCJH71RofwjUL+JS/dqvhAYgPWid6NjljemM4La2jMWgNLxSKW3q7JsmT/e6i YUNsIz2i0t8LnFBj9d/gdt31vCQwmE37Kew1ZVkpPGb7cbPq 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_073241_038978_E6390647 X-CRM114-Status: GOOD ( 16.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: Martin Blumenstingl --- drivers/media/platform/amlogic/meson-ge2d/ge2d.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c index 142d421a8d76..09409908ba5d 100644 --- a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c +++ b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c @@ -1024,7 +1024,7 @@ static int ge2d_probe(struct platform_device *pdev) return ret; } -static int ge2d_remove(struct platform_device *pdev) +static void ge2d_remove(struct platform_device *pdev) { struct meson_ge2d *ge2d = platform_get_drvdata(pdev); @@ -1032,8 +1032,6 @@ static int ge2d_remove(struct platform_device *pdev) v4l2_m2m_release(ge2d->m2m_dev); v4l2_device_unregister(&ge2d->v4l2_dev); clk_disable_unprepare(ge2d->clk); - - return 0; } static const struct of_device_id meson_ge2d_match[] = { @@ -1047,7 +1045,7 @@ MODULE_DEVICE_TABLE(of, meson_ge2d_match); static struct platform_driver ge2d_drv = { .probe = ge2d_probe, - .remove = ge2d_remove, + .remove_new = ge2d_remove, .driver = { .name = "meson-ge2d", .of_match_table = meson_ge2d_match, From patchwork Sun Mar 26 14:30:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188275 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8DB01C77B61 for ; Sun, 26 Mar 2023 14:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0mpHFjm8C/ahvfpoWd5HeQ638MtbvT9+27W8s/JD/ZU=; b=2vv0MIAog1a5dx XzXNq1c9whihxElHFx1UpVhWf4TIDmvfXAOXcoElcK8Vf4nTc9D8FzGZuBr7J6sYKOVhokublmtgC MaS0hx1CSF5tzusk170ODW84u8987kleY2rT6h7HGYNmCJXYBnErySvye7CULv/7w7Uk0yKzNehB0 +vlH71vTEyML3COVh3rlA9hJiv4Y0OcmAsaTUqMlPUpSYUoRUDqhZV8f8/A4zwWxJNVCSdJ1oPU5F cJU6DW85kT1BpXk4dL1Lex+Wwkn2/2jCFDDvwJHKOuF47hPhKYgnwpKQdRG3fRYUhDhTZPQbU27jm ijfyCpQOYYhWFatiLAZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQn-008Z4d-31; Sun, 26 Mar 2023 14:33:14 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQO-008YZQ-0l for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:53 +0000 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 1pgRQA-0007qX-KM; Sun, 26 Mar 2023 16:32:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ6-006ra3-7V; Sun, 26 Mar 2023 16:32:30 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ5-0088Ut-7N; Sun, 26 Mar 2023 16:32:29 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Eddie James , Mauro Carvalho Chehab , Joel Stanley Cc: Andrew Jeffery , linux-media@vger.kernel.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, kernel@pengutronix.de Subject: [PATCH 017/117] media: aspeed-video: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:44 +0200 Message-Id: <20230326143224.572654-20-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=1876; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=KutP+Y7ggmovOkH+OeVwSMF2KZqCIcZODewIzhblqao=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFab2ufSfDado4VWw1jF8GYECshQZd+1a/zYg l4extXNT1OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWmwAKCRCPgPtYfRL+ ToulCACHe8Da4FGG6yr9pXEmGcObel9MPRf1adnzUFyvkzR6IwLKPCgsOK11dGO2PnKVGe8zk61 FO+ohs1dSvLOM3MYJK1qZGCOn1fqXYBVeEkFGBeZBNeQkjVIvGi26NHIvqWuT+2nAQf1BinQzVy afjG1+u8rDvbDemgkbYniZrmNr/bYzmAgC7zcDX6emS/Qd0yyjid3+JIFXrtJaTnwSqAG7tKssB aC7AZ6XbOMypiGzO1y1rnJm2svskBsEECXiCm3gKh842J+BBctxlRgYJHQRHpRMT5zl8NBFd/Fn 3TttGRDOLyBGmP8RZOA3TbM0P+DU++97B6D/AM2ySH1Gh2pE 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_073248_306090_26C17F85 X-CRM114-Status: GOOD ( 16.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/aspeed/aspeed-video.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c index 794d4dc3a654..374eb7781936 100644 --- a/drivers/media/platform/aspeed/aspeed-video.c +++ b/drivers/media/platform/aspeed/aspeed-video.c @@ -2206,7 +2206,7 @@ static int aspeed_video_probe(struct platform_device *pdev) return 0; } -static int aspeed_video_remove(struct platform_device *pdev) +static void aspeed_video_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct v4l2_device *v4l2_dev = dev_get_drvdata(dev); @@ -2228,8 +2228,6 @@ static int aspeed_video_remove(struct platform_device *pdev) aspeed_video_free_buf(video, &video->jpeg); of_reserved_mem_device_release(dev); - - return 0; } static struct platform_driver aspeed_video_driver = { @@ -2238,7 +2236,7 @@ static struct platform_driver aspeed_video_driver = { .of_match_table = aspeed_video_of_match, }, .probe = aspeed_video_probe, - .remove = aspeed_video_remove, + .remove_new = aspeed_video_remove, }; module_platform_driver(aspeed_video_driver); From patchwork Sun Mar 26 14:30:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188325 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D10ECC6FD1C for ; Sun, 26 Mar 2023 15:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=04XjhEVF97kjOWzM/FcRhTiPhizvnCfXMStHt/7FLJc=; b=FwPgbgZBalxzFZ okGYyMOFan88QAMovcX4vGMRRyQGxbx8Gsk7oKgLCY5lWWh9j+5/edOTgq6uv4OSOb6ux+2KvUuVx ewCBfbTA0gVKctcsMnluUeLtlLhWmeSURY/hQd3xEcRIsuTbfVMO2U4cFG91lIxL1FDRoks9ptiAJ kT9bjFmwxkaE0IGOtS6ACpL3Ku7FUqHauMLuLYWUR6qfYQvGabc0vbiBA2mh54bqJKjxppr0rSh5u 7VM1RHWbqIAJ4v2W7vc6Maa+a9i1Lfll/BgsyBA2pdCGRMo296Nxd21SOtcxE0dAqri1jYI5BMnGy oGxhQQmNw0GlnoTf9NQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSZm-008k8h-0x; Sun, 26 Mar 2023 15:46:34 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgSZl-008k7Q-0V for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 15:46:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=1Qjqw10bRB3hDE8+PeW7Rt+pqRwlCDeX/9XQ4qLwZgk=; b=lGSWgboCeWOrjIKulvq9fbOUah 80XIPP/mXW8UmD2xGq7KUlAz5rDluFlOSyGtOUkHckbuaACBe+a4GOCI/ha17ZCt9FDuehxHD53qd JhjtaaJ6urB9RKt/zIvLkSaUSZ3s5RwaSeLEzT5kJewbWdR6Q5UBlB6MypFOi+uQt/FArunmGvREf 2bnfZ+0vAhbsg1eaFZHxHnWLx5i84uOKbDK0VmJNSJqHQybOIEDuwq16tHYGriL0DeWDA6keFYFq6 mNamnkJtNJHDB1UjaJRKJ4mjVj8/cfHr8uNPP4rKCCmc7v+4JdZRsX5K0JV0v1FzUc/6ku/gsonWh J6SaM0Sw==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQU-005qlg-0Q for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:35 +0000 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 1pgRQA-0007qV-Bf; Sun, 26 Mar 2023 16:32:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ6-006ra2-6n; Sun, 26 Mar 2023 16:32:30 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ5-0088Uw-DV; Sun, 26 Mar 2023 16:32:29 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Eugen Hristev , Mauro Carvalho Chehab , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 018/117] media: atmel-isi: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:45 +0200 Message-Id: <20230326143224.572654-21-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=1790; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OyX9jxWmd9TDLXV+fieICgqwCoyba6GM9yyt29ZPi6E=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFac7ad1LpFyPQNJC8wnhSzLOG+CMdj+T1f0l N+BuNEyOW+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWnAAKCRCPgPtYfRL+ TjjQB/0SkQ8CZag8EIFbpLjAq8MXbDjOeOBHJszlZaEOrcNCLzeGFS075jL+aHXMYKo2epVAzIC GF+ND/bI8C7icQ40wiUOZRPAEbbNGd7BBTaset14zyfUdAixzh35tS6mEpGy83xoNVUmKiWhcmT NoPGBr3LnYMA3phkXJ39qdSEUAmXXM6GvC1TFaSa0bS2qR1GGaDlyq0DcToofSeo87b1XTXcly1 v2tsYmixr3YuDajsM6T1thN3E9Hu/NHCqWenZBfWI3sgKiuUFF8DDAFjf/t02bZiLNNqp6h3nGZ Is6wAMVOyNWu0vVo+aOvghzuvEgZMi4+VyVdeg7WObI5zShi 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153254_451027_87CC63E6 X-CRM114-Status: GOOD ( 15.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Nicolas Ferre --- drivers/media/platform/atmel/atmel-isi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index 4d15814e4481..b063f980f9e0 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -1317,7 +1317,7 @@ static int atmel_isi_probe(struct platform_device *pdev) return ret; } -static int atmel_isi_remove(struct platform_device *pdev) +static void atmel_isi_remove(struct platform_device *pdev) { struct atmel_isi *isi = platform_get_drvdata(pdev); @@ -1329,8 +1329,6 @@ static int atmel_isi_remove(struct platform_device *pdev) v4l2_async_nf_unregister(&isi->notifier); v4l2_async_nf_cleanup(&isi->notifier); v4l2_device_unregister(&isi->v4l2_dev); - - return 0; } #ifdef CONFIG_PM @@ -1368,7 +1366,7 @@ static struct platform_driver atmel_isi_driver = { .pm = &atmel_isi_dev_pm_ops, }, .probe = atmel_isi_probe, - .remove = atmel_isi_remove, + .remove_new = atmel_isi_remove, }; module_platform_driver(atmel_isi_driver); From patchwork Sun Mar 26 14:30:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188322 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F831C6FD1C for ; Sun, 26 Mar 2023 15:46:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P5vnBntwI+GGc3fU6CbcmY0qNKbWqKYbeceySXcddUk=; b=NQvOh1tBB8zl06 8lvLaydkNfu7aeXjECMg5z0MhsDV/AW/wgujo6ORXhmAvI9iibeceSG2tVzYVW8w9ApJyj8xrUN2E HJVGdAuLRDqImSGnQ6Zezf93SgV52/0bpCwGlmnO54DKkzwlzn0eoUMB2Fm28zr5ps1F+1Mj1WQQl MNl62//Pp0smFHE8D3gCxdupmR3q85Smg929yrxLY4sXgQfscbLryHXExpVCU87TR6RHe+X7gVX8e ZqV6XOTGxkKHTT/mMByCfxr/mg36A6hd/iTnzec2Utqsd0+HcEnNxmBdiCF/C9frjSuwn7qGFO01s kE6nDM1/kzKHFOpVn93Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSYX-008jX3-1v; Sun, 26 Mar 2023 15:45:17 +0000 Received: from metis.ext.pengutronix.de ([85.220.165.71]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQI-008YOR-1p for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:48 +0000 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 1pgRQ9-0007tl-SP; Sun, 26 Mar 2023 16:32:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ7-006ran-T5; Sun, 26 Mar 2023 16:32:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ7-0088VT-5F; Sun, 26 Mar 2023 16:32:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Bin Liu , Mauro Carvalho Chehab , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 026/117] media: mtk_jpeg_core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:53 +0200 Message-Id: <20230326143224.572654-29-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=1942; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IZIj6Rcya8lyzehME46hWnaWQrNRiQ4RwQC3u+/JWoI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFalVAS2hpuonmHSWesmFzRyBeyN1VmK+ISfk cRh8yzEC4+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWpQAKCRCPgPtYfRL+ TvjzCACGLrL2wp5xaiQ0pyQSsecrPx148r2Ausl3xa6MLBfur3BBV0+z62ql2rlGDxsxI5X2t/5 nEegckpaTWYaEp/8gjbGCoCeXxmFnkHSY2/wq5X0tCgEoxIXkoLHtgRoSEdmY3wO6tyyx0Yszyq U1JUgBCTEZ13ZD49Yy0vBm9RMb5YsiyTDDOn+hSWovzV1tNlKUtBe6kqIzdC0R5YuYcziPoFBSs KAmFHvOp80/bM9edWCUBUC+pKnjUdbunIFfFIf1HE+uO4csbagP9lhXmuH64wrdLOhNPaDx6ZnY 0/K5zMXy7R6OvOO+7uMkxWjgxPdzWviMS8urx4KhxiYhTbJ2 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_073242_602318_EB51DF16 X-CRM114-Status: GOOD ( 16.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/mediatek/jpeg/mtk_jpeg_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c index 969516a940ba..e043da5ea325 100644 --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c @@ -1790,7 +1790,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev) return ret; } -static int mtk_jpeg_remove(struct platform_device *pdev) +static void mtk_jpeg_remove(struct platform_device *pdev) { struct mtk_jpeg_dev *jpeg = platform_get_drvdata(pdev); @@ -1798,8 +1798,6 @@ static int mtk_jpeg_remove(struct platform_device *pdev) video_unregister_device(jpeg->vdev); v4l2_m2m_release(jpeg->m2m_dev); v4l2_device_unregister(&jpeg->v4l2_dev); - - return 0; } static __maybe_unused int mtk_jpeg_pm_suspend(struct device *dev) @@ -1928,7 +1926,7 @@ MODULE_DEVICE_TABLE(of, mtk_jpeg_match); static struct platform_driver mtk_jpeg_driver = { .probe = mtk_jpeg_probe, - .remove = mtk_jpeg_remove, + .remove_new = mtk_jpeg_remove, .driver = { .name = MTK_JPEG_NAME, .of_match_table = of_match_ptr(mtk_jpeg_match), From patchwork Sun Mar 26 14:30:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188323 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1D8CC74A5B for ; Sun, 26 Mar 2023 15:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oeLuuYGIoZgmTrrj6uHzpc439TyyE8nmE2Z6V2wM7HI=; b=0kdy53jTwUb4IR LHVrtDOBeYHM/iUL2Y4up757kIWf/hKawLrEGsyDw+Y3gco6O9htbRUlkrm8F68JTjKibaMUerW++ HbuYIxM6vxx8VSP5Bc8/aNJ+85SkUpGB4xVFwRZrfTIQhmZtXoNj5H2qPKVzXZKenRkpXey11vFj/ 80PKSda0xmpcziZCDcyXIPCF7EYwFYFA/rxauDrczOfosOyuLOlmbUsW5r+R5xCgr89ks5nomOe/T InER1yw+Yr/54aIGoNu2ed4+lJpRl5QwmZMVd1SEiFaLpFD1YULNQbNuBd/QYYPYVml6lp42t0vXx UtLg+nPoBtOuAezqzDkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSYY-008jXs-2B; Sun, 26 Mar 2023 15:45:18 +0000 Received: from metis.ext.pengutronix.de ([85.220.165.71]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQJ-008YTf-20 for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:49 +0000 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 1pgRQ9-0007u7-Ss; Sun, 26 Mar 2023 16:32:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ8-006raq-0o; Sun, 26 Mar 2023 16:32:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ7-0088VX-Cx; Sun, 26 Mar 2023 16:32:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Minghsiu Tsai , Houlong Wei , Andrew-CT Chen , Mauro Carvalho Chehab , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 027/117] media: mtk_mdp_core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:54 +0200 Message-Id: <20230326143224.572654-30-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=1880; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=y8bSdpHxKUjCtkirbqVmfzAs2Ji59QmvfnVDIgdxzcQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFan6YuIoMjUGZnFCQzpGpWS/hnIDnLhYY6Pb Me2nK1dfZ+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWpwAKCRCPgPtYfRL+ TnOQB/9uXk4tzwoMLL/P51kVbWyicAA9ErSPE7tziq+q6StcUfDCBSAksMFr/C/N4DYWFnXZrAN ZhskqwE0/YIi8VBK9HVCgFn3ceDMqEVaENs4z5Udpr8cOo0MbRSBnOiVXsb9fMQwdsM63SZJ7j8 gpyngUq86GkXUGoiW1TY0aR5C1och9yyzawc4Eck6F2TzJOFimpCvYXiMK2MIDT/Sl9iaivxHOn oOCWhYTOtE96gymBOk17/xnQjQsLljkPRU+cZILEbUP48q8UcidqLzGmdB+Nl5cKarKt3QKWP4D cs64Ib3/Th4jWpkJBflC9/+R/fNKMJvQle91G7GsWT94GPw5 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_073243_656784_297561C3 X-CRM114-Status: GOOD ( 16.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/mediatek/mdp/mtk_mdp_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c b/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c index d83c4964eaf9..77e310e588e5 100644 --- a/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c @@ -235,7 +235,7 @@ static int mtk_mdp_probe(struct platform_device *pdev) return ret; } -static int mtk_mdp_remove(struct platform_device *pdev) +static void mtk_mdp_remove(struct platform_device *pdev) { struct mtk_mdp_dev *mdp = platform_get_drvdata(pdev); struct mtk_mdp_comp *comp, *comp_temp; @@ -255,7 +255,6 @@ static int mtk_mdp_remove(struct platform_device *pdev) } dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name); - return 0; } static int __maybe_unused mtk_mdp_pm_suspend(struct device *dev) @@ -299,7 +298,7 @@ static const struct dev_pm_ops mtk_mdp_pm_ops = { static struct platform_driver mtk_mdp_driver = { .probe = mtk_mdp_probe, - .remove = mtk_mdp_remove, + .remove_new = mtk_mdp_remove, .driver = { .name = MTK_MDP_MODULE_NAME, .pm = &mtk_mdp_pm_ops, From patchwork Sun Mar 26 14:30:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188276 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02A30C74A5B for ; Sun, 26 Mar 2023 14:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P0XWYbmWs96oP2NsuE5yUMi/OxEhEFf9VxKMPmMFmMI=; b=0rYtbwIH9upsxF XEkUKpX3HXZ6rDgjzktIntVlyTHueGL1VS7KtRj45z+vodR6vA4w1xAKZHDDxRpi5OtEU6hvgaJ4Z /nBUxR5t+7OWXQV2zOGpVvTH9LYIg2gplPbyOUeVuDzR3UkZ+NsRQxJf+7/Mjvy/B3gBatyWA+x0c 8RJ79U9ak+euiaRRuM/my8kqLXQR0ysTvzrNCL30lcW2Hg9BDkNclcgLkNFUnaDsBZ1ZQxuhI/3XA jfD6+G1EndTdABGO0RRgG942s4EKiLBmh7UTgAIl/OtlKIsB3tQ8Hx5gAJBgHBoo807JLw9pcfSHn f8fZn0tUCqhJhdbpiSRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQj-008YyZ-0r; Sun, 26 Mar 2023 14:33:09 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQL-008YWE-2y for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:51 +0000 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 1pgRQ9-0007uX-SM; Sun, 26 Mar 2023 16:32:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ8-006rax-CH; Sun, 26 Mar 2023 16:32:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ7-0088Vb-J9; Sun, 26 Mar 2023 16:32:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil , Moudy Ho , Qiheng Lin , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 028/117] media: mtk-mdp3-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:55 +0200 Message-Id: <20230326143224.572654-31-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=1763; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=jkf5L5dQSyQohhm9KTe95OwaXqfBXlh7AMsHg9iF88o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaoSBDTbn24ir03DGKWIxpj0tpH/SFo14z6b AA5Yd1GPEmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWqAAKCRCPgPtYfRL+ ToTHB/93xJPhkrxuOzwhK6gL5NavTvpgyizxFjQDjhtkK56Kh81623SABfB5cicKJBZkmBD/Eks h7t7fWz2Nq9y+3TAfkeb6D7mfu7euvZCNFM57LMPX2fKRAIORfa4WwtcMCnQaVITlrQCL2gLOvO 4S1GPprLyao83yeakOKSYE4EtFxsma8tmSCtjgCmkOpq7N1E4ZT6nT02OYAh2akkpKLioXVf6Ad aT2DgQVfO8oFJnVMUgPH1F/bCjDXNHvRaxNrWG98hpsAQyGO96M92JYFJuhcaK4J1P8YRNYeDBY bdBT5X+A3LMyFYlcECHJVpCdNaJJuu8/o0B3KvfR/Ibl5VVF 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_073245_969780_45A60FA5 X-CRM114-Status: GOOD ( 17.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/mediatek/mdp3/mtk-mdp3-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c index 97edcd9d1c81..041bcad675da 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c @@ -298,14 +298,13 @@ static int mdp_probe(struct platform_device *pdev) return ret; } -static int mdp_remove(struct platform_device *pdev) +static void mdp_remove(struct platform_device *pdev) { struct mdp_dev *mdp = platform_get_drvdata(pdev); v4l2_device_unregister(&mdp->v4l2_dev); dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name); - return 0; } static int __maybe_unused mdp_suspend(struct device *dev) @@ -345,7 +344,7 @@ static const struct dev_pm_ops mdp_pm_ops = { static struct platform_driver mdp_driver = { .probe = mdp_probe, - .remove = mdp_remove, + .remove_new = mdp_remove, .driver = { .name = MDP_MODULE_NAME, .pm = &mdp_pm_ops, From patchwork Sun Mar 26 14:30: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: 13188328 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4DAF6C74A5B for ; Sun, 26 Mar 2023 15:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Kmfm9lpU/w8J3Ece1XJ4/sXu1m3f6Ya+4tnmJ+fnG/A=; b=UStrDod+KBmIWN sPMUEhk3Ru02WHVf6xu4tQA1D7zjXbcs7qStFEQztazvVW+adP2ydSqkaZmR8Z1AYt9gYeLcc5Zsz 5SpBhxecMGkoWXqrX4y0HouQkXddJ/Ve/ly/JMOeP853YSEIbGWt9jNLvxrWLBrBJlIOw/my+EPcF wCxJ8A8o6RRpVz1FBpJesQ/Qv9lk3dylIegXJalKrzJCN1HA59BidNddgiROLJ2Rr1h14f8sDkd3S wkBMgFOT+uiYY8IaumfGTZEcFyF0Xxjbb8xOFUke76IdFwfC47OhPbIjwbVftoJVFotRJM3w5ZDfy dud+9a5LeKvHKaYlVRog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSaC-008kOi-0I; Sun, 26 Mar 2023 15:47:00 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgSa2-008kIP-1m for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 15:46:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=bKYtch1NzIoWm51qQK0bEa6s/Bh0d3kZkLWDbmBG12E=; b=iuJVn6Tb1Jd0KNjuaYQmmbDI+f 05b1A3vzK8XFdmWQhkbuv9zy4E2lZQQ2bzp2ph/Zvt3gxBkaZM4U9WK8LfdPMQ2nA3YjCC9VeaMiX Vo4bT7NmJtmlauvXqZLlBAP53+zuAftirO0/TDwtNoHYwUdp7jup942GXOexIRhhXQsj89Zzho++T Sy2ZY3wpyC4xz4cOjFTug6JjIXm1Vnv9K+J0gOSSXkkJ1FCVva47h5/MG7az0H4z+KjBDs2Inms8g Ha5Rp1sSKenjhSRPi1yNFNSkpwi1Kszl7lOzkBvGqS833i5uapGb2QCbx8kmj80dMUqDXpB0Bcu1p jckqSXrA==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQT-005qlj-39 for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:03 +0000 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 1pgRQ9-0007ua-Sq; Sun, 26 Mar 2023 16:32:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ8-006rb0-Eg; Sun, 26 Mar 2023 16:32:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ7-0088Vf-QB; Sun, 26 Mar 2023 16:32:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 029/117] media: mtk_vcodec_dec_drv: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:56 +0200 Message-Id: <20230326143224.572654-32-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=1894; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=O6z10/slUyNl2TD3diJ/WCSRZtqpk39pLLrKXrHKrTk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaptPdsjpR2hYatPNI+aLWKfTwo2bR59OOa/ LPnZBIQs1aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWqQAKCRCPgPtYfRL+ TntbB/0VncSjZPipPwEbM/MkOFDUQEJYwx+uHEot5G61sCpHx1UYJ/7ABORc9e/cM1Eabk724kb 4mGGmjzvCq2fqKy7T4c/GNADCUYQHXz4IvL6wPblz20n+aLcBlFwHy+n9Vf3PQ+bgwmel0OMchB lXXoSynM1iWWiLQEKeJFeolcE9xK0ZIlSCA1L2BuopuervaxVyEJzUeB3sgbCQ8voZ6cuWh2huq mOR8XGkJFulQAQlonFDvGod6TydUJsWAV/osMcOfEfaH6tm0l7cxQiUhEU2DK83bmx02VJ6Ehlv JqqAGF6dB9dEnD88yGwtkNvvYUpbUrQJgLYREDTQ0/av4imk 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153254_101904_C85269A4 X-CRM114-Status: GOOD ( 16.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/mediatek/vcodec/mtk_vcodec_dec_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c index 174a6eec2f54..2fa5c5e6607c 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c @@ -487,7 +487,7 @@ static const struct of_device_id mtk_vcodec_match[] = { MODULE_DEVICE_TABLE(of, mtk_vcodec_match); -static int mtk_vcodec_dec_remove(struct platform_device *pdev) +static void mtk_vcodec_dec_remove(struct platform_device *pdev) { struct mtk_vcodec_dev *dev = platform_get_drvdata(pdev); @@ -509,12 +509,11 @@ static int mtk_vcodec_dec_remove(struct platform_device *pdev) if (!dev->vdec_pdata->is_subdev_supported) pm_runtime_disable(dev->pm.dev); mtk_vcodec_fw_release(dev->fw_handler); - return 0; } static struct platform_driver mtk_vcodec_dec_driver = { .probe = mtk_vcodec_probe, - .remove = mtk_vcodec_dec_remove, + .remove_new = mtk_vcodec_dec_remove, .driver = { .name = MTK_VCODEC_DEC_NAME, .of_match_table = mtk_vcodec_match, From patchwork Sun Mar 26 14:30: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: 13188280 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3987C6FD1C for ; Sun, 26 Mar 2023 14:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nfbtlolzbmOoPnRV1c3f05el13ImcZ82HBzoqG+rtT4=; b=MhFS5Z9LCGoWcn /wOoY4+U8x+izvlMiGvDsr2Y7TMxnmCiwVLNjcRSAXfQAuBEFsrG0W9Q2zFZU7lrxQAwn8K/4Cs45 iiRS8Jdt2opBkFYxd9bb5tF4gOAbQfA9iFVw2maNWKWUBMMRygGyJzstySP1i5Qzo2cChJ8WAFLu8 +hQ8KoDGLZOfGJzUQJw4XmuhhZjk3Kyb80jAjhbvnr5JbetSnlT/bPw3B5tM2ZQoUOmEtx7SJD6OG oEHKqDorrTil5RqRSXMYjDHikx7iXANkED+UFZuPOYr+MAw+pIlUi6jVEHO6mj/96GoofIzQ/PNXf hDI7P3v9VBdKG0hDNGxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRR0-008ZDs-0N; Sun, 26 Mar 2023 14:33:26 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQb-008Yp5-1T for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=T/pK3EXrTkJd8ReqzJcuIVKZoOGqXk2SRN6UY4Ykjsw=; b=BTOgXGt8BY+pvpNoeRNp1ibBs1 aXdqjXcPU8Z2OMayyQ3LlxPD1eJmJg5EJo+IJk9EhitnoCzBTZzoPvn5g6EPMg+G34o38m2ML0elV OzQ0+NaURkMe0zTv0HHh6CKPRMT0e13dbRCrlGOQbN/B/NjxCGV1SBTieJ6DNXkRg5yFovLfkxWsg lbPYLCaaoPttaKMF/qaQlxnk4930EIUxGNRQhRbeJRECd+QKtbNmzWSKFY0hb/woUqSA1L8bcDkr6 2n4C7hpl7CqJ9m0Y5OPdpir99h7HAb1QmazRDcpLG6BGKocuMcM1daHRkxvUhr1PNPmpvIwu5u+Ws 1T8suGjg==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQS-006aQh-2L for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:00 +0000 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 1pgRQB-0007yF-0u; Sun, 26 Mar 2023 16:32:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ9-006rbB-E1; Sun, 26 Mar 2023 16:32:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ8-0088Vj-0T; Sun, 26 Mar 2023 16:32:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 030/117] media: mtk_vcodec_enc_drv: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:57 +0200 Message-Id: <20230326143224.572654-33-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=1904; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iWZQWni5H+Z+BEh9nLVGdQ7KridiLmts8udqla8jAqE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFarZ2Tvj6+2UCxNTYlxWwzIXahGDoc2x8SpM QxSpw33l6yJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWqwAKCRCPgPtYfRL+ Tk3SB/4iM2L2a0F42ERFVuzNvi9MbRs/YSxe0/SmKJMLjJ7qf9uAbuQqOmOwq8IXUZp9mYXT+Au JJ1rtkxh9JEvX/1ZOAbuM+9+Txn/q6Gr4E8sUaHQ95I9ai0nXKmAJV36oboKqxsjlMZwU6gqHwZ ihvXgnKCeP1IJEIPkvMcXcym6yvfQf+sXr2usGHmOHH1YynvZXA8c3+vur63y3RgclWUe4iIohn yu55dnrJLFQY52srRK/nC+s6p5nm6QQq9sRStI6FjgLhRTMpR0ryrx7NpHI9xmieAv3+9xrKnmG nx3wz4OqYuWyzueoHADdA5vthEXfmswE9gHcw5qrejLVdI/J 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153252_166717_E72FAC97 X-CRM114-Status: GOOD ( 13.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/mediatek/vcodec/mtk_vcodec_enc_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c index 9095186d5495..cd0d5da8195a 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c @@ -451,7 +451,7 @@ static const struct of_device_id mtk_vcodec_enc_match[] = { }; MODULE_DEVICE_TABLE(of, mtk_vcodec_enc_match); -static int mtk_vcodec_enc_remove(struct platform_device *pdev) +static void mtk_vcodec_enc_remove(struct platform_device *pdev) { struct mtk_vcodec_dev *dev = platform_get_drvdata(pdev); @@ -466,12 +466,11 @@ static int mtk_vcodec_enc_remove(struct platform_device *pdev) v4l2_device_unregister(&dev->v4l2_dev); pm_runtime_disable(dev->pm.dev); mtk_vcodec_fw_release(dev->fw_handler); - return 0; } static struct platform_driver mtk_vcodec_enc_driver = { .probe = mtk_vcodec_probe, - .remove = mtk_vcodec_enc_remove, + .remove_new = mtk_vcodec_enc_remove, .driver = { .name = MTK_VCODEC_ENC_NAME, .of_match_table = mtk_vcodec_enc_match, From patchwork Sun Mar 26 14:30: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: 13188286 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80578C6FD1C for ; Sun, 26 Mar 2023 14:34:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XE5tclWR8fFyuiA2WQpHUGHsJhbGxFUNeatDLQYUPBY=; b=ymkbaFsX+JrP5z yWBAuhC5zHJRYjGEwtjf7sbSAaNcQcAkBwslY9tQ+dwFblqD05GxpoSe2F9YQpSM1jy1Bg5W6nbK+ WLFTmT2YbeVED76qCWWrPNzLFt5G/jn3S6Qxvy6YYz8Bko9o3YDMaJTT1AijHm4A4+vdae0QSQPt2 B93MJcuvKib7hNB6F3Lsqux00pimCQmxMrANqfRFPaTyIxD299ZvSDzQBnnIPO7ikxF7t9t4gamwB lG85+kPt2zeTXR7P0om/rng/4mfo9G7F0/Yg00QyE1uX3S49KSnUxaaG5h1m8Ea4jVAUo1dcTzko/ n6Fh+PXq9RId5lJF9KOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRRE-008ZOV-1p; Sun, 26 Mar 2023 14:33:40 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQc-008Yp8-0y for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=Jlk6m/KEPDyJbcUgQACZlkUk4rg5OOUxbhtEfK9bxKk=; b=KBpxNzurLW6CXbuvtfcaD+NZBy UMcZc7HRzwhSX8eUyTl2yTcexSKnnWmSuGld6FjkUaJMvpi8Vh067f+hq362XdlXtrEFO+kTdZxO7 d6gumXthpzckp4ucUMijuKQyaRwd1AeVB+20Bi5FeE+/h6/HZeCjf8yP4t2lzsQkFX/0Jrt/5k2qa iSf+PGpItwaHIPUbfBj0sHmWbvG2+4OFaP6zjlb0U0zPPKZB9aBIoEIJudu5+d7b1H6+8gHIIYsFh YJq8Ifav/L+/Me1Q5r26AeAIL3mGdm/Itc9In2q8faoMufQ9+0IP6RoSLkmzfpp+ReooeGojB6XzF +Q1q8pNQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQT-006aQs-4k for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:01 +0000 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 1pgRQB-0007zm-6n; Sun, 26 Mar 2023 16:32:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ9-006rbF-LU; Sun, 26 Mar 2023 16:32:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ8-0088Vn-7D; Sun, 26 Mar 2023 16:32:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Minghsiu Tsai , Houlong Wei , Mauro Carvalho Chehab , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 031/117] media: mtk_vpu: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:58 +0200 Message-Id: <20230326143224.572654-34-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=1833; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=5AnskvbJ9P6qn4bjvfh8odB1G7YnnigrgkIsVya1kFw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFasvO2cvWqi/Z6zq3C/m+ICsHa4M+7Z3cNjt ZBzIamySpOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWrAAKCRCPgPtYfRL+ ToTyCACzflSqkfkNslDRxcB7Zlt5Y526OmU7az8FU4sINBxILXtY25jkHnky6BMeeS+In+qLJ3j ogZQT2BX1uJLwC9oVqthcfsca1u1ujUV3ugS0g03UFqvzc1MrdiwcNWd8yEQrrciYoSu26Ju+gc nItJWUAKA49+D6SE+bxte27q0hpfXgCjUf/PLfEpv7wSP/RD9Z2c7QtSK9CGLDKwiCIzw+0UUXo bSg2MJmODWi2mOITVH9Y0bZPtCK0X6z3kyccACRVWK+PBgYNgLVdHraAOG1h2GBQUNSwNuRsClO WnIPUZnDjLzXnR2AbZCXixWhGY6uPuRFzmI8Mk7pcSrwoPg5 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153253_363384_5682A8F6 X-CRM114-Status: GOOD ( 14.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/mediatek/vpu/mtk_vpu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/mediatek/vpu/mtk_vpu.c b/drivers/media/platform/mediatek/vpu/mtk_vpu.c index 47b684b92f81..5e2bc286f168 100644 --- a/drivers/media/platform/mediatek/vpu/mtk_vpu.c +++ b/drivers/media/platform/mediatek/vpu/mtk_vpu.c @@ -953,7 +953,7 @@ static const struct of_device_id mtk_vpu_match[] = { }; MODULE_DEVICE_TABLE(of, mtk_vpu_match); -static int mtk_vpu_remove(struct platform_device *pdev) +static void mtk_vpu_remove(struct platform_device *pdev) { struct mtk_vpu *vpu = platform_get_drvdata(pdev); @@ -966,8 +966,6 @@ static int mtk_vpu_remove(struct platform_device *pdev) vpu_free_ext_mem(vpu, D_FW); mutex_destroy(&vpu->vpu_mutex); clk_unprepare(vpu->clk); - - return 0; } static int mtk_vpu_suspend(struct device *dev) @@ -1040,7 +1038,7 @@ static const struct dev_pm_ops mtk_vpu_pm = { static struct platform_driver mtk_vpu_driver = { .probe = mtk_vpu_probe, - .remove = mtk_vpu_remove, + .remove_new = mtk_vpu_remove, .driver = { .name = "mtk_vpu", .pm = &mtk_vpu_pm, From patchwork Sun Mar 26 14:31: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: 13188272 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6CAABC74A5B for ; Sun, 26 Mar 2023 14:33:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hZyy5NEiCZssm2wvg8hp0g3uzQ6G+FzdcDOIyY/Hcvs=; b=4SLNwJXF4MJskd wghEbnXhYWLjTMnC8mCWHVLbKzkVaKvRD7qZ/qQozK0a+S+VKpuh48tJqN/nnLKPJPXwnwXVZS6QW VuiJu1g3knZFKNUCXAw/iZ6PJ4cmYFajr6tQg41QlJ8RbflSSo0vr4jmBV2mJQ4Uj2rF006g5JymI Eg0sRXOpbN0DkboQxo9YenNk9GqWOBtJcRPCFDtVztQHQW/HdEIv4LMm6xM4oU3AazsOS6vckTND4 qDmkvsFCiGUd6KCLhnTX59s87Bt16TOFz572cOLex5huLW1YTQ7ez2pjAX22J1Blg7cZkT0SUPwZ9 EMjTJuzaoxP+iNKCmO5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQe-008YtP-20; Sun, 26 Mar 2023 14:33:04 +0000 Received: from metis.ext.pengutronix.de ([85.220.165.71]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQL-008YWA-26 for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:49 +0000 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 1pgRQC-00083z-Oz; Sun, 26 Mar 2023 16:32:36 +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 1pgRQA-006rbZ-EU; Sun, 26 Mar 2023 16:32:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ9-0088W9-Hw; Sun, 26 Mar 2023 16:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mirela Rabulea , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer Cc: NXP Linux Team , Fabio Estevam , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 037/117] media: mxc-jpeg: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:04 +0200 Message-Id: <20230326143224.572654-40-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=1857; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=he/DS5KxYHpU6tXKKwvBsO17OKmtbjtQ3f2TV/xs1jg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFazsqIWM1CxZL1FRbfxXtH+SlGMFWFNtycYA GLe3UUvhbGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWswAKCRCPgPtYfRL+ TpcMB/0XNfc6SXV0I+lvFu+DCee6vfUhHM4Kzzv7ABmQJKLaSK8poHKU9AiSJ1qUsV4G9cJL0Z1 ltJylCOGJ6K205hE47qXoM7btvLrkpZhsxAYdEtfUEUnFsMmynqPT2k+08zijk++7ynn12/1qxQ ovQI8egdLEVokRaafJdcdTISKu8mdwxG2Ai0AEfw/gBSH04J+1KPTyFPe+hXGtnHcNUwsMfGCfb FiQUdKe0ZVoR52pvqWvX3vuP0rsCd3PmVyQA+ZGFmu/txTA+DoOanIszyeOSV/BEfFT7WXoXGpK MGHmBehFyqgTKZZ/ko+O2Ie9poX0QeVD7usPVziMYhF/DuAg 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_073245_686282_02C3F592 X-CRM114-Status: GOOD ( 16.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/nxp/imx-jpeg/mxc-jpeg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c index f085f14d676a..4dd404d69c4e 100644 --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c @@ -2622,7 +2622,7 @@ static const struct dev_pm_ops mxc_jpeg_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(mxc_jpeg_suspend, mxc_jpeg_resume) }; -static int mxc_jpeg_remove(struct platform_device *pdev) +static void mxc_jpeg_remove(struct platform_device *pdev) { unsigned int slot; struct mxc_jpeg_dev *jpeg = platform_get_drvdata(pdev); @@ -2635,15 +2635,13 @@ static int mxc_jpeg_remove(struct platform_device *pdev) v4l2_m2m_release(jpeg->m2m_dev); v4l2_device_unregister(&jpeg->v4l2_dev); mxc_jpeg_detach_pm_domains(jpeg); - - return 0; } MODULE_DEVICE_TABLE(of, mxc_jpeg_match); static struct platform_driver mxc_jpeg_driver = { .probe = mxc_jpeg_probe, - .remove = mxc_jpeg_remove, + .remove_new = mxc_jpeg_remove, .driver = { .name = "mxc-jpeg", .of_match_table = mxc_jpeg_match, From patchwork Sun Mar 26 14:31:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188278 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0573AC77B6C for ; Sun, 26 Mar 2023 14:34:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vlsx2xGfFUGeE+CytrAymbFsYEPYZAG0kpgQk2SgwyQ=; b=OoMESLH0U4J0rG DzFB36rV1z2jqngKaPHJQdO3tH4ZGUKzPd5R2Y6G1EQh/ykIt6Zw5sC653Y1+l3uVw8t4AtDyma1F f7DTj4MNxHKEySLMev1ZwuB4UvtvkhwSDaXbwfhTe8dPH2hs7Pm2d0D6hS0t+40/m1auKXSiHqg5q cd4Ev22siYejAtT/0pHNdtt2I380511DO4jIk6wNlqvpNUmR1WEvxC3XK2D6uk6XRy/+qj61hVFFp YyyH2m2YEo5m8vaaxAqX5ZU9mOTiuKsANRcV1PF7GNAXE/KP90+B2OspzH69MBaTGF1rZUrVEgkq0 Z7AovGf8cLlznHwlKp9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQs-008Z8h-34; Sun, 26 Mar 2023 14:33:18 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQX-008YjE-20 for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:32:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=B2102ThMKc8b7LmP+apLTwjJSF35U9ajOiGUKjgommo=; b=e//kCiXPABT5AMxFlFhuvpvlfT mNkqEd9V4tgq4/Sy64VH/+kWLFjsYW9yFjHgmqrZhmXiG1httaUcbuS5MgMsJDNcaT/DOWSvKNHeV ns6dBwosJOfca07LpLTrBwo7SaQfQbeqEOxWIXojGTggIBTbCm1yCmVsa0kqBmwmSEJGmulQS/Mlj 8+RQs1JfpkmrWV1GdzqSNgHxbVSvDvTxoAASFTHJLiOUPzgbhWla0BuUtKVx4yfWGXFM43mTiTKUb yIoMJ8vmrWBug/aooQpqX1j7uRPnHNkuApBu0X7VR4omCz0Ddu1CZo0kBuch42B2NEIhl3htNNa3P OABuQLFw==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQR-006aQg-Qo for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:55 +0000 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 1pgRQD-000852-3S; Sun, 26 Mar 2023 16:32:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQA-006rbi-Ml; Sun, 26 Mar 2023 16:32:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ9-0088WC-Oi; Sun, 26 Mar 2023 16:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Rui Miguel Silva , Laurent Pinchart , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer Cc: Fabio Estevam , NXP Linux Team , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 038/117] media: imx-mipi-csis: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:05 +0200 Message-Id: <20230326143224.572654-41-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=1943; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=g9vpE9AZ9skiilxNFIWrdmlq9kjJ2H01iBx38QX6sjM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa0ZmH/OORjShWZ6729b1/os/FQJ7mcBVvHa TixsF4hCD+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWtAAKCRCPgPtYfRL+ TqI/B/9sOhnR0PJ8q+h1kKuiOTesOhoJzFkzg2yMAVElAtctGh5I3d3Crgu9Hu3dAIcLhKtrT3H DRSBa5kXyKKLMkCKmPre23JpE4zHLvNS3GCaT2c4JXMsj1gPe0ku/y1iSo0ptobDmv8XRsEvlS7 IX+Po4xY56NPmGfyUSxh0x3Mwr7mq5C2DM/Ii/gqjNvxtihGAWjN/XXNOqSkK60Owp6Z1QNyc3A gD7S4VG2vuyJNYaCtAHj1s5G/4jLVrGfeQfhmXpQ50k3i2sPJYnvRfxInZjTgSk8LFqBogulQrs LUnz/74mHB5YbWXJTJ+ZblpQCyPCqQ3sHmfK+hIVn3IEs9ap 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153252_003267_975860A8 X-CRM114-Status: GOOD ( 14.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/nxp/imx-mipi-csis.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c index be2768a47995..05d52762e792 100644 --- a/drivers/media/platform/nxp/imx-mipi-csis.c +++ b/drivers/media/platform/nxp/imx-mipi-csis.c @@ -1503,7 +1503,7 @@ static int mipi_csis_probe(struct platform_device *pdev) return ret; } -static int mipi_csis_remove(struct platform_device *pdev) +static void mipi_csis_remove(struct platform_device *pdev) { struct v4l2_subdev *sd = platform_get_drvdata(pdev); struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd); @@ -1520,8 +1520,6 @@ static int mipi_csis_remove(struct platform_device *pdev) media_entity_cleanup(&csis->sd.entity); fwnode_handle_put(csis->sd.fwnode); pm_runtime_set_suspended(&pdev->dev); - - return 0; } static const struct of_device_id mipi_csis_of_match[] = { @@ -1544,7 +1542,7 @@ MODULE_DEVICE_TABLE(of, mipi_csis_of_match); static struct platform_driver mipi_csis_driver = { .probe = mipi_csis_probe, - .remove = mipi_csis_remove, + .remove_new = mipi_csis_remove, .driver = { .of_match_table = mipi_csis_of_match, .name = CSIS_DRIVER_NAME, From patchwork Sun Mar 26 14:31: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: 13188273 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81777C77B61 for ; Sun, 26 Mar 2023 14:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Q07/MzwqSySkisUprEsC/YUjjzAx6vDVkTkXj4cDEXw=; b=hzspXVl16u9aFs Q1+NWDvpC1q+1WyX3bsHVj7GtBtRlYC2ZHjmzQMVO/Byx5CBFJhYFULrZ5Jhhk3bzM9coQ5QyPRDm H1AmBvWL0O90LRYCvaIu8LiNX6SEDICUNcMH8QWGcSxbRlKysY6LiHu0p/SCO/m8faGC8VZwvrnrv yxrUA5qjH8lB/Ko0ipuwMbTfNddkJQzJn+pl7a6K3WmKRpgUaDKlRd31SI1FLyNXczaW6kTsEYixN xF/khPg2P6XtR+IW9V27WBLK87en1ndOg7PDxjaXzq5Wp5saA5/e/7+J9JEtuI8YtCIEYndcy/led ADbNN8xMeM9l3IdZaO6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQg-008YvC-0C; Sun, 26 Mar 2023 14:33:06 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQL-008YWF-2y for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:51 +0000 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 1pgRQD-00087U-ID; Sun, 26 Mar 2023 16:32:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQB-006rbp-6w; Sun, 26 Mar 2023 16:32:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ9-0088WH-Vn; Sun, 26 Mar 2023 16:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Philipp Zabel , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer Cc: Fabio Estevam , NXP Linux Team , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 039/117] media: imx-pxp: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:06 +0200 Message-Id: <20230326143224.572654-42-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=1769; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=mVUQPhy61vCRwq0BXxL+2o+PGJnktd/oNm3ktQgT7jo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa1voPinyhetmZyrYhk5xNO3LTQw0NaMqqMc MvXsoUY2ziJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWtQAKCRCPgPtYfRL+ TlABB/4za/6ou3sGTJIz2Ml7ZJC6i7yqbn2lFL3XaxUEuPBy96zgCfOFHc4SgR92m+XpcxCRpK3 RjTtGO5wCYUtyf2/1Gr/8q2xGKwiFEMknITYuOO0xyPskA4bOtSvXxNNyuKb5JgU5BWb6UDfQ0a v41wSUhJkmgFFHreg1+LZq3dq77L0ygdCCcrZiIh4AWmcvT5HhjJ45YYwnasMihmPOXuc5lGNyd zyGH2eE/Udb9UHoQwiMgqo1gkZfqH0jiIoPwiiOjIVUFGT8m+WbpXQbdgLpzGa7bZRViRehs37v Qe+Eyes9NLoFwN2Llzzp4eIqhspTU0p+DQRbAzYLaFLv3fsV 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_073245_965133_54BF4F30 X-CRM114-Status: GOOD ( 16.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/nxp/imx-pxp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c index fde3c36e5e1d..90f319857c23 100644 --- a/drivers/media/platform/nxp/imx-pxp.c +++ b/drivers/media/platform/nxp/imx-pxp.c @@ -1904,7 +1904,7 @@ static int pxp_probe(struct platform_device *pdev) return ret; } -static int pxp_remove(struct platform_device *pdev) +static void pxp_remove(struct platform_device *pdev) { struct pxp_dev *dev = platform_get_drvdata(pdev); @@ -1922,8 +1922,6 @@ static int pxp_remove(struct platform_device *pdev) video_unregister_device(&dev->vfd); v4l2_m2m_release(dev->m2m_dev); v4l2_device_unregister(&dev->v4l2_dev); - - return 0; } static const struct pxp_pdata pxp_imx6ull_pdata = { @@ -1943,7 +1941,7 @@ MODULE_DEVICE_TABLE(of, pxp_dt_ids); static struct platform_driver pxp_driver = { .probe = pxp_probe, - .remove = pxp_remove, + .remove_new = pxp_remove, .driver = { .name = MEM2MEM_NAME, .of_match_table = pxp_dt_ids, From patchwork Sun Mar 26 14:31:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188274 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1B1EC6FD1C for ; Sun, 26 Mar 2023 14:34:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AGbEDMk6rn4iITlGqWHpbQnpabhMrEZ5Lo7SYT3upfk=; b=ZETQfgN+Z+/E0c 2XrRBST78hFaDIGV+Cpvr76oEkIriRWCpqGYAuNAS3jQ/aL5aWnWPwKDZYhWgk3pPmvbt96w4bYkr RjQzs268GKH021zZ8RK/c/wP4h7v6wwE7IpBFyZnFg/y7P/1Py+md2Il7l1iYEoveWZQpQIaVapNu 9OyuvKn00+w87dTpAyK+WwaXx1w9+FJG4R6e66dDiIvzmfU4RdwSULqovS/If3g8IEPnu16eL5yxu unVGoGXIvHC4n4mB2TYrCRPBUFFGyOP9MlCtcALPHlmI2UZXFjRcCUuhmRGuThuLlEPlFjiHqNCBA cvp4sanPJt34NufpxkjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQl-008Z1z-1m; Sun, 26 Mar 2023 14:33:11 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQL-008YWH-3C for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:51 +0000 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 1pgRQD-000881-7r; Sun, 26 Mar 2023 16:32:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQB-006rbr-8u; Sun, 26 Mar 2023 16:32:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQA-0088WL-6M; Sun, 26 Mar 2023 16:32:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Rui Miguel Silva , Laurent Pinchart , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer Cc: Fabio Estevam , NXP Linux Team , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 040/117] media: imx7-media-csi: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:07 +0200 Message-Id: <20230326143224.572654-43-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=1872; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=EHmAwc5CElaBSZ9+9vvkD8ZZISHGW5Ahfuivx7WO49o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa3mYsOeikmiEQJFYElae3MsqEYG79iYj63C k/2Ws7tE5GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWtwAKCRCPgPtYfRL+ TjmWCACxbtRyWoIHYdRH3oYsHH0xdyTykhvFUJu1F2lgLMHQ5pr9RId81ZIiUEK0sExyUHDSTdz wat7oLBXD1h27mAF83033mbgBntCtd+1wcP06ArIjGQrZAg2avxkq3UJObHAvrPaqXp58pwwkNQ tek9veBau8pLnfvlbc/2GevfDv9HHeFQmleQ0rBSD1VpHcZsACbtOlpHAA5aoFzeiKxUfLER7a1 VTiY9EO0lzL1mR5JIaHZflnQgPu9Mrsl3a8RjcBFS3CaA2PqKGRdzlOhiVqQ/apPZnGfHAFi1sw Yuk2jKwl9flNaB11vIGLu111LMHNmbZH10LFr5FzYijJNoHk 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_073246_033424_CF5E6975 X-CRM114-Status: GOOD ( 16.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/nxp/imx7-media-csi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c index c22bf5c827e7..9ee46c17bd02 100644 --- a/drivers/media/platform/nxp/imx7-media-csi.c +++ b/drivers/media/platform/nxp/imx7-media-csi.c @@ -2278,7 +2278,7 @@ static int imx7_csi_probe(struct platform_device *pdev) return ret; } -static int imx7_csi_remove(struct platform_device *pdev) +static void imx7_csi_remove(struct platform_device *pdev) { struct imx7_csi *csi = platform_get_drvdata(pdev); @@ -2287,8 +2287,6 @@ static int imx7_csi_remove(struct platform_device *pdev) v4l2_async_nf_unregister(&csi->notifier); v4l2_async_nf_cleanup(&csi->notifier); v4l2_async_unregister_subdev(&csi->sd); - - return 0; } static const struct of_device_id imx7_csi_of_match[] = { @@ -2301,7 +2299,7 @@ MODULE_DEVICE_TABLE(of, imx7_csi_of_match); static struct platform_driver imx7_csi_driver = { .probe = imx7_csi_probe, - .remove = imx7_csi_remove, + .remove_new = imx7_csi_remove, .driver = { .of_match_table = imx7_csi_of_match, .name = "imx7-csi", From patchwork Sun Mar 26 14:31:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188289 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CED5BC74A5B for ; Sun, 26 Mar 2023 14:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TuFKf8LtahyOnrD1AZb7WTOukZJvzTOQZG40drPhPM0=; b=0oX/F33XIaZpdx mgH1jzhLi3EyahO0Syh/6W7AHUzTE4htJ0xQz0eFXv/nDP34EibL8CQhxLUyvjynvgv4OxX8Iogbw oqD2sHf5+8zY3NZQdzI7mPKfKIPFE18MjvgS4RuoCZb1vXN5ZNml4Lwr11G1VqCyMOlna391sb7/c U7mL5oJuAmtZC1QlShWze/jSV9ZElPyu1kzCGu9xoBs0Gd/0i3ZKAbRUHoCfsql6OoQmbO/25Vday fqKkuHQuHO4f6FU3z+hXL/U0QOe6oCJ3rqA7BKg/3q220SSKwHHb+gcMKWOi4ceG5AgCTgMmFyjOg duWQDycIYfweaOpumvAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRSD-008aEf-1k; Sun, 26 Mar 2023 14:34:41 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQl-008Z1R-1l for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=O3dLPb25KkVbQHhROJobFc+hmqqQpVIqv2TaxdiZcSs=; b=KaeYAkUgcT6It4cLcOUDrQopd7 Nbo4wtcQTx/P0ePO73sXBQ2ioEieGeKJnYbpMEZRYliuW7EUzbX3f67psRXfyT24AmBu9B8+ARTbI NxpQJZONfsGvkBPnJekN97vFTO6JX435rzF5HUdkqCJI2RexB1d4GykXVsYhxosg6XyGGo4y/m6ao qWCKHs0SAtiJlyYHylxhl95unIePHunW6NVu5lFH2B+eB/GB75jVsgmE62ds8UxWnupnAt/T3S66O kVOinbjNjLeBV7i3dUm9kL0MKp65Ya8hk33d0D6UmBPZes7LLGojpLj2TBzms2Pr6pecp7DQ9vDDA AVllZolA==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQg-006aQm-OO for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:10 +0000 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 1pgRQM-0008S2-Pp; Sun, 26 Mar 2023 16:32:46 +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-006rdO-Qe; 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-0088XZ-6K; Sun, 26 Mar 2023 16:32:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jacob Chen , Ezequiel Garcia , Mauro Carvalho Chehab , Heiko Stuebner Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 059/117] media: rga: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:26 +0200 Message-Id: <20230326143224.572654-62-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=1753; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rQQfsHrwV+c5wQvF4lxwVI1GbxtOlE3rn040X1cCNXs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbNZWAoNfeZ9R1R0Vor7bhu8//Bx1HBz2Mvn 0ZZ6FSPkJeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWzQAKCRCPgPtYfRL+ TkKbCAC3ciBfPEnrewhCphhzSZ6Rle7/TOFS75TLT2UAgJBi2wBF9i1OqQtpBCR2MJ757dV0EHS 29H8a2jNlXTrt17GCzk+Nkf3uC1mbcrFPkQFS6JmnD5RCcLdX5/48563D2J7MDa/a70OiXpu9F2 pxG4750fz8oNQZMlYcyjm9/vZQcDmMi5+iIf8IwYNz9PAjBzEZSHuPcMrLGIIed/2zZIQbuPbEO ePSPCv71Y9BZB74NpmbPQ6GwLuGtBg/Q8+ifuz2+Ud5MvXjpfAkDtFf4BL018kCjKKLE0SNRvJ8 GJcU4IO56EVXd70rqdmIRvrzGE3cFHTpOIbzxc/RcYU8KV4d 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153306_816417_F63D1D7A X-CRM114-Status: GOOD ( 14.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/rockchip/rga/rga.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c index 61b25fcf826e..67dcf22e5ba3 100644 --- a/drivers/media/platform/rockchip/rga/rga.c +++ b/drivers/media/platform/rockchip/rga/rga.c @@ -930,7 +930,7 @@ static int rga_probe(struct platform_device *pdev) return ret; } -static int rga_remove(struct platform_device *pdev) +static void rga_remove(struct platform_device *pdev) { struct rockchip_rga *rga = platform_get_drvdata(pdev); @@ -947,8 +947,6 @@ static int rga_remove(struct platform_device *pdev) v4l2_device_unregister(&rga->v4l2_dev); pm_runtime_disable(rga->dev); - - return 0; } static int __maybe_unused rga_runtime_suspend(struct device *dev) @@ -986,7 +984,7 @@ MODULE_DEVICE_TABLE(of, rockchip_rga_match); static struct platform_driver rga_pdrv = { .probe = rga_probe, - .remove = rga_remove, + .remove_new = rga_remove, .driver = { .name = RGA_NAME, .pm = &rga_pm, From patchwork Sun Mar 26 14:31:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188295 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB930C74A5B for ; Sun, 26 Mar 2023 14:36:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yrJwfi4iOTzu73cTwJ/x4QZLyS2oAg5hs67mQTbKgyI=; b=swSVUhNuNAy0ZE 9PabcM2vPs4VVpzvpq0N6QX8mgOVweaLmjyyGx7S2W3NfT+32y7IshqqgYw9iu7FGiDjbBbu9gUCX wixr+DUZMNRkIXKI6IZNI48BJQZ6hVYDB1IPPKUxrIMAGfTf8EYPQsm7dj9G1B4dfIeOt5YhMBykg S75mbjlZQ4uxpjUf5NpYDic3MPtiptrww8C/3hp0QwjZkrwcImtckPeoImTJMjRaFUZrFUpzIaPxK 87bjk/dO6feCVVCW9kN78b0ppuacKfqq6pZgkYyJ0GUMVYQJoSCL9AIzIkPL7YLg7ZVlq1/bSScxn 2iuw6zxLyuCyyYw6PUhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRSo-008ag1-35; Sun, 26 Mar 2023 14:35:18 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQp-008Z5s-2P for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=epLJ6s4rNtn9ShVGxNQk2Gys4sZ4N5vBVVoYJaVmc2c=; b=nKKt4PY6UXs9gSDxegxdy/QYHr gwOmE45vSWDGwpgap2i2f1RprlditqVmXPm0dCrEk1ZWnApL3NWwnhoU+8z13fy8qgyYZljdS/Qm8 RLD57Kd7GRHPDRxN0No4TzZ1pt6vPbb8u2Rruw0+voTdJ7JV2yeZNmHpUzWQx1OPejWJFdH0U44cX wXRC4gpND88OMpBuZbLhJfJEFjzabAfIP7+mpb3LGMun9W3pgKNsRaUGvXMqVu3JKUx7nm2M9cKRM 9/moPP/7uas3FVMEUYmkKpBqMFQtIVObpW1WdygnKArpYiNJKb8MtvBdEG+opiNg+D4+G6zZhJw0a xrSxM5OA==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQh-006aZs-DI for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:14 +0000 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-0008RZ-RV; 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-006rdH-KI; 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-0088Xc-DI; Sun, 26 Mar 2023 16:32:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dafna Hirschfeld , Mauro Carvalho Chehab , Heiko Stuebner Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 060/117] media: rkisp1-dev: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:27 +0200 Message-Id: <20230326143224.572654-63-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=1786; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Las+mkTmyDmRr0fHmoy+1HXOXOBTIkYgBinmFYNv/w4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbOhKe5iFEeZtaIE2yURCxYMuGQRmTh1Y9LN B+ToOKPFUSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWzgAKCRCPgPtYfRL+ TsngCACG7ACjJvUnzOuiMw/JoBsfe+H9JvMXYxc513dmVUlhNII4PUM+agoqvv2x87UqHjY8yZA k9X5H/WjbP839F1NxO3pT7eE3oDsbrpkBcN0uzvnarW+NM15qArGWUIe7jmx+zwEEUIAbDDodbu SAUaJscUYoxdPnU4D2w7w1FU7o47/V1jAvvQcBmz41tI5xa4YqBDvCVJWm2DfwKPkpulaEWaIfI ov521B2oGEwUPJcw5ehFyLz3SthvMmaCfyoduz7+4oUrRB+bPoh2r8MTcdKipJUlT7AnB1VcdRk Y8vuYZWcbEMStbNbNUWT7MaZF6a3ohYbwtIV/f8CHKe21Hy5 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153307_486385_0BC6D171 X-CRM114-Status: GOOD ( 13.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/rockchip/rkisp1/rkisp1-dev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c index f2475c6235ea..4762cb32353d 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c @@ -622,7 +622,7 @@ static int rkisp1_probe(struct platform_device *pdev) return ret; } -static int rkisp1_remove(struct platform_device *pdev) +static void rkisp1_remove(struct platform_device *pdev) { struct rkisp1_device *rkisp1 = platform_get_drvdata(pdev); @@ -638,8 +638,6 @@ static int rkisp1_remove(struct platform_device *pdev) v4l2_device_unregister(&rkisp1->v4l2_dev); pm_runtime_disable(&pdev->dev); - - return 0; } static struct platform_driver rkisp1_drv = { @@ -649,7 +647,7 @@ static struct platform_driver rkisp1_drv = { .pm = &rkisp1_pm_ops, }, .probe = rkisp1_probe, - .remove = rkisp1_remove, + .remove_new = rkisp1_remove, }; module_platform_driver(rkisp1_drv); 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: 13188288 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3643C6FD1C for ; Sun, 26 Mar 2023 14:34:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=w2BeQY8QTUC9MeJR4hed+JWNZ2etLkeoCQOJSeNlWdk=; b=LgTyiC2GAP2fQH c/+ujANxJm+UiYw98FQ8QgsEUJCdXw+gNuUem1ydXJesoqi/RC/BeJ9fb367npdk92j7J1+YTFp/i Zl1DYPUWzFUTUXdWLQCgIKnoaYKADj4DXOs17D4u+x82XwdpjcN+462ot1rDxBtF80d6EiBqtb/sn EOSyJ4sEZCG2hhi54Yn7aprBR42uKnmcbL0Q6uclQqlL+F5ySrFx7VI2sh2noy9bKHyywTVtFHTjY CeymfyQeLBNFMh36Hle1RmLnb5ZiPWushsIFTl0YafZMZtSuMOEKPq+uNDggXrof6MRplx5STo03Q cbhNHj+ozMAJMyaZvrBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRRY-008ZdY-0e; Sun, 26 Mar 2023 14:34:00 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQe-008Ysl-1B for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=jMXo1qIUB2mRJ1d4w1Z1bYLdeYAD2eomcYIG13nHNtc=; b=wZSWAEFLdLwjNq4T9lW6YzT2pN 8dOFHH4u4hYp1aTtx1+xmKfNHvGGKDKUKt1r9O3R8c2pVH1IdAJysTCsD1nmprM93Tq2XzUHxRp/W mKXKOgIphhQcYosCKwXyuJ8TPkEi3CY1SfXfZ/QU6T4u64J6n/j5zalpeGosae9n0dq5DivhdM2/C u1lf4SfHug6QQ0kW22CxvjSphersOuUqzx+gBsb7M0ACOjj86QDRnJowcVCboP6sRziX/UFu5Or1i ZLRzcp2LF7gDIUwnrrijPmcpu8l9ErzLFqA0Bbj3w6NvFa6j4mjmG1qQT6aEVChsuU4yfJJ0ynnQv N8egRU3Q==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQT-006aSe-5i for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:03 +0000 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153253_382278_1ADE4362 X-CRM114-Status: GOOD ( 14.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: 13188279 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1CDE4C761AF for ; Sun, 26 Mar 2023 14:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LiCdiuYQRRaZvYjsQ7NnV/rD9JEKiTOaDazRHB3rf9A=; b=0IIWQ/wjr7ZEDj RP0PXSWUpJsAxFXk0c7QSNZiAYF36poqRFu7a8SfLcywKrZ2m5nvGXd/+KtaihuY3q3Z/9whfTftg BGb4RGQtK+XHTH+DgTrPEGUD0zaXcc49HahhsPb21F44BtxxW7NXdmh1qVs7JfrTlAKDwPyaSJ3UF W8GZCopCXsqhKITpfNn1BIPxt/RLxsPkJo5kE1DU9us3ni17L1dJ+yid6XG5ZSBjv+s4bOwipyAaN i7Ot4Yu6QBuwxOrD4+IFpAn57XIkNw+OLwsbMyZt0xFqj/KWx3On4fP/dLvVGRtzZKUI+32Ax47hV oIYUOLge24maJJmKGeJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQu-008Z9v-25; Sun, 26 Mar 2023 14:33:20 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQY-008YlH-2e for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:32:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=/bh7pktQyiVNbIhTlXeH5HsT+k1bYwqI0idAD99LRiU=; b=qghiDEV3CdoL2AMBpA7eJWtQe4 hhAsvSAuAIoO85H+IzJjy9GyfKNoseHyq+JoXoJKqIspkulpx3vAOapnCBy/Wpv1B2ErgjQvaVvs7 ZQKiaod3wg3E9x6o5DcqRQbs/CbfA2SbuRtmax4d0FbK3k93eMtQLTFZLsHU5VFGrBTWfyTx2dW63 fAfF/m2xZWwbMgcKQlwTNeZjVf7qDiiySUrc1mw5gTtLAYn3mBi3LMXl33OhmYdrFF+RvaTPvE9qW 46TeDXwhxV11PxpVXClL+tB4zj92fv6g6a36eb/Dr7opSNz4Kv2dIXKOM92P1faEX6evuWAvzToxD NgxjZ3Kg==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQS-006aQm-1F for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:57 +0000 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153252_145666_1BD53564 X-CRM114-Status: GOOD ( 14.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: 13188283 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F4B9C761AF for ; Sun, 26 Mar 2023 14:34:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=d8oo0urAGZr2lM43Ey2tWmDSywVZ3BvaMc4fTyY66Ro=; b=LkdrmgDoER0MSM Kpgun6TWQyCtXX/x5aP/fGV7PFrMJOer8JJNsJE25eoDPMzUNgrZmsIOZGDdhV2Bbd1x+0pPj9QC5 ltz7nqfO+ffBjz7PDsaIKps1sTHYg8cUcI7L38H+NtfraHtv03z8meOefUTG9fmXArDoNHgdWMIkh cA9IGnrkGxnavgSxpdmd6C5sU+frBLpicq8TwZPnoTG0/NJKaN07MfhqUX/+k8GMAHCe7u2fUqGgU 8yz8PkOfMTnJK2SOVSn7ZmDKHlD26WHlNh2bsbv4vncR0eImhk2SaVOUuCNNoSjLfOrsEdKpQKe7d soTW7YY8QmvZ7QYrW7Mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQy-008ZCT-2m; Sun, 26 Mar 2023 14:33:24 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQa-008YnK-0x for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=zMu+UAAQYtSirUZ44VrOzm2Ot66Oi+jdpssXN1oKPQY=; b=JhuOCD4c66uqcHHC+xbhCmSJC5 cQwoQG7afPFQ8st/61kmaVJa3MpopjFr8qTqxlqTqFuht3vOIK+EVN7E6ESf4+uM5TJ9Nkdm8aC58 SWmLxXA2qHm1lEvYc3R2ghz8VIleluDhkzvzeNrBOxjwP0iNFMS+bj5OBWUaSTuCdXvBxudGtNbvT /6xV54mIUyVQEFT/t1chqzHm5jLgI3dhZoBFbbDHwrm66kgyT/egAbuCYany74LxO0xESJqmsUyuX Lw5yEpXBzSR/rOLl/Nr1zkQyNRoNebImvG0iY355WITLM1Dexb3vG84ldu9Vmls1EzydSsohQ473J 5Ty4E/TA==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQS-006aSG-Qk for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:59 +0000 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153252_899050_6A799551 X-CRM114-Status: GOOD ( 13.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: 13188277 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 75761C77B6C for ; Sun, 26 Mar 2023 14:34:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=B+c9D2rT5+dBqX1TzCvG2VNIpWsLxc8vs5mxrCcCcxw=; b=fV1qVq6nvMPjOM o5fAsUey67qVIve75rXyq3MFUbUvLM/9qtdVswziTGjbfj9t/UnSjIMsFQIDxsJ0RQYJrMn7t+61e 9X8E6Uoxgbi/yf7RwNpTZ/ziT9QWs9gwce9xXs/dAJb4xaunmF2k1sFv/14r7/jdzazqNDHHqQ/+p MyZJw6E7w+/HbO0S01D34MZ/6cZpEHXn4AKwGmWH19fQ4BpdhonqSpZFBTvP6lsIF/FjFZEoE4XZY nwP1xTM0zU+0ZBSrfeYdZ/ZXbd+d2OAy61jfnGJ5QBvwZMLUG+j0eo46Avk0CMehd5iVehO35josO T3BFdTx06V2LJtc3TywQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQp-008Z6M-2S; Sun, 26 Mar 2023 14:33:15 +0000 Received: from metis.ext.pengutronix.de ([85.220.165.71]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQQ-008YcL-35 for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:55 +0000 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_073250_993062_D2DAD91D X-CRM114-Status: GOOD ( 17.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: 13188284 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B7E7DC77B61 for ; Sun, 26 Mar 2023 14:34:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uUzSnaUH/oRTGCnpTO9SWpFwxgkBIL2z3sqDYXv/K0M=; b=G+jphYF7kgKXTM M4Vx8fQOE2mo83vFwJzlCu18nnPwLbRln8wnLQiBaIk4D7kW/jzHPwXJQotKobHpBX4cae3s0I0uj UnxKM+BnxC4+sLy+bfh6blyn7vrhSMtF+ODynj4tXFhrN13+0S4c1nO2CkHv+Bs350mAun+4CO9VQ DyOhVEI3/8bpZ5JS47yMujZS0CCGKGtKnYZbH4N/w1A5pN+Px8ilaBaUcG9DVRDu8LMtW3hd1OF8z eenOxu5hFyipOJ/rlZoV9joJ7IdqF7JC+bG1lmoJVEO2zWntFR+sJ2PUsTgUptx/MFtuhLARPQJnZ 0l5FoodXUXA1JNSeo6/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRR1-008ZF4-2B; Sun, 26 Mar 2023 14:33:27 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQb-008Yp8-1f for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=8qdLdz4aOD8w6XQVQ7jpAsV7JqNLb1QcacvDbG9J9F0=; b=AKQqxf1XG09M3Gz98xRneshyhJ 4Lb4AQ+6t/KMjql7uNGKFkt5steEown44XxpbzVlCtYxRxQGgbONkmw6V4x8qo71WvtMUhzwTjPjO JjEM5S4Mr0cvX8fuaetUlCyNuUB9+Ip90jqt0hmOoFjJrvBPeOpSYFthuovRnT9xCnMiWo6moNngA WGEEvZ/fIovDHrtfs74oaCUwthJnzKzLh6K2SIP+wap9VStNvio6de+YU1QFS//Qmxu8TmtkYianc Xc9DizR1/4SyRKKr0WJSddGlunBhtWCnS+ky/KKDXnu86dMMv34pDbF9hDWQ7FP0iMuiboYaYz1gl DlSjthLA==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQS-006aRa-Dn for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:00 +0000 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153252_498751_0D9FF53C X-CRM114-Status: GOOD ( 14.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: 13188287 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1AE03C77B6C for ; Sun, 26 Mar 2023 14:34:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2/8okGaf4FJQU6v/9cyur1/P7cBlmtTezZbDJfBrws8=; b=tYATVybecUV3Ao 6/tnd3oCoRrJYfcXdIg81klAVRvJZKn4jaIClceEqlViQLGU4vIi/drij9X/MhMBr6QiHyfhdn590 OyH9btCjYXKuNTo3PlLKmbRseh2pMI03sDrxaugdXLH6j5J4lh/gPTsw5cEONn5HYG5MCZgLMhcvN wRn7k35OOADZbnXTXBE9v0uVXEdxezVWjHZdbpiaqa2umODe07TJw3LPGG1XJavOtu0cI7K5uPegn II/2auCa0Shfp/lmkWeGbub+o6C/l7IstBTxAdSQmMg39yMMWSHiaRw195PfgoESUGvMt4773vpir XYF0BKpQkHL0zPX/jqCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRRQ-008ZWf-06; Sun, 26 Mar 2023 14:33:52 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQd-008YsF-2w for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=tfg70ocgeCMx+EpznWvP4w2UYhwb22Kq6CEh+ZPNRAs=; b=gUOph3hOFrlBsJtgttLZm8THRm hAnGiVwPcQFPNy7yae1J8JWU0PwSkjpamNfnlJkXOb6rsc4gU5l9vsT1OSTbxC+cekszxLR2qPIYz v3CV0F4B+ujzyK3iV00G7/leuV7P3n+h9yyQoH4CCoPqV2U9bHE/QzenBI9f5XqAim3ZZWa+3Q4Pe 7/sp1ToxiR7WZWtd9GC9R7CCuE1fOwdjFSDlSbBmE0dpVKGlCSJb1qKnQ/92m+3LAYkGt/lZPLxUx r/DmqxN9OuIOtEJjiPueFyHRz7HaJVO5qdtvBlsQaHYIXW0QD+4dh6O7p1AMdi0i1YZ/Or0ubctY9 MKT7MlEw==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQT-006aQt-92 for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:02 +0000 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153253_437276_E059A0FC X-CRM114-Status: GOOD ( 14.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: 13188301 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5E5B2C74A5B for ; Sun, 26 Mar 2023 14:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PmqSd3ZWHDol2WbMdUpJP7iYmmoZ/AMSnO6EVffL4ak=; b=EatMabAnwYxzBX 5IMF1uWPsd+dkIAz0m1lOkN6Tfp5H4iMJsfMDp4qK1IBuCuWrIuGLCC94KQyA9/5kgfG+3Rtlp15y sIBpERFZi9f4kv3sXm99LILBU4NZBQbPoy1pfBxZ/lFuQWkKu1XiMtuKd7xShRPVWrl7Asg0PeAsU tnL+c4NTe4PGoXSTqqnzqC3YnXDggupvzMUAP3vzlDvHydDmkMMC6fTRMuIBchHiBOgwfl7AST4f5 VIKb4a7N0sTr9Oa3nCTBMzXtBR0MZDBRnuP7QrcswUCv/UjNJOivfW+dqqBLnvlchmJVvSKHVFIMu KKHc81/MfAm9VamiNrcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRUC-008bn4-2s; Sun, 26 Mar 2023 14:36:45 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQi-008YwT-0A for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=xoFBcqzD4kaywNINWLPhElLx60Ib31CdC2VF/L07+DI=; b=QsKt7gjdlhKsQXMmI5dEsaMh27 n8eLfsLh6RMUS4qDoNBKOfK5TGakuJloi5RcDtEtTzqHP7xAJcBxs4aPOFOzoRdvBGq0fCDstuW8L Z+pRx76WF984PH9PSRO63BFUVnZs+VfdELRD3S+aH/i8KT7ed8X5Hj7QKpBZvgf0N0PT1LxTD5YOv hIVLSsIsXj/VXNtZ5dRuacaFfV/C5HNJQbs9DEUtFlfNqDzIyfymqJltwXOTAamthu/thEE5wlCDd q3+j3sXyG3Nbj+SbX2SpZKK9T6dpNemV7h+PD9Slhd040J8vA4W5JbBJiUT0/WktnAKSc0+zlsc7u KJ78p98g==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQZ-006aSG-Ec for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:06 +0000 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153259_518031_D9B25267 X-CRM114-Status: GOOD ( 14.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188282 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40A1DC77B6F for ; Sun, 26 Mar 2023 14:34:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BK1h11+3RYYVnJGl/6/n2NwTkH05yXLioXfzmy0/QR4=; b=cnqHAqnNb+vDEj Pnzvk/SiitCKL1FH0BMYCPflHwLPf/PUbSJ+OIb/H1hYYvgoLYMHhqvwA9pwXrVhZ4irVSiD8ESU2 UHbRKSvonbK/4FMPIvkNpPG6xed1xAjNd/33awDlDem7Z//WAQO+MmgZf5m5GETuqfXNWEgh+l/4e fecRHVNuXpaM6qvKF/qhVGEoTPGt+GlEYVK1176nS63+QObSvu7AOToQFOnVHIpgTB48r1lLC0Ogv 53Jcw1ivXDoWA6EWrItBilIYvGhqkFFraooGLUsex6i1emCNhzfoCdUfKK9PRd5DyOY9YBkCQCw9j KM3+odSGfwkCqnEI/VYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQr-008Z7O-0P; Sun, 26 Mar 2023 14:33:17 +0000 Received: from metis.ext.pengutronix.de ([85.220.165.71]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQR-008YcW-03 for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:56 +0000 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-0008UY-Vx; Sun, 26 Mar 2023 16:32:44 +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-006re6-7G; 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-0088YD-EA; Sun, 26 Mar 2023 16:32:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: =?utf-8?q?=C5=81ukasz_Stelmach?= , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 069/117] media: g2d: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:36 +0200 Message-Id: <20230326143224.572654-72-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=1755; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Pjp63zOLNnq1816vUxN+0dBZPM6OKh7jFCklpMDKqZ8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbYdqkJMOcgGfQZHo+nlYPWSslTdvXzowB/t nJw1uCHufWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW2AAKCRCPgPtYfRL+ TksrB/9Xte0wAuJ3tjgEtEX3iOLqW8H8HjxhncIH8pbg5HQSFRHWIleTjvJemiKOYkBY5AQAq7e NnAYM9zzsJmbuJjiRuoERyTN2QATMRgCSc0N7oLJGQD8MlXXx/Pei4+/aALhvR1vKs+3DGQ0Gni Z/kMESK3jS0jNnZ4xc6lfE8FH8c5sVLb4T3MZIMlFa/D5xStPWIwkOeV2jpzWY/h50GWgUk6/rn PJaOqeOX9PWK1CgeT0kLF8jTxG5lbmqGFaWbVCBRHz+75MBWQPpWaAA9bfztTAd1xljExhIe+B2 3lG36JHISKCFuawLXmxj74gZfOPc23h49iaS+QrO/DTQzduZ 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_073251_054560_5B641590 X-CRM114-Status: GOOD ( 17.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: Łukasz Stelmach --- drivers/media/platform/samsung/s5p-g2d/g2d.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-g2d/g2d.c b/drivers/media/platform/samsung/s5p-g2d/g2d.c index dd8864779a7c..89aeba47ed07 100644 --- a/drivers/media/platform/samsung/s5p-g2d/g2d.c +++ b/drivers/media/platform/samsung/s5p-g2d/g2d.c @@ -740,7 +740,7 @@ static int g2d_probe(struct platform_device *pdev) return ret; } -static int g2d_remove(struct platform_device *pdev) +static void g2d_remove(struct platform_device *pdev) { struct g2d_dev *dev = platform_get_drvdata(pdev); @@ -753,7 +753,6 @@ static int g2d_remove(struct platform_device *pdev) clk_put(dev->gate); clk_unprepare(dev->clk); clk_put(dev->clk); - return 0; } static struct g2d_variant g2d_drvdata_v3x = { @@ -778,7 +777,7 @@ MODULE_DEVICE_TABLE(of, exynos_g2d_match); static struct platform_driver g2d_pdrv = { .probe = g2d_probe, - .remove = g2d_remove, + .remove_new = g2d_remove, .driver = { .name = G2D_NAME, .of_match_table = exynos_g2d_match, From patchwork Sun Mar 26 14:31:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188281 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50608C74A5B for ; Sun, 26 Mar 2023 14:34:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ss85JT5XCidU+g9PUJLJiPOZZslErFBE3D5fZue6g5I=; b=Vct0lEqn9vgeVr nuW9ukhqQ5VdYvQPYv4kiHuGj4yQ70xRVIeTI6l8ELgiGAecnVlPK1ehfmf1oPwKa8LPZpEHEPh2G XuNvc2Wh+rxv1Lwbhb66spqcoEOKfp0aIQ/5sIcAtbXGTeSvEwW6jUychiI2L548puZ/dAcUYuAu6 1qp6tnBi5m+UH3BuJA+BsiVT5LY9t5l2VTaA7pHFa4HwkoY5aStjaIyf4XUHcWd7yFPpnd2E6sa7i tr+Y9hygetMD/tdjdIKdMPC6T8of74BgRdxmy/HiOhE1suUAjz2IWIEs5tfj53768isl11uhg5J2Y QX9KGqfhOVh2/sPYMsVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQw-008ZAz-0L; Sun, 26 Mar 2023 14:33:22 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQZ-008Ymb-2D for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:32:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=OfXASD93wjuSiaS5hRFJfahFwGWofpoDjAGyVoFzKxU=; b=Mvduikmgq4QCyCVklpmp89Q57N Z1nDGcELI7u/b9e9EaD0iwsVO45GQljPgw0V+o6d48kgiNIUNVdLEXRy22xoS3JiwfFANJrMIn5Re NlELe99OvstP+vP3exwyows43qYAi8ZYW4j1DUsAaqkelkpNRSisGiSONuZn2pZcKTfIrKXfYgyPG B4dO9G9sfQ3FNUr19xDfDSrO5zentdhfKRyAwo69mjA0+KGeHaYvKb8GSV1O1rz8D4z/3rM/+tc08 Owyq6+LTNGu70fbobkuoYC/QN2AOKH4WolYGPpwW+NPh3qUpqKERhT4ccXCknpuo0aaTXsRz7UiNb Tj7f0BWQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQS-006aQq-MU for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:32:58 +0000 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-0008UZ-Ty; 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-006re5-7Z; 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-0088YK-KM; Sun, 26 Mar 2023 16:32:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrzej Pietrasiewicz , Jacek Anaszewski , Sylwester Nawrocki , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 070/117] media: jpeg-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:37 +0200 Message-Id: <20230326143224.572654-73-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=1887; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=K8YXHA6An9VeSpuL+P9agQFsMTbpUA1rmCBKufhs3os=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbZwa0OM/K6Y6TcUKe458TpAeLUaR5YJ3rY+ ZtgIJ3sA4yJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW2QAKCRCPgPtYfRL+ TqpfB/9rz1jd28FVNI1BdLMJ0DvqA2ksfzFrqunRzHssPt4Drrc94dtHxZDRaP9kTelWcHwISxu l3FHXpxRLeCVjEih7FL+YdVIDOr222YzAlJ2IOCN/gKLPP13wxBihB2VEJCMeRQI+016CjEDxLn HrbP7Wx0k5ih3jW7qDr7xHu6tF7dcn0yQ8/Mt5zzFzSYCgad9cBciAGH/yzgpIcs8zB1bbFO1Qe tB5xm/iBXHKpZ2IvdEMSQDhNAGKpnYAFX1/ZLwxzGO9j/FWke77e9pEqawo4Bej2khaKwcUNa2k iZj8kXHNdjeztVvM8n3Bx9AIBSBGIPuTiiqY2O7DoKYCWNn8 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153252_758379_6A54E04A X-CRM114-Status: GOOD ( 14.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Andrzej Pietrasiewicz --- drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c index 55814041b8d8..c3c7e48f1b6e 100644 --- a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c @@ -2991,7 +2991,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev) return ret; } -static int s5p_jpeg_remove(struct platform_device *pdev) +static void s5p_jpeg_remove(struct platform_device *pdev) { struct s5p_jpeg *jpeg = platform_get_drvdata(pdev); int i; @@ -3008,8 +3008,6 @@ static int s5p_jpeg_remove(struct platform_device *pdev) for (i = jpeg->variant->num_clocks - 1; i >= 0; i--) clk_disable_unprepare(jpeg->clocks[i]); } - - return 0; } #ifdef CONFIG_PM @@ -3164,7 +3162,7 @@ static void *jpeg_get_drv_data(struct device *dev) static struct platform_driver s5p_jpeg_driver = { .probe = s5p_jpeg_probe, - .remove = s5p_jpeg_remove, + .remove_new = s5p_jpeg_remove, .driver = { .of_match_table = of_match_ptr(samsung_jpeg_match), .name = S5P_JPEG_M2M_NAME, From patchwork Sun Mar 26 14:31:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188302 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D31E9C6FD1C for ; Sun, 26 Mar 2023 14:38:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LgbosrVqiaIhTn6Sk4n67XF2gfc92p2QIOFsja4R9dA=; b=tnrcNYjcy1f6Nh fkZOnjzJkkLQtY5xx5rRB9kYFErqazsqNo5usJ9iX/VuG/s6W3drZ/uDNG/khe4PxMyNPRpM6Eka1 SXCvuv/ZyEnaYpu2aesdGLk6C942kxDjD3qO5bNqppLvOVphWuG8qUzqvw47yg1dA6OQtOvx8Bluq aAdny0YxsLVkGSnK7cCpaQH7KPuLC/Sch3AlA88affZuZnRA6X5q3yN6zLwxNZRltrF2DZejHge2v +ss1q7VQpJXaQ4tSkhVVJGiTORgG7b9lkC6M0WPJEq8VGQSiiCGVZyDnhlzzfW7JYpb0IReU6U7Eg t2KbYU4lmgZrOqhxJtxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRUW-008bzD-2A; Sun, 26 Mar 2023 14:37:04 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQi-008Yx6-2P for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=SHB6zx48l+CJmgdwr/Wfcp2fEhCRCL92Ge9RPhRlpTs=; b=h1XVrJYXuG5AnwAyo9DctWbbRB fhfscCwycyr3kie3H9hejFatZRFf7XgNmrYP5MfVGF9UsQ62Wy3Ig07CJoTMC3sN6B1jbUfUkLSZJ ozeznLOtDv22ch4fwSS0if6sbYuwAjQIUPFO5DWREZ9Uqu992ne6Ag+cIfHpeS67eNGQNcFukL1GW C87ZMvb8jmitauIi7EqsleFxBpabQFQ2pFnkeNIeZp+jTaiCvN9agwwi3+1UK6AJpM8bLrD6W0TAg 0AZEMo27QRmsslT8Wp5qQOz3cWKBsYJamJOIs+nle1jQyePmjcyC8ssIqYV4uYgBK3JiulZDdO9t/ pH23lZzg==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQb-006aRH-7g for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:07 +0000 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 1pgRQM-0008Vn-2h; Sun, 26 Mar 2023 16:32:46 +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 1pgRQI-006reH-0h; Sun, 26 Mar 2023 16:32:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQG-0088YP-Tu; Sun, 26 Mar 2023 16:32:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 071/117] media: s5p_mfc: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:38 +0200 Message-Id: <20230326143224.572654-74-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=1818; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=POKZFpij1G0A5FGdAey8RIk/pX8gSv8910ObNKDVQZI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbbRUsksmB82lUWVdPtKzggqQbQ8MLkyWDW9 htTyQx9q3CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW2wAKCRCPgPtYfRL+ Tre8B/939ec9m4A8vt1/3afsJDBbytHUmyex/kph9TTBE38+OGfiQqS5sX1Y5BCsdbUU/SqWFDb /APHGPPENxRt/4gG1Y3jF8b2P9OxQ5+5N1JQW+l4L6jnNJGHCsUDdc4j6puVD0YUKitTQnB/XdB KNAoFbawf8O5cXLpuFULS3vab9ft8Dd4l/Tb+K0MGzcjIErKSVQWwk4RBsHDVk7DD8VOTuugV1C fFLbk0xlw8xRkbEZsM3377FjCocdzvfSztGfRReA6u1qek44WWjIcD/10uHr7Kck9jWgO0Xy7kK Epgo1j+wDi8jCtQPVHubvNRzpic9qeVNCedUrAt1wEo55x9N 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153301_362088_95A5E8E2 X-CRM114-Status: GOOD ( 14.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: Andrzej Hajda --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c index 9d2cce124a34..e30e54935d79 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c @@ -1431,7 +1431,7 @@ static int s5p_mfc_probe(struct platform_device *pdev) } /* Remove the driver */ -static int s5p_mfc_remove(struct platform_device *pdev) +static void s5p_mfc_remove(struct platform_device *pdev) { struct s5p_mfc_dev *dev = platform_get_drvdata(pdev); struct s5p_mfc_ctx *ctx; @@ -1463,7 +1463,6 @@ static int s5p_mfc_remove(struct platform_device *pdev) s5p_mfc_unconfigure_dma_memory(dev); s5p_mfc_final_pm(dev); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1690,7 +1689,7 @@ MODULE_DEVICE_TABLE(of, exynos_mfc_match); static struct platform_driver s5p_mfc_driver = { .probe = s5p_mfc_probe, - .remove = s5p_mfc_remove, + .remove_new = s5p_mfc_remove, .driver = { .name = S5P_MFC_NAME, .pm = &s5p_mfc_pm_ops, From patchwork Sun Mar 26 14:31:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188326 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9707FC74A5B for ; Sun, 26 Mar 2023 15:47:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GPfGLRv7INMNurC8jPRV373pasfZ9rKSAoxyXL+mgz4=; b=ES+Wlrcw1zpdNN hPynNEZZVGmBMb1SNKfMSeXPeIMn6bjN0ZkmtKSLa0U19Sm9CAZHECylKs2l0N7AZ4/G2RCqBSQ52 UAvV8Z0ZqTgQSCqB/yvFlaLuYLXdMB8TD3bQ/7sav/l1we36hrqMzmnVAq+B632lOxvNiBwwYmIre 34atmBiJlI0Xb1Kzg2GOSCAIfQyOKMuv1jtir6148QQrXnvqKFMdVrFHhNjDYvwJzmmk8yRBB/tCq PWp9rZ3zIUQtKkFeSVB1e2YlQ2iEWwIwpQptcyLSgL+Silc9FtfSrYoryfZLANbhn2Hy42j6yOZlh qGJbSqrXOkXoAwa5e34Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSa2-008kIT-04; Sun, 26 Mar 2023 15:46:50 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgSa1-008kHl-0k for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 15:46:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=Pb96Iis+8vdnMGH06Q6B9z2Zlx9OK4ssqsLPpRb1vvw=; b=Le/A5Xc73nyqKfl1MbjWwo4ERb 7WlQXIAU4sQIiw5zo0ugXzpetS5B2fY1cFsAZHQg1cyjPvVojlMMFHECGTtaR6RHg96/Xf3U3vCDq V0dxRq328XAv+FHkxDbLl15IOUwaSe1c46JkqY2Pb3stDmCNTQACRNQ834rI7V0EkQc77APuOMLpc 1MoohxOZF+h8hg2dgqNlRZk/GR5v8pBqmHH/Rkl7o8Wq61p/JUF1a7c6kWITMo0nIdqWELfMiLe9r s25NfPVox3DAj0l0K4NW4MrV8bog9S+erRkXW5JqDxk2Sa1mSNVFVMmnCE6aoItTRc3VMTHyFfunJ WISItzYw==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQT-005qmF-2c for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:08 +0000 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 1pgRQK-0008Vl-Pu; Sun, 26 Mar 2023 16:32:44 +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-006reG-Va; 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 1pgRQH-0088YX-BA; Sun, 26 Mar 2023 16:32:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Patrice Chotard , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 073/117] media: c8sectpfe-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:40 +0200 Message-Id: <20230326143224.572654-76-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=1859; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=H7nHpQzjHc2P2nAVdyZEagsXwm5a4h2lLK7N8YxEAqc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbdZqhYr563DtnBDGjjmqMp9STd11DCyou+A wu8xS6K0diJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW3QAKCRCPgPtYfRL+ TtW/B/9fn10iHM3G+gmvdye0gnp0ukGjhLibCuxvyfyb2mXfQF1SbaTSlavvXW3aHbarTg10tmC U7zxHPVbTly+FCsXSqnZJTe7Pe2lau/u09Ui+F4KexHCRgcE+gyB7kjaECESPowYvotfBVXkbCT cd6WR6b2Kepz94SSmDV0YaqDGM8uVu3QqaoRjftaYEtaSGRdlOL0GoPJGK5ORrx6Im6GVesSL5r LpBQ+eNXODjXo3JK4EJXfF/m0xtxIUNkmFZcr5jGyR5cjNYBcJn8vzu7W0/EnTw52yJQGhy+b0P e0hENoar1l6XV2D7KDtWyx9qz/xjw4Q8JLzG07JYExK5ja5J 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153253_978850_1287F1D4 X-CRM114-Status: GOOD ( 15.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/st/sti/c8sectpfe/c8sectpfe-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c index c38b62d4f1ae..45ade7210d26 100644 --- a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c @@ -878,7 +878,7 @@ static int c8sectpfe_probe(struct platform_device *pdev) return ret; } -static int c8sectpfe_remove(struct platform_device *pdev) +static void c8sectpfe_remove(struct platform_device *pdev) { struct c8sectpfei *fei = platform_get_drvdata(pdev); struct channel_info *channel; @@ -910,8 +910,6 @@ static int c8sectpfe_remove(struct platform_device *pdev) writel(0, fei->io + SYS_OTHER_CLKEN); clk_disable_unprepare(fei->c8sectpfeclk); - - return 0; } @@ -1178,7 +1176,7 @@ static struct platform_driver c8sectpfe_driver = { .of_match_table = of_match_ptr(c8sectpfe_match), }, .probe = c8sectpfe_probe, - .remove = c8sectpfe_remove, + .remove_new = c8sectpfe_remove, }; module_platform_driver(c8sectpfe_driver); From patchwork Sun Mar 26 14:31:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188293 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2328DC74A5B for ; Sun, 26 Mar 2023 14:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1IgAQtzXwBb+G/ZB6Wuv2c/F5loyECfv+PmlWTFH8E4=; b=GUcI0liZyTDe9Y 19pdxqOUbYpd26hUDKdBFyvzem3/z3IUH8K6vo+clXXXBBbpoorqu1GzWwk9OFUt8mlmW41Ixvy9h GxyigSF8Wl5OasHZoCt6GdXeKfGEqH0fmoKc/tMja9nf3fOpyrr0LY16l/xmwwoeH/ByGwJ5EuviT D46lsaFqCmLwFLSEABd2Z397TKQCh/aUOUVIrvMa3up5eIrlsCre7V558ujKKR+Y9Yw9K8rhQDAK/ 6i3DtmzBdc3/9LIeAX5aAyztavN4ukTXfpG3fXqJ6E7z3JSW318qwY0SUo0ig5xHbs2rR/ituzy32 z927C7+LJmfT/Zv0sQSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRSb-008aVD-0w; Sun, 26 Mar 2023 14:35:05 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQo-008Z4l-23 for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=BgXV1+YfYhR4EZOPKk9jGVogZ08A/46ppLY/zRXjLH4=; b=kyzNSEHNy+jib33aUL0WQeNbFh XLHoxeLvvLnEBSCJ/RwmDoISXfZMOtiTfYPG0/0I1kSy1exDl178pNbVRq8DUhUXlt02EjeaRboK6 H1WqnPc7XC7JT33gdplvwHLUZ994y13QhZny817em+hEIkhniz9H7gWjlgkaPm6Zq+PnnWZ/BVMD/ uM9D9PfDEUrZj5P+RnmM1e2bS/hitfYrUHpJB19yu7ql7MMlYILrilLBzOqFkzlHBuQSCNQHxJnwf kfRrG8pp7r8CQulsxV0e+od9w4p9xGff3XA00Jf4YcHJqZSrtPGBrz7V6gjogJEL0/UiVDR/fra/B 5caAjVcQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQj-006aQt-Kk for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:12 +0000 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 1pgRQL-00006X-KL; Sun, 26 Mar 2023 16:32:45 +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 1pgRQI-006reW-RP; Sun, 26 Mar 2023 16:32:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQI-0088Yh-0m; Sun, 26 Mar 2023 16:32:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= Cc: linux-media@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 076/117] media: dma2d: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:43 +0200 Message-Id: <20230326143224.572654-79-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=1826; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Hf03W6FCnuJBdvXuTFOZXNHudlzADbBrZKtBOEpjYlM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbhWjaNCRTr78svok4/G/qcUfXFkbJZeABAx T+Yc7umm8eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW4QAKCRCPgPtYfRL+ TnPRB/9CMzAkMtzX9t2MUc+yuKmxmHlomkr7f1IZZ919Gdvmp3sWBbFKhor+nE/SbadRaj46216 mFmKZG0eYEnHfvWK/Pvqbj/E5urzyoFTywinaXnKS9jDLFlyz6zSvYosKqQEQNZNzkENDc/MWgp IlT3G5+SvbtX0gNJJ1/fqpZ3lbJWdTHbJ6sk0LIo5o08FNPoQtM8A4UL/aAm81R5Jkl15iyxDeR C0KQE1Dox+swebOdqRUvBar9uRN1Ir4smQEDZhz3fK3xjom0HLGFOF3MWyhGtn2gAKtpKmuc7Za mVzNVmXqG5ZifvWHKntrUJivwDcj7NUQfGk7fF/gVClnMl94 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153309_747648_7032F5FB X-CRM114-Status: GOOD ( 14.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/st/stm32/dma2d/dma2d.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/st/stm32/dma2d/dma2d.c b/drivers/media/platform/st/stm32/dma2d/dma2d.c index 9706aa41b5d2..be56d2b5fae9 100644 --- a/drivers/media/platform/st/stm32/dma2d/dma2d.c +++ b/drivers/media/platform/st/stm32/dma2d/dma2d.c @@ -696,7 +696,7 @@ static int dma2d_probe(struct platform_device *pdev) return ret; } -static int dma2d_remove(struct platform_device *pdev) +static void dma2d_remove(struct platform_device *pdev) { struct dma2d_dev *dev = platform_get_drvdata(pdev); @@ -707,8 +707,6 @@ static int dma2d_remove(struct platform_device *pdev) vb2_dma_contig_clear_max_seg_size(&pdev->dev); clk_unprepare(dev->gate); clk_put(dev->gate); - - return 0; } static const struct of_device_id stm32_dma2d_match[] = { @@ -722,7 +720,7 @@ MODULE_DEVICE_TABLE(of, stm32_dma2d_match); static struct platform_driver dma2d_pdrv = { .probe = dma2d_probe, - .remove = dma2d_remove, + .remove_new = dma2d_remove, .driver = { .name = DMA2D_NAME, .of_match_table = stm32_dma2d_match, From patchwork Sun Mar 26 14:31:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188285 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C236C761AF for ; Sun, 26 Mar 2023 14:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zlKacYgxYfqoYsJ5vvwls0dt8uukzGg2uvs4Jpz9Svg=; b=MbQv1pxbxnU8S7 V2CgNjDrkoER7bHOZSmoirvjFguUF4xG1UT6+cJ9Q/OM2bb/XJ+XclaOemYlP6nkhFKAvkZVzSQo3 vtHalr/G3PbduJK3616V9dpKaj1TwiHdlpD4Zj92+nPo+BEjXELkeNSWwBRen2RWJLnsGGfGR9+JX LU4Ug1UqsWhD0xNkdimjSQMxUtZiMQ/7D8rWkgij5yq+Hv6Vbr2hRYrHjPRWfqLggNjZuZtv4Aqpe BmXTJ8hkxrdMs68tUGeY4NMcyG177eSf/sm9zMbOjiBAGXFW2N05EfTTwq8yW20aKiZHqjKMKFXma CjpkKIaAk0EoKQ45gZEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRR5-008ZHI-1F; Sun, 26 Mar 2023 14:33:31 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQb-008Yp5-2W for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=xLPuEidCNhtY+e3Bc1Ds0dnG0Y9tKnAVCopAbnQQqC8=; b=jUgTctHolEZCCC4FPZOQFeD3w2 qfHrNU9qYAPn//EHmY5KBNFks+h+AD1d2/t1HmKEWLH/F1AT+JEFaPUdI0yyoTzqjCg73wBWnak2k zKOhaV67rdD0a523pRdgfux7cWWZEPAocEmEAITvBe6gyC3zIyUnnQvLYlZmXp81ef1w73GOZaBYa /73RRQ7fLBEhUhdB9+FuknFBhF8GlhKvR8nr0ummc74Tj2+17C1qQjSTFETROsr3lxehznaj25XC8 F4lrEn3gVtaY4sKv3KBmACSboI/+TzFPtL6yzY295J/l4pwOgVLOdGA2Sm82Sgoa9FRxDjycvB6Wq Ptnn451w==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQT-006aSV-24 for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:01 +0000 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 1pgRQM-00009Z-E1; Sun, 26 Mar 2023 16:32:46 +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 1pgRQJ-006reu-PA; Sun, 26 Mar 2023 16:32:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQI-0088Ym-6c; Sun, 26 Mar 2023 16:32:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hugues Fruchet , Mauro Carvalho Chehab , Maxime Coquelin , Alexandre Torgue Cc: linux-media@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 077/117] media: stm32-dcmi: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:44 +0200 Message-Id: <20230326143224.572654-80-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=1835; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=B2SRle1FWU+fvxidEF4AfCr7grTjB5IhYpAYWME58PA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbiFY6P9Bvm19sbb/DGuYDfSjfu1+Ed9eyPQ WPUc31/iY6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW4gAKCRCPgPtYfRL+ TjkxCACrV8VIV049iFgO6pMn+hRVUFDMXLM3LetM9Pj/dkFcpbkVxQEAQL9OoaOmsPGvmn10CDC wGZZQztBifG9viCCYtWK1XTxW/QyJtQjpLRvgDKp01FavBHb/UDr87lg0B6Zv3A3zPaL11u6qM3 9/bT/c24KsFnReeA1pjZoM0T5qKgz4bj7OpcdwGSh9ufyJMFAfSdI2EENirkPmBFygkkKArLosK L//ssYDIOZ8/VwseyOOHDWqz/06vxq1b4g36psxoPws0NVYGq3YEsZV0hT3pS6NtlL+5rv7Ue3c Nha+Ayh7kEVquPYhJvwVz5wRGSz+2b1AdNti45x2nQMoL+vh 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153253_139566_BFDB1659 X-CRM114-Status: GOOD ( 14.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/st/stm32/stm32-dcmi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c index ad8e9742e1ae..dc3ce08259d5 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmi.c +++ b/drivers/media/platform/st/stm32/stm32-dcmi.c @@ -2134,7 +2134,7 @@ static int dcmi_probe(struct platform_device *pdev) return ret; } -static int dcmi_remove(struct platform_device *pdev) +static void dcmi_remove(struct platform_device *pdev) { struct stm32_dcmi *dcmi = platform_get_drvdata(pdev); @@ -2147,8 +2147,6 @@ static int dcmi_remove(struct platform_device *pdev) media_device_cleanup(&dcmi->mdev); dma_release_channel(dcmi->dma_chan); - - return 0; } static __maybe_unused int dcmi_runtime_suspend(struct device *dev) @@ -2202,7 +2200,7 @@ static const struct dev_pm_ops dcmi_pm_ops = { static struct platform_driver stm32_dcmi_driver = { .probe = dcmi_probe, - .remove = dcmi_remove, + .remove_new = dcmi_remove, .driver = { .name = DRV_NAME, .of_match_table = of_match_ptr(stm32_dcmi_of_match), From patchwork Sun Mar 26 14:31:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188296 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94E60C6FD1C for ; Sun, 26 Mar 2023 14:36:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DkL7XnC35z4if5HKApdVcb9T3uTNGzSd7wq8LrBH/Cc=; b=nkURinEpgE5AFJ OSubsrUKseqhjZ702oarMeRcfP+6x8wbuSf1ymXiEaLF8LUG8siZPyuesnDMLoTxBiC7KzVShu6C2 aRRay830AzCc2xrD9tA6Ys/2iPJOMiSpbA6YqveIi9lFbVzl1Tnq8pdpWap1xeCKB1qhwy1dMdQau 0MpcZnIx5XdOOF9YbSp7AY2QCLIOSrNdGTLbzB0ryWS8Hq00kWxaXEVy6nMAUyzF2dCNLSDS7KxyX OtVXp20nAnYdwD9EDiOcG/fWbYANUXbzW333rWW9PnGPW1lq9kQWRmAFxiVopZkE/iN1hBCRqhF4G iFZsirBL693vDCGn5G1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRSu-008aim-0m; Sun, 26 Mar 2023 14:35:24 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQq-008Z6e-1l for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=tvqwR8Gxag1VwG2mWtR9U3KZjKMQdlmp/xW4da9WY64=; b=IQ/COF83HJ1mDmO+HxxwGRrLCN xCyhmBi8QxD5F+u2v14MigDz86CfPraQI2Fxc+mIrd9hED1g2FjGN3zuoOlVvyvOMQoP79IE2YzBy CE6mYeeAjs8W+kY6fZ/xZDCUu1BsJRk9iBzDFZwokcQLdFa/ul8cK4tupO7zX1dzjRZwo6aDh6H1p JF23v44yT5freqyd5qyX+Ywafk6mHIphDGSNmNWXRQ31kBqZSn+HHrrAgxA0u5ACwJIFDsZhzJs2m XaErru6OZeV+FiEtORdUet+PdfeKDnRATjE/esFciPS0vAgKsRgv/fdJekV/yLuRHvPvfKiECISae 218hjT4Q==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQm-006aSe-8h for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:15 +0000 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 1pgRQN-00009B-9o; Sun, 26 Mar 2023 16:32:47 +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 1pgRQJ-006ren-Ki; Sun, 26 Mar 2023 16:32:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQI-0088Yp-Dz; Sun, 26 Mar 2023 16:32:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Maxime Ripard , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 078/117] media: sun4i_csi: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:45 +0200 Message-Id: <20230326143224.572654-81-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=1908; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=92f+/LQb/H6f1ORxRx6eRZYglN/JIjU1cdoQA/Fu7uU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbjj4OPXL2XVpzi/Nj0dmAgJvKqDyZkMFnTr hw1BsChwWiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW4wAKCRCPgPtYfRL+ Tk/uB/95Csm+2fLfFB/qcZ7rs82AZiz/VIPmV4wv7JtBRl7913WpkszO6OjoTe12jmTt9DuUl9M Me9tqYJqwqLprsXxZstU4wdf8765sPnMUQMNugx5QXcmh0rJTAKqzWhlJANpr8vRQjwYMnNlMwA dFJoSN+v7RwJxkinGUDtXKUpc6u+fVY4wIv430fKQJH7Z7lctNC/hirIN13EEO3jfViZwHDqKpL UOr0Wd1TaGqY0TcWSqLK9+lRwAAyGBcFXkKaCnAPgdlq3KIqB6Tg9OI5Mp3+rnQk3nJ32Yn5G2P ykbYtKeAdZrkAGrnm/rT/AOC/i/Z4o3rAw5Hi4iuTu+4vNAQ 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153312_338315_F374EB5D X-CRM114-Status: GOOD ( 14.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec --- drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c index 86c5235a0c7a..d6e7d1b36083 100644 --- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c +++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c @@ -260,7 +260,7 @@ static int sun4i_csi_probe(struct platform_device *pdev) return ret; } -static int sun4i_csi_remove(struct platform_device *pdev) +static void sun4i_csi_remove(struct platform_device *pdev) { struct sun4i_csi *csi = platform_get_drvdata(pdev); @@ -271,8 +271,6 @@ static int sun4i_csi_remove(struct platform_device *pdev) media_device_unregister(&csi->mdev); sun4i_csi_dma_unregister(csi); media_device_cleanup(&csi->mdev); - - return 0; } static const struct sun4i_csi_traits sun4i_a10_csi1_traits = { @@ -330,7 +328,7 @@ static const struct dev_pm_ops sun4i_csi_pm_ops = { static struct platform_driver sun4i_csi_driver = { .probe = sun4i_csi_probe, - .remove = sun4i_csi_remove, + .remove_new = sun4i_csi_remove, .driver = { .name = "sun4i-csi", .of_match_table = sun4i_csi_of_match, From patchwork Sun Mar 26 14:31:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188297 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9DF69C74A5B for ; Sun, 26 Mar 2023 14:36:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LHwHknJxViQ5Zf9HE8wuGwz+SKJ4CWVCEWYtKNkKYw8=; b=EAJ7lxvZkdMat3 otu6fbZjp+Chwu6+qf22EuAbtxzoJy6th+IHDJK0apkd3IcucdhKrHOs9dtHeN5pM3c4Ox7EIxQm0 gdCK4jXhUV4VUaOh0FIsEcXZ3OjLMGV3lcS9avXpPjgyNsWHxpk+xeuca1REXYojJrb8e5TF9a1MX Hb5ZodKhuY4q0EtMefmStD03vshQSnrhNhNtxWT9xFmM9zQDGimrS1KnkjqJ73P4IS9Fqyb1PSR5+ yCOX55JXyaRF7KNuck1QGtqfa1xPP72RqxrF4sF2w2aWf1dFt2AdWC8wQkEqhTOtemut5w24xGMrK lFksKXcDxZlDbaCyJcMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRT5-008asO-2m; Sun, 26 Mar 2023 14:35:35 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQr-008Z73-0I for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=1zF6X3YxMYhYrc9WThk3RckD3NZxbuYouaBWkz/ofwc=; b=mnEZuYz5rq/51wL2y2kLSYCYu7 +i1LdcVpUxfxGcvcFBKWnBbE4jjXVcSBg1AWwG4Mq9GBHRSeQdznF6pdaeynYZx9w+s7c3zWjxQ4p mN+mHj9g1t9HHM7VK2TX0tHfZFRpsnICk8iFq4JKTpQGm3YclQeAFm4LxHs4NFs7pnhU8EMsop7mI 4gP0FAkActGAOXOJDH9kwRO3pRIXWTUiR9xThWyjabt2SeihoBoT2Yyujj62X6wka1GTmEBKtXyVD 9/Ty1rulRl3tSTpP0kkdj8klG1dU3vYoDqL1y98nChTaGkazHZ26PcRz7tUfGbs24mfLz6G0w0Aui T5N23Neg==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQn-006aQt-TT for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:15 +0000 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 1pgRQP-0000BQ-Le; Sun, 26 Mar 2023 16:32:49 +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 1pgRQK-006rfF-EA; Sun, 26 Mar 2023 16:32:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQI-0088Ys-LW; Sun, 26 Mar 2023 16:32:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Yong Deng , Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 079/117] media: sun6i_csi: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:46 +0200 Message-Id: <20230326143224.572654-82-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=1917; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=m26ezAxR2j/uofLPwLu9oTyNCHcyZJXVezn3mhl4bTE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbkbHga1UdZY6Plazsm9trXoSYX5XbkTjkjc VlFytw3HraJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW5AAKCRCPgPtYfRL+ TvU4B/49HiWoVfnNhS8IavAhrMM2H/LRanOpQ5U8vux671LG1pdZU5We5MHRDCXcB7C41yorhSh U8hw4/3mGMcvFj5WDfqkhlNB4Jo3Y/Fr7Jq7jN02myyyJUGbvmknkN9Kki+o0lnod5WJDR+cDl3 Rl4d6SGJEOnYK+Z7gTBIu7vABpVN1Kvkp0T6fXvhC8AvDf1fK8eYYq8MZkXmX9McbMAGOS//6I4 FPWhZ84GmXR5nTFYHK5kOpIDtN1Unaz/hh72zWXhMZInkTjWEXMjQAjCrcuXb670ZS3euMluJrL hw4lpcAfj4Uih0w8E45MQ+InvpOyWRVJ5EUQXBN3GJnmyS0E 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153313_969102_B3F0E5AE X-CRM114-Status: GOOD ( 14.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec --- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c index e3e6650181c8..e2723cfa4515 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c @@ -375,7 +375,7 @@ static int sun6i_csi_probe(struct platform_device *platform_dev) return ret; } -static int sun6i_csi_remove(struct platform_device *pdev) +static void sun6i_csi_remove(struct platform_device *pdev) { struct sun6i_csi_device *csi_dev = platform_get_drvdata(pdev); @@ -386,8 +386,6 @@ static int sun6i_csi_remove(struct platform_device *pdev) sun6i_csi_v4l2_cleanup(csi_dev); sun6i_csi_resources_cleanup(csi_dev); - - return 0; } static const struct sun6i_csi_variant sun6i_a31_csi_variant = { @@ -426,7 +424,7 @@ MODULE_DEVICE_TABLE(of, sun6i_csi_of_match); static struct platform_driver sun6i_csi_platform_driver = { .probe = sun6i_csi_probe, - .remove = sun6i_csi_remove, + .remove_new = sun6i_csi_remove, .driver = { .name = SUN6I_CSI_NAME, .of_match_table = of_match_ptr(sun6i_csi_of_match), From patchwork Sun Mar 26 14:31:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188298 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4907CC6FD1C for ; Sun, 26 Mar 2023 14:36:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KZmK50UUOrJhwCyyq5BGIxsSCI+1/4oY0Ko+r9PTb3o=; b=sr6FpJUb5ymO8B WKfEuHO8Uondx4573GHSqlspyTJ4o5dJiAVdt+Q3TTTI14WDkMgz4p0ua2XEqlGP+ONxODPdK+/6+ C9+/6a7JX5j7Cot+zPjhzsJQl6Gw+/ioaOPjlvDkV04cFh3yvDvSQqaoK4bBb8zLKtqeBtY6ENiG1 KMHSl+WyQm+WKoAX8NStQoCfkNsIiReSjENblqK/4ZQ8A5UZ+zYtxlVd09S1IKZYjb6iCr1H44JTb O8DHzX+kAZRB24Sc3uiOoKWnN0iWR7rqJlneT0hIq0w7CW33CjInXu+2SOCf9gR475rMC6qbFBon6 IHMZBT1azZOOyOVTQgUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRTH-008b4z-1K; Sun, 26 Mar 2023 14:35:47 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQg-008YuF-0m for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=PWT5qL+pjfbKXwf15QVFHxfpLSknOn1/h8kILmNXwrI=; b=r7rhJOpR+0ErH6zTzbXLNCSzOW /TgiEZmMKYuKk0krsu6nkzbPM12K9Ptqg8C0X3tWUaRlH+i6spW7AXQQBR8k3eLC/fypA2whAzbQu 8hRBNN8hPwN/9EJJ6eD6YwbDxy4qBhyr5YLmtLDXpLqr15rrW4wmF9fV9pCIfX/pp9hiZOWqRRqgp 3bmwTIYlmXAt30vPBD2OQP5WnkKz2mwQ1GLchQqvRzpwwib6/qlC6WQIBK5laY5qk0ql2ROBBo9vo MLatWx22Sp40QAbSzNL2u+dB3yd4kJ8maHstXtNiywlCnI9fhS6LDqz0M8Hzckpro+fJY7zx2Yi2N hVDrLoDg==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQX-006aVK-Bt for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:05 +0000 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 1pgRQN-0000AI-9o; Sun, 26 Mar 2023 16:32:47 +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 1pgRQK-006rf1-02; Sun, 26 Mar 2023 16:32:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQI-0088Yw-Tt; Sun, 26 Mar 2023 16:32:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 080/117] media: sun6i_mipi_csi2: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:47 +0200 Message-Id: <20230326143224.572654-83-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=2004; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=jQPDsQVruAOUtxy6LPdqmQOfAEZivBfr3gDXNDkVj/k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFblvrLuiuS45ZAzXk6hDA5q01ywy1BMMtsGy f8VyU5LzueJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW5QAKCRCPgPtYfRL+ TuxtCACtTiMScCpHJoEnxcJ7bs2eib8WhF39+8QWG7QK02o8P9nG96sJYwrrUAG5eAokqmnKEHQ 5uLfu4JvzADkO2IoIEqYkLKnfzuNP2sDsLWv0RkzhI3ShyGStQzITC9tjhXS3It91CQGcOVWMCS PamUrYmkvrcg3hhGQ1V41QhPIcW6tjSKfLZv0Auna/kF8IOQuxXzwHr+xuGWSLirBgKu1gIgbCH AFk/B5q/Tf0rR5EWCiG1f/5l6hkdbPxD0H3j0+zxafi5DWoBKfbjoG6K8neind5Msq9G5saumz3 efKoHKp1A8VvuM2RzfTHLEz9uWELE7qb7/Qfa6CvBEjsjDfx 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153257_619255_8004A25A X-CRM114-Status: GOOD ( 14.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec --- .../media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c index a220ce849b41..dce130b4c9f6 100644 --- a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c +++ b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c @@ -737,15 +737,13 @@ static int sun6i_mipi_csi2_probe(struct platform_device *platform_dev) return ret; } -static int sun6i_mipi_csi2_remove(struct platform_device *platform_dev) +static void sun6i_mipi_csi2_remove(struct platform_device *platform_dev) { struct sun6i_mipi_csi2_device *csi2_dev = platform_get_drvdata(platform_dev); sun6i_mipi_csi2_bridge_cleanup(csi2_dev); sun6i_mipi_csi2_resources_cleanup(csi2_dev); - - return 0; } static const struct of_device_id sun6i_mipi_csi2_of_match[] = { @@ -756,7 +754,7 @@ MODULE_DEVICE_TABLE(of, sun6i_mipi_csi2_of_match); static struct platform_driver sun6i_mipi_csi2_platform_driver = { .probe = sun6i_mipi_csi2_probe, - .remove = sun6i_mipi_csi2_remove, + .remove_new = sun6i_mipi_csi2_remove, .driver = { .name = SUN6I_MIPI_CSI2_NAME, .of_match_table = of_match_ptr(sun6i_mipi_csi2_of_match), From patchwork Sun Mar 26 14:31:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188306 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65192C6FD1C for ; Sun, 26 Mar 2023 14:39:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bhZo29Ta9privcXpTKuUUcUZlpdIv6o4S8WbEi+4okY=; b=r6Zpv8D+MnZfj7 tBFwZ4RnknroVZiIpLulWCqTi0pC+cy6h8WGmVd23YAquBEtZFQEpnbllq28cskVH0oRtGd423QqR mC4MYGIX2ZsINi7Cnb8YHWS2YW7sxJqkASn5MufkotUnag9iVnm1IcTacDtjqL3X/p1BDyievsW+7 MY2m/OFNCV9s/uTRxWq1aeR5LamcgqeoEP8TmVv3Py++WjblPrSPPMzeuEpF/lYiYY/+8o03vljoO 1f/crs0MozU4TOGPr302v01D4jb+wmdqPwNLbEUCSImnBYxm5oIeaz1VgnGG4ybnqXWeOVr5uTsyF ZBNVeoQCoWvNctuo+rDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRVT-008ciF-2U; Sun, 26 Mar 2023 14:38:03 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQs-008Z8P-2z for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=hS1Rc5B0XS8UlBZADWazgPiAqzg7UtaDntAuyt+N7ZE=; b=f5DCcPN0IdtBMhJlczjJ+ZLCjx DZf856NGTdOG66rsRR6uAWMMJnA6k5BwkuqTYarEthOLrF40a/BJ7c/CWHw9+n8qGU7fLdsDDQcY6 xaVl8x0mMeDYslbVIP+ShybYtep22naQxxlFxxxzAdSHsU7BoBm0pb3XAbgGUT3XAL7FIvXxEx+kj BRgacBMXzKHPn29R8fRe2I0k5837gr/s7ycrCbgto85ySdDHFTxehd13eGrHEdlB3WTiuD/PzSwgY P9TsY5ZPIVvwdjMgx9MKMSAJlIIM7Qy3ehXdBMKcc0wnZTLDyZtsZw0tukPvcQvQMS6UPV7Jk4ljV HGp9d3QA==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQp-006aSe-NE for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:17 +0000 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 1pgRQN-0000Ao-H7; Sun, 26 Mar 2023 16:32:47 +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 1pgRQK-006rf7-6S; Sun, 26 Mar 2023 16:32:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQJ-0088Z0-52; Sun, 26 Mar 2023 16:32:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Hans Verkuil , Paul Kocialkowski , Sakari Ailus , Maxime Ripard , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Christophe JAILLET Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 081/117] media: sun8i_a83t_mipi_csi2: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:48 +0200 Message-Id: <20230326143224.572654-84-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=2114; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=k9x8HzVlyO7nqBiHyTmH/ywca9Pw/7RppQDC+gh421I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbmAbo3t/O7sXR98QYLqTmcRer9F9ZO1B245 G0ILVvnNlWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW5gAKCRCPgPtYfRL+ Tl2jB/9BovhRmpZKHAU3NPpips1+iUG8LVAqyxsVRkanp+lGCOsrmCb9HFCEWuNFNzK+np/o+Tj rTxNTSg3yOLwjohHDTgTq8qhNVOX+j+QP8rB4tAu13wldgnfy5e/rZcZSrzzvj38qLi/low4452 gPfFPO9NIMAOBFHvyBbT+g40ib6zlqwenGkEGSmTQN49i+lqRUPRINUEetLC0+fLbIFuhljIs3t vn7HwQc3uCMRCioSaD4Ee8HPZ47PEkULKjFaBqVRSdvtJwK3Xiya/0LbqSTa0+OTGrNLfL1t+Ic CorzysVmLole6sZsFuAqD3S6I4K4g38P4Bss8SpHB16mmh3N 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153315_825566_C8D2C8D1 X-CRM114-Status: GOOD ( 14.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec --- .../sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c index cd2e92ae2293..23d32e198aaa 100644 --- a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c +++ b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c @@ -804,15 +804,13 @@ static int sun8i_a83t_mipi_csi2_probe(struct platform_device *platform_dev) return ret; } -static int sun8i_a83t_mipi_csi2_remove(struct platform_device *platform_dev) +static void sun8i_a83t_mipi_csi2_remove(struct platform_device *platform_dev) { struct sun8i_a83t_mipi_csi2_device *csi2_dev = platform_get_drvdata(platform_dev); sun8i_a83t_mipi_csi2_bridge_cleanup(csi2_dev); sun8i_a83t_mipi_csi2_resources_cleanup(csi2_dev); - - return 0; } static const struct of_device_id sun8i_a83t_mipi_csi2_of_match[] = { @@ -823,7 +821,7 @@ MODULE_DEVICE_TABLE(of, sun8i_a83t_mipi_csi2_of_match); static struct platform_driver sun8i_a83t_mipi_csi2_platform_driver = { .probe = sun8i_a83t_mipi_csi2_probe, - .remove = sun8i_a83t_mipi_csi2_remove, + .remove_new = sun8i_a83t_mipi_csi2_remove, .driver = { .name = SUN8I_A83T_MIPI_CSI2_NAME, .of_match_table = of_match_ptr(sun8i_a83t_mipi_csi2_of_match), From patchwork Sun Mar 26 14:31:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188329 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 262FDC6FD1C for ; Sun, 26 Mar 2023 15:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Qtsp5iHXAu1yZoZGGBMJUU2GFbgB64MQz9FMH0PL2fo=; b=TuU9/+7IOSnRez ZQ1+OiG7Be1G1fQS7vWqgsqJJSwAF43OqaTOEg4gVf6gfiV548QaL1z8biy9npPh7/Uw24C+jI+Ab zKeFkYDUB2XZebkedVe4PZpt2LJBJfjT9UY4pHWHPTPsVb2jOiXHTDFIh1e8+vrvnLJvNU/G+1cKf NfuxZrwV/c+tXiYsVh5QRa9yZkCwXalBH06kLTGY7xYcUFRw6s98sGqtsdBmVZ2MXYDbSN8FMBPxW eJZpX/gR17o/Vnc084YrZpRJa6BjyPsAQtmWTLCXh28LyrByIMDnOk6R9FYNBjafW1XWpFiMoisn3 Y2OzcVP5kDk1Ueh/g7Gg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSap-008kmy-01; Sun, 26 Mar 2023 15:47:39 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgSao-008kmN-1I for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 15:47:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=pAAB+DybHcf4s9Qrw7rz5C+SijZ1x0IMC6g3MH/g4Hw=; b=H9Medyq0QsH+uM7uj3e36VCw7e cY6kdlQAFD0fBjydnW/uJ2lJG08r+HEVTuAInde7RSJ3VVmX9hbHD/2jroa3/D+hsUGZ6rc/aMCuC 66U9BtmJSvEa8ASFPYFuNItZ+5nU5bnS6PLy9318IYV84WXrtkbedp2FEPTnvHW4amTNwtaewIcd+ ccvg+sGSssckV/BTWy+NTD0rH0KesJDC+yvvkl/v7RG8IAvZFd1stWGVZ2S7zcEFmDaKga6vkY6S+ 58CvDN4zSo45qNUXKpLpyFU7EnuHxHZD8bvmnZAtLq6cmCns8tj07Mx0wBBrNomY241liyBtr3MCS NNmH9Wwg==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQe-005qlj-01 for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:21 +0000 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 1pgRQN-0000BK-9q; Sun, 26 Mar 2023 16:32:47 +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 1pgRQK-006rfB-Bf; Sun, 26 Mar 2023 16:32:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQJ-0088Z3-Bc; Sun, 26 Mar 2023 16:32:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jernej Skrabec , Mauro Carvalho Chehab , Chen-Yu Tsai , Samuel Holland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 082/117] media: sun8i-di: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:49 +0200 Message-Id: <20230326143224.572654-85-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=1908; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=yLXUqUylUuobWYFHwj53KPR92uDluuNNDDMLeKSv0Y8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFborjt211qSXlAPZaLGhpiA3qT74FVsKGNxP vMQ62HSn8CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW6AAKCRCPgPtYfRL+ TqQvCACgKXheyLOpoz/d94swUM3JoIL3HCywHIu572DbA1fXGj/dQWFUV8z15sL35Ds47ZGupMs /gixu48XtktWQTzaGsX0K8xCyhA+8HnJAPXEhBu9GoJVufEgFtmyHS2AIhPVg175ikfyRZoSy/M E2X086PHpAyX6cT74H0V7qyUuWV5xDR226IiZHVAXSDW/Fa8VVCZxiWBeod7VyIz55unrN7BGA3 Es5TGMT5e39o/GyqmXCBb8mBWy2unpMjtb7+pIsJ6OoOIU3AECq7WqFY8hcOgPz6VSN6WGU3gY6 Bs7J91ie4TetABVQkd0PmhfXMKblxVp5A2wDfyilxDDV0pYk 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153308_772712_84AA7667 X-CRM114-Status: GOOD ( 16.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec --- drivers/media/platform/sunxi/sun8i-di/sun8i-di.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c index aa65d70b6270..e4b0fd793f55 100644 --- a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c +++ b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c @@ -906,7 +906,7 @@ static int deinterlace_probe(struct platform_device *pdev) return ret; } -static int deinterlace_remove(struct platform_device *pdev) +static void deinterlace_remove(struct platform_device *pdev) { struct deinterlace_dev *dev = platform_get_drvdata(pdev); @@ -915,8 +915,6 @@ static int deinterlace_remove(struct platform_device *pdev) v4l2_device_unregister(&dev->v4l2_dev); pm_runtime_force_suspend(&pdev->dev); - - return 0; } static int deinterlace_runtime_resume(struct device *device) @@ -1002,7 +1000,7 @@ static const struct dev_pm_ops deinterlace_pm_ops = { static struct platform_driver deinterlace_driver = { .probe = deinterlace_probe, - .remove = deinterlace_remove, + .remove_new = deinterlace_remove, .driver = { .name = DEINTERLACE_NAME, .of_match_table = deinterlace_dt_match, From patchwork Sun Mar 26 14:31:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188303 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 316BAC74A5B for ; Sun, 26 Mar 2023 14:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BwQ+YYn2GzV01ef1nlpiP5gaYTtva5NYsLVYLRNnwEA=; b=bAmdnQOCuukG0J rYhVFOXIDMDWlkazzV/B/F9Qcag91su/koIDeGpLTbvbqHn6XOMxkH3ddR8fsgo410U903kM5F56k pbypwQvMnPTlmLN6XV0xxsai7U8TLMyKBiSLVuSlkhlFpse3aH7KDNcKcDiaf7GZfffymZsAy3QdF ZrI5oaII+uZ4Chyvm07SISZTjXsJAq28Hr4E5YHjgbBpyCo4O+4/DnnN7zASgp939jyUWQzyjbsw4 JwxzqGBTSVpa6RKiGrI9b3gMy5S9pkyvlV/ORTjHpb7X1B3NTO5ymNNWQf7MG05Tcj8e5yINJkzoX I9TGaoMpsQnpzD+5l4GQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRUn-008cEL-0v; Sun, 26 Mar 2023 14:37:21 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQj-008Yym-1Q for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=MBnmipRly6olZcW8akz7wAUtjxlIO1pMQ4gax4UBAWk=; b=P1kpktnd9823vPlqJvYHSH6Klf o7fn0x5Gt8pE5WhBedNCkHiQ0OSO8CaDWeKTPYjR5448+fNuBukZsvklJLOgeWtYTMWu1trrR5FYe S7A/CVxJGlT41ZUZpXaWjuDUn0HyM+3MiSDWfzVvmQd1g0/pCbhSY2M7NZUA3+jB9sZjyUg4l9+7f OIY+vKgJ+WYScbCBwJ9q3hww1rhXw7+8WFNMDZ5BN5Z6aw0u2IjqbELehFFDzRd8WaDwBBX4U8h25 pJS3rob794vF9xpska3Vm26Vms5PWGe4AwhCukTbu7MdMN9pXmVOIT0HrvTjszzKK/G/f28HMSWkm TUoviFZA==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQd-006aSe-KB for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:08 +0000 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 1pgRQN-0000Bh-9o; Sun, 26 Mar 2023 16:32:47 +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 1pgRQK-006rfK-IW; Sun, 26 Mar 2023 16:32:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQJ-0088Z6-IJ; Sun, 26 Mar 2023 16:32:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jernej Skrabec , Mauro Carvalho Chehab , Chen-Yu Tsai , Samuel Holland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 083/117] media: sun8i_rotate: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:50 +0200 Message-Id: <20230326143224.572654-86-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=1881; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cFM9ryR39dC1zqXzbh3VAz+Gt7Z0sPw+2x4RcLkZw4A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbpIEMfPBt276qBqk05jpVddS6BlGOY/30xh p1HPwpPUl6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW6QAKCRCPgPtYfRL+ Tp+2CACiYaJ6BxRtct1ArxiFzOL90Z9VGsHEYsESMYnrw0FFTf+2xaeLeSrYRYyDRwGQspYX0Bb sy3cMaF2oDaoWgTIRLh9zqmIAviwI1OJxTWGUhKDkm2X0gi0ZmfDWRKSHvOKEgYfq3cpkKdEc3B B3l679YgpcBR9H0n47laYezHYFX7KYg6G2jyPxBfwEnsOttdZxTODoQfBtlvKbTdJkzK7JdswzZ KwL0yUD2qmBOIYlC7QbvhY1qHSzfsbd9fSytfvrgjKmN74lZ5xdwsdaLkOVlmaLW0wwqgIUquXu bJytQOZerdUI031rupAzzyJ/AKA/NAkhPmdoDA11cIxMrBrH 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153303_870128_4307A951 X-CRM114-Status: GOOD ( 14.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec --- drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c index fbcca59a0517..bd0c4257bbff 100644 --- a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c +++ b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c @@ -833,7 +833,7 @@ static int rotate_probe(struct platform_device *pdev) return ret; } -static int rotate_remove(struct platform_device *pdev) +static void rotate_remove(struct platform_device *pdev) { struct rotate_dev *dev = platform_get_drvdata(pdev); @@ -842,8 +842,6 @@ static int rotate_remove(struct platform_device *pdev) v4l2_device_unregister(&dev->v4l2_dev); pm_runtime_force_suspend(&pdev->dev); - - return 0; } static int rotate_runtime_resume(struct device *device) @@ -907,7 +905,7 @@ static const struct dev_pm_ops rotate_pm_ops = { static struct platform_driver rotate_driver = { .probe = rotate_probe, - .remove = rotate_remove, + .remove_new = rotate_remove, .driver = { .name = ROTATE_NAME, .of_match_table = rotate_dt_match, From patchwork Sun Mar 26 14:32:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188290 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 358FDC761AF for ; Sun, 26 Mar 2023 14:35:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0KO7CRcL9YYoQhHlR8nVTEDTraXxsEemDymJBUskBeI=; b=KrRRj+5JaRlux+ hqm0euc2WLIH/D0tm/Csz4SSMFBtFuix63Mrr1vntrPyLh7ULRIX6ylvm58zlO84OuqakLPfIPH0T w3LTWRWoMWoEAMNYkKBgxxfEH3hIl9VHwZVVCtX+fsZs/ErIGiCgRoRsSTXE4rSNi4sz+Umo+k+kC +ZPjQhaaCK6tg9lEMOmGKb8KbZFB3mcM1Mr21DxrJBdC1Lo7WX4tFSTfDAfONf6CNm2U0uC/AWf7r mD+4nXwOdJJwbLEE5lliV3WUDd5CMy0BcdoU2SwhPv97DP+koFD3WJGYPTiIJbB/+rOxmbgsrToLj lTWhw6kTg/ZDzJ6Sz5Kg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRSK-008aIZ-0Z; Sun, 26 Mar 2023 14:34:48 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQm-008Z2H-0w for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=r83iX0vykrTRfUGgZX9EfYLHgJoqAk5A3mE0DPdxkOk=; b=PUTdYBgYwvDCEs3FJibzgJTD9t KHO7uKGTnuedy1WyYj+DLYAuRRw6ZRPCQbn+YriGnaHMCELVGBDFjKAeWSJYVtYzBUFXoPDouT+wa 6+mqb0yf4lB3zGSIVeHlKto9LFLy5OPaTdT3dBQ1gJSqUH0MSeBeXunldgM3ba6rk9DOUBgQhqKE5 sxxhsfLQ60ANm51iDTfEVF8KlE75JnPcmaV7S7rKUbvbSGff5vmo+6t1h2a/W+CBYr6MkOSv4SdMg Ed7Ds/cV4wxcYX1bmxdhwk5GHD20DeBap4dtfbEnvPjz873dyiTVLPPg3zK3Yq8GoFxgk2fUx5/c+ yALKKDow==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQh-006aSG-6G for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:10 +0000 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 1pgRQP-0000GD-Iz; Sun, 26 Mar 2023 16:32:49 +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 1pgRQM-006rg7-Qn; Sun, 26 Mar 2023 16:32:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQM-0088Zv-5E; Sun, 26 Mar 2023 16:32:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hyun Kwon , Laurent Pinchart , Mauro Carvalho Chehab , Michal Simek Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 095/117] media: xilinx-csi2rxss: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:02 +0200 Message-Id: <20230326143224.572654-98-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=1953; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=FZR4BFA0Qk42KswnwMjnFUu/VtbyKPil5uHT81HsGo4=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsD+pFaoTc9sYO8RXXfovlvmVO688aFv8lRROFX+Nl Ok1l7I7GY1ZGBi5GGTFFFnsG9dkWlXJRXau/XcZZhArE8gUBi5OAZiIJiP7//hJoZW7y091sW6S jqyxmSJjPLnkEA8vTxcTd2V8xtTkatGvk7lfP7z1vYazt/uneoDolIv7c1ZPEWFIqSiJWJDLcCv E4Jv0ng9xXUbH09NmRZzxbvyRwrNVeZ5p2/bK/uJvHz7JaHoblu5YvlHKlqkw7xhLS/RNsSO2Oy 5N/6H6zflchqZ1xbO/8xY1yNVxqfu81dnzmu1QpHC28cTWk3WSma9EdRs6xS4+ms86n+/va6Pqt 7NmV2id9LYRXWNj4L0l7+7v0x0bMn8/ynSpDW6evPHKxrkrtxzflOc7NTAh0U5EPWiVY+GjWX+V bm9UMbHwjA/NmrtWQa7yzjzW1/LyDnnzqxq9d85JDXgPAA== 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153307_312884_D758E51B X-CRM114-Status: GOOD ( 13.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/xilinx/xilinx-csi2rxss.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-csi2rxss.c b/drivers/media/platform/xilinx/xilinx-csi2rxss.c index d8a23f18cfbc..5b53745fe44e 100644 --- a/drivers/media/platform/xilinx/xilinx-csi2rxss.c +++ b/drivers/media/platform/xilinx/xilinx-csi2rxss.c @@ -1059,7 +1059,7 @@ static int xcsi2rxss_probe(struct platform_device *pdev) return ret; } -static int xcsi2rxss_remove(struct platform_device *pdev) +static void xcsi2rxss_remove(struct platform_device *pdev) { struct xcsi2rxss_state *xcsi2rxss = platform_get_drvdata(pdev); struct v4l2_subdev *subdev = &xcsi2rxss->subdev; @@ -1070,8 +1070,6 @@ static int xcsi2rxss_remove(struct platform_device *pdev) mutex_destroy(&xcsi2rxss->lock); clk_bulk_disable_unprepare(num_clks, xcsi2rxss->clks); clk_bulk_put(num_clks, xcsi2rxss->clks); - - return 0; } static const struct of_device_id xcsi2rxss_of_id_table[] = { @@ -1086,7 +1084,7 @@ static struct platform_driver xcsi2rxss_driver = { .of_match_table = xcsi2rxss_of_id_table, }, .probe = xcsi2rxss_probe, - .remove = xcsi2rxss_remove, + .remove_new = xcsi2rxss_remove, }; module_platform_driver(xcsi2rxss_driver); From patchwork Sun Mar 26 14:32: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: 13188300 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 806D6C74A5B for ; Sun, 26 Mar 2023 14:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5j0dJT0p6p6uosS/iIfarJ3d32sEmaKg+OZaYMg0bbk=; b=NpF0lGYzLCW1RC Lcj4VY8XU6wMJtceFw/hxLlWyzfBS+jNlZasKf8qO2leAP8ZjZr1oLMiYvu6NlB0HR7rc2WYrxR6I 4gmEYqnXoP3HvkBp/6cifOzyNXaJb3W1uhd6HkECrrfdVlTtOLQGIcgWI+eOkR6kgfEx0mkqIgrqM 9K+R7dGVmuLycb1xAVAiDLaG5qBO7Xgj3UFP8uoJmO7E2vEwrqTs6QBqjUPY0Je3CyKSYQr8wpehO by6w/8U7YS4fFdSyInvqCET+kAmbhjvlm3sfsrEYcufMUWF2y6UqtMozCEvWTUjFle20JZHmrzNzI lApJ27/LL4o+ZQsL4p6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRTm-008bRY-1g; Sun, 26 Mar 2023 14:36:18 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQi-008Yx9-2i for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=EbGO3tAldoseB/EGtPHVXlz/l54To1jA0hIWnqTS5SI=; b=atEM7I8QrJ5kah7jbonqWbdhp0 37ypc0Syid01jCRYtFsx7uDbzxx6isIMsTF+wueLqBNAd4KzgekdX4nx85pU5Ht1ZfG6SDFktmR94 D3laiVO7q40aDdRP1elG53kJpqhPaBU0+4OJFEO98nsWQ1Npw3lHw4lg36BhlldyTh2V0aDSWVPJk RDMipSZMebrY+k+dNiti4SZpyMdOtlxnhpNWESnUqm0TFy/QUrtKyhcaqX940W+irYq3s8ijotYTa VbH96iXOpsTIBZ4hkaPP5XxRZicklP3/h34Yd4sI6JqzdJ/FuhC3SB7chiTV7x/CRn5UdJ/zTNAVC FjQ5pVjw==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQc-006aQr-DH for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:07 +0000 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 1pgRQP-0000Gw-Iu; Sun, 26 Mar 2023 16:32:49 +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 1pgRQN-006rgG-4Q; Sun, 26 Mar 2023 16:32:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQM-0088Zy-BM; Sun, 26 Mar 2023 16:32:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hyun Kwon , Laurent Pinchart , Mauro Carvalho Chehab , Michal Simek Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 096/117] media: xilinx-tpg: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:03 +0200 Message-Id: <20230326143224.572654-99-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=xJns6D+KgLvHNTqGGeDmhK7PxGSbwNgfYYo8C86ngV8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFcC6QJJuuLDmbbRbtEb2CCwae6rQuuT2RrzA Q3Runy9C/KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXAgAKCRCPgPtYfRL+ Tnv4B/4saKNNmKzJRbUFbLwE4QCi1fcCdP/2m6MeY6E2opUl6sPvm0VsgoW6XOgVm7hwM2E6Saw 9YGjXFt/Np0FsToWrOYEJvsQtjPwLcWA47/WEV5uGlljrxSi/KP1F8K7yhilqoKL/mNKEuovj4A kKhkL7DZUl19wQjRov4qHwzC3cmYPfCN5wEt79QQz1Sdqwp6oeCrsGbOOSyDCk+crsNmlq8OYDO 4H6vvMNGhqoUvqyuL6YsTWQyK2BkbMTa7vFvBoAFpQszRF03N51RUNsEB0OFdgkR7YS3etXsWAS J8Cx8RqO2kpjELOYp0dsqMb6tiXS4titQVgU4zGkcShc2G+d 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153302_472357_9C43CD87 X-CRM114-Status: GOOD ( 13.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/xilinx/xilinx-tpg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c index 0f2d5a0edf0c..80353ca44402 100644 --- a/drivers/media/platform/xilinx/xilinx-tpg.c +++ b/drivers/media/platform/xilinx/xilinx-tpg.c @@ -894,7 +894,7 @@ static int xtpg_probe(struct platform_device *pdev) return ret; } -static int xtpg_remove(struct platform_device *pdev) +static void xtpg_remove(struct platform_device *pdev) { struct xtpg_device *xtpg = platform_get_drvdata(pdev); struct v4l2_subdev *subdev = &xtpg->xvip.subdev; @@ -904,8 +904,6 @@ static int xtpg_remove(struct platform_device *pdev) media_entity_cleanup(&subdev->entity); xvip_cleanup_resources(&xtpg->xvip); - - return 0; } static SIMPLE_DEV_PM_OPS(xtpg_pm_ops, xtpg_pm_suspend, xtpg_pm_resume); @@ -923,7 +921,7 @@ static struct platform_driver xtpg_driver = { .of_match_table = xtpg_of_id_table, }, .probe = xtpg_probe, - .remove = xtpg_remove, + .remove_new = xtpg_remove, }; module_platform_driver(xtpg_driver); From patchwork Sun Mar 26 14:32: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: 13188304 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 990EDC74A5B for ; Sun, 26 Mar 2023 14:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Tdkp1WVHbhmxD5oD55pN852h4fmfGzMIrsBZBVAMnI8=; b=aS3GWmeLJkYXYq 3lBd6lB6lXlthgGiZR1xoU/FjP7XwcDp2cQQeDj5gWE3WqkN+FEL5BzIk+3ANfc/V1Obt1XJ0pARX VJCj0oFql774EVeo7XcOyGv7myvcTQLopzfoZgs5vzGAuTL2EGk4y7G0c14Neg+WJyiSTt0xCs4Kj 5USHB5ioQxMJnp9Pz/fSHb/BvCfiNARrCsgp+mocOASe47lr7uCuiWFcq/1Nr/pkNkocnMLNmrfu/ ASAby8PnRPjRVCTFX1vqhxr6ZhM5hM6IdUEtZQiD+9dNrtVF+AaEg+AnM3BFw9x9xyDtdkHZtceq3 jehL7rQOysNDiDtYF+gA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRV4-008cON-0h; Sun, 26 Mar 2023 14:37:38 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQl-008Z0y-1E for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=A6k6NMutlhjWp+4gSeFbreNT9lZ2Y8Z2qjYHdyHQ6RM=; b=j1+MmTsQObVQrYn3bGswWnPOrq wZg8UKm8znu1zlVFhFmE4RLcnDm4jDpoilh9AKKODB0zWrhrSKG1Djx1FY7zzO/zoQLkfALNhLN4T 5xWTOreZAFa5mloXFZrtzg4xoi3x9PMhlzvp0tIUe5oAT12Mqy1miaTQ0KsExPfgKtEqQMCSQ9dAS ha42iWm83aobEG6LPUyTTbn1UVhJnH4+VbBXBRQZL5PnjDOkT9mSOc3GdpA7BcHegdOUTZRYrWtNW LRxDuqKmqJjnK58dfjW5m7X7y4202vrSjavQah0FVVN4aZ4mkp+3sQfSHFJ6aK0Ge7aaz8AooVdRD lvWKW00Q==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQg-006aVK-27 for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:10 +0000 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 1pgRQP-0000I5-It; Sun, 26 Mar 2023 16:32:49 +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 1pgRQN-006rgK-Cc; Sun, 26 Mar 2023 16:32:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQM-0088a1-GV; Sun, 26 Mar 2023 16:32:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hyun Kwon , Laurent Pinchart , Mauro Carvalho Chehab , Michal Simek Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 097/117] media: xilinx-vipp: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:04 +0200 Message-Id: <20230326143224.572654-100-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=1776; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6OAWTHlekHyFbI7Rz7ASEg8jvG88Xk0LvzT5bYTgKnU=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFcObaeBvD6Z1HD1tcU3Hr8GO7LCGvxt+veW9xpFBEl a3hlNOdjMYsDIxcDLJiiiz2jWsyrarkIjvX/rsMM4iVCWQKAxenAEzkhwb7b3bHa/qqi4/OVm+5 7LngcFVu9uUfU4QfJwSHsl5lbH7l8Wxm/Z0E/7Lbmh1J9kaGMw70bvdwe28wU9bAbcebIO93OiG /m8xZn3kcDnX4tvOo3v1Vcw9HBi5KFbh4TXXLqVZXXe2Vd7qkPX5N5a5V7/mYOnHT19qL504H26 x4pxAkHfPIrnTWgfkO5ww7PK4qF6TN/t/0uTRya33KOZ6t35TqvC6dlVssDvS2bLfiqYc7bn1aY 7VSrZHzQNwn6Zz9ptFqncfFVd3is99ltjFcv3fRK3xq5tPrS1n86yxn5jBsThFfFuzRs2j6EQGR F3pCSwoL7rb9WPojb/l/++0aJ+Rb9S74Gwcumbnu5D9vAA== 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153306_187599_7C7633E3 X-CRM114-Status: GOOD ( 13.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/xilinx/xilinx-vipp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c index 0a16c218a50a..3123216b3f70 100644 --- a/drivers/media/platform/xilinx/xilinx-vipp.c +++ b/drivers/media/platform/xilinx/xilinx-vipp.c @@ -617,14 +617,12 @@ static int xvip_composite_probe(struct platform_device *pdev) return ret; } -static int xvip_composite_remove(struct platform_device *pdev) +static void xvip_composite_remove(struct platform_device *pdev) { struct xvip_composite_device *xdev = platform_get_drvdata(pdev); xvip_graph_cleanup(xdev); xvip_composite_v4l2_cleanup(xdev); - - return 0; } static const struct of_device_id xvip_composite_of_id_table[] = { @@ -639,7 +637,7 @@ static struct platform_driver xvip_composite_driver = { .of_match_table = xvip_composite_of_id_table, }, .probe = xvip_composite_probe, - .remove = xvip_composite_remove, + .remove_new = xvip_composite_remove, }; module_platform_driver(xvip_composite_driver); From patchwork Sun Mar 26 14:32:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188292 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0EEBC761AF for ; Sun, 26 Mar 2023 14:36:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L9eCdhfMs8bENNWzIKyiv1YfqtsSyO0RcJb8UAAP5FA=; b=eetlxRRDorBUFQ Co7cnzC2Jgh8q47NW8wWNA1d883Lyb3FrWjZkcX8LlXw8kQgAzLGFD68EN/ZzvA9uwI5E4p892NkM lBuNZPVkneMp6qG/CbtRTXKmLziLgeum0ZKnEIw5AcxCvV3xZuO0sLmwu5x7z8N9rMVSTFOh+j+G9 IZo+QS0eGgEh1A0L4ZRL3dpLPhvYD7Y68eft5lOxOr21h/HtPQdHCxBA3l4350bohb0d8LkcBKsLn pWyW1S2aeXDfBiTjP8kZpXpaiO2n4JbvcK1lXPV+WnU49vez4uA7KJ+0ecbom2cHP9SRhS2tnJnyz 2vGH1aWjYz2/Q9N+MCPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRSV-008aR9-1I; Sun, 26 Mar 2023 14:34:59 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQn-008Z3Y-0W for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=9Ozmt+Xvda1b8PTdspsH4if2taiKFQuKD1XtSZT1H9c=; b=uONz00KLs3ySlgDaXZWXgazoZH ZL9xEt+cROBtDGDCQJwSNy5Jv8o+3bmDEfsUafeEWhK42pQO7YaLAaBtoBUlCB+Tz8mhMV7UgDfaw dP42zOx77Ae4NMF3OItobfH0sVEEAdCegMzhq7B8BNqXNiM/cgZ8nMQQyWrN4BghYylPmedg2MzOa WwoAB+E6RqnX0E3V8pqphBLbyh/OdTqckOCBF4XKaNCSvizAAnKRnYDzYCWz8vbCSYrUbVJqkbECT tdMW70Oq/iqW62lVCHqqrS/U93sg3/NqkhRznuYyIw+FPGYfSXbxevSfdct0Og13c2TUNSh8HcK1E M6qBqsdA==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQi-006aSe-Il for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:11 +0000 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 1pgRQP-0000JC-It; Sun, 26 Mar 2023 16:32:49 +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 1pgRQN-006rgS-Jx; Sun, 26 Mar 2023 16:32:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQM-0088a8-Q6; Sun, 26 Mar 2023 16:32:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hyun Kwon , Laurent Pinchart , Mauro Carvalho Chehab , Michal Simek Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 098/117] media: xilinx-vtc: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:05 +0200 Message-Id: <20230326143224.572654-101-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=1668; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=fjr9tIdSc05qYF67imX4hoFI+DzF97z0DWpSMN62+oE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFcEFx/flNwnvLYI9GWtIGv3ypiUAXSmRQPyV ZcEej2frS2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXBAAKCRCPgPtYfRL+ TsYdB/9MMLLYwXMHe4GjBsaII48sj95krtIMwxjGZOT8LmA2PwFQAk3rLk6/97DB0SJe2ONfvY4 6Y6r1Lc+A83Q1R/Y9NbKC9BnzXYrB8ItU+OnCo8iWD9P2AKj2OHGamp3BYZtSv6uXBLoVbiaymO eYpHrTrOTejCfsjHliMNGesmNPl0+xcNez7bCpDJYl4BSjlEykBVpZ5JQSAiSyryphp315oksar vRbkKgPcfGsWKmKt5ftNF0rThPhr1hVfR44EL6aAwReXvc1oCilt8fbsFZJAnERgVBd9ec9EBa6 jLAPGgNmIdn6nynsLI30O/MhyQEFw7lv2F436u+PNkU/tuio 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153308_664788_201FDE3F X-CRM114-Status: GOOD ( 13.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/xilinx/xilinx-vtc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-vtc.c b/drivers/media/platform/xilinx/xilinx-vtc.c index 0ae0208d7529..0d5e35c29488 100644 --- a/drivers/media/platform/xilinx/xilinx-vtc.c +++ b/drivers/media/platform/xilinx/xilinx-vtc.c @@ -344,15 +344,13 @@ static int xvtc_probe(struct platform_device *pdev) return 0; } -static int xvtc_remove(struct platform_device *pdev) +static void xvtc_remove(struct platform_device *pdev) { struct xvtc_device *xvtc = platform_get_drvdata(pdev); xvtc_unregister_device(xvtc); xvip_cleanup_resources(&xvtc->xvip); - - return 0; } static const struct of_device_id xvtc_of_id_table[] = { @@ -367,7 +365,7 @@ static struct platform_driver xvtc_driver = { .of_match_table = xvtc_of_id_table, }, .probe = xvtc_probe, - .remove = xvtc_remove, + .remove_new = xvtc_remove, }; module_platform_driver(xvtc_driver); From patchwork Sun Mar 26 14:32:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188291 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5EF3FC6FD1C for ; Sun, 26 Mar 2023 14:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+rt2rIT/VR5ZdYcVHu9mL/xr07BWfJmpQCJgkfjDUuA=; b=dEJFPqOqxzTmOH gisnKzWJG4ekOsf5gsPizPk5YmTc22mhptpceb96D6ILrUpVmEkf7iLQgI1Ke5sj74PcaaGlgucg3 d38bdbcb4PMRRzaPHorVwI2WLd+t1Z67ghO4D6iLbPb8835XthEEjcHUBh64KsVxkltAU3SFfagHU mmNNXB7oJUMz046IWPZY6tqSBJMX8yyLdJSorraIeyQo9rm+OX5Uy2XlxLWk7ojwPmEuNdTJ6XWt3 eoN9pZl4CteCOoHMcPV4JYDGitmqU1JXuragiQub2mVZqc/hanFGXUIwIGNJOjEKrhcSwRNDgZ2x+ M0SbsYivGeYoWboO3NAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRSP-008aNE-2Z; Sun, 26 Mar 2023 14:34:53 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQm-008Z3J-2K for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=amFjOLmwbw/Tb94B++cLzEnyhl0edo3L1BWO2noav/A=; b=MqY8ZQ1k71LsyNzz6SDy164vuY 2SQMUW0TwWp2UMMUtOWQkR0tlnvwk+4F5VZrl4uC4V16oP101B6scpIQsF54vP6Akgv3gRCH1L2Yy ElsKgWynCmKegsvX994OGL3zlhcPRPtH564b2yIAnvPpzlN8+deR1+39YyE58ZhpG0rwp3E+4uEeo +Kxs4p17JXufz4vMbpGsx84XZIHiOg2yNUAkal6kvzQ+eNFkAjzL53GvUkkv8yV4oMcvGW7/C3Kl/ mSM22SYcNuoOvGucF7Z1OP79TFBuXv4GbtNi6IsVJIr131uxbmShPrvu0xHrYqehPlq1qN6vTgHIS XX1/xvVg==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQh-006aQr-Vl for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:11 +0000 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 1pgRQR-0000RA-8t; Sun, 26 Mar 2023 16:32:51 +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 1pgRQP-006rh7-CS; Sun, 26 Mar 2023 16:32:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQO-0088ae-JD; Sun, 26 Mar 2023 16:32:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Young , Mauro Carvalho Chehab , Neil Armstrong , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 106/117] media: meson-ir-tx: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:13 +0200 Message-Id: <20230326143224.572654-109-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=1674; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=kHPP5cAhCKQcnI3fcuUH21X+adxb7h92mrf8biP7X1I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFc2doI8Irf3L+APeL6fQdlbpWqvKqvbIdtL/ 9AfRTr1y3OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXNgAKCRCPgPtYfRL+ TiQPB/43rKAeYEk5tngWQ1afUwcGeaTDq/Ex5Lt4HVQ67loUPt2JA9ipfAI7uBnjBX/qYBEDItC 6TV00fMu6QEnNHjgyvSfDyiFqfQ6ccXaPLZEl6Z7E6dddPgGZevqg4rZ7iNmX4soGou0pfDaYy6 8A+ipF0AiIthobt2ZuQv3FmYh7Oo5e8f1AzZXUd5wdCfTCgk3VRarWs4LcTx4csFSMxPGOxWYkO wrcMO1sXIe/Z1+udrBVRtvdQqBHYccSxi+RdXAp0HDWuU+FesUaUGHNoXEFWKcbbmIS4Bez7Ll0 cYhPJ/8L6A61O91JsfUuakFBXJwy8/Tl/zJzDgff0M1N2IiZ 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153308_075376_5608C538 X-CRM114-Status: GOOD ( 14.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: Martin Blumenstingl --- drivers/media/rc/meson-ir-tx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/meson-ir-tx.c b/drivers/media/rc/meson-ir-tx.c index abdb62b16e98..6355b79893fb 100644 --- a/drivers/media/rc/meson-ir-tx.c +++ b/drivers/media/rc/meson-ir-tx.c @@ -372,13 +372,11 @@ static int __init meson_irtx_probe(struct platform_device *pdev) return 0; } -static int meson_irtx_remove(struct platform_device *pdev) +static void meson_irtx_remove(struct platform_device *pdev) { struct rc_dev *rc = platform_get_drvdata(pdev); rc_unregister_device(rc); - - return 0; } static const struct of_device_id meson_irtx_dt_match[] = { @@ -390,7 +388,7 @@ static const struct of_device_id meson_irtx_dt_match[] = { MODULE_DEVICE_TABLE(of, meson_irtx_dt_match); static struct platform_driver meson_irtx_pd = { - .remove = meson_irtx_remove, + .remove_new = meson_irtx_remove, .driver = { .name = DRIVER_NAME, .of_match_table = meson_irtx_dt_match, From patchwork Sun Mar 26 14:32: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: 13188324 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B40EC74A5B for ; Sun, 26 Mar 2023 15:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mpUbyk8iw73MeLxxbgz7nGsip19UpE8Uvux7vP2h5yQ=; b=PwyHJbTiKv73G3 tq+94PSLoqVx05gTMc8/HzALOnv3+b/qsu1GlPuEyAaoEsjqPo4sGbb20oshne8yEeu92ZGchlU69 Ef/E5JH3k+7BGOKYCv4GJ/u7h4pyr4dZThCQFofMpvdQU17BnSKQ3fy8sgKcHAIRhVkZpfHlpPEX8 A5B0cYxxMXvDC+YH07iwIEzlTIyQulLKUhQ8yJ/yOwETk5QNSvZdoXXamqwqm+M0hzu2hz9G88yJ3 jyuNDuJyfEGRIf6xTqUObLvkRouk19xqgwQZzq/HOc0hFUyA9WIzvwn1nrHa+1nBXF6HYTr8wu/y4 SL9Rz4MEG1L6y6nxJt4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSZU-008jyZ-30; Sun, 26 Mar 2023 15:46:16 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgSZT-008jxL-0P for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 15:46:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=ITfXThuq/s3pVZqMEcAgIrGwSVyjj5H3X8AD3TfSr1E=; b=HJ3TJtMsfsk7r9bbVU4wGp7pbv cF9Q0J7grBxWHxKA0Gqssj4Sfl7i0vpU/6vf1bnchN7AvXK0A0Un4W1fphQXUkCaCVUunwwC4enps laMTMTJuttY3l0h1kAWHMLHc5zmXjNewSOLfJw4fPgksrHxA0+YHF8arclI9mwtwbtZx8cTffQFLk Xe05B5bBMPUFAE4bNgwvFvZaf355eu+6SctLk2sGecUn9mnHQINRJE+YDFwi+lBnpTeRBxf1H3ILV tNJnO8HQ7SQD+DKm5odQVYtc2pkSF/8skINOLUT9fXuVLccX3hkPXKQHbd0XbkkKU7Wg7PErIKQTU qfgLjPQw==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQh-005qll-0P for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:19 +0000 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 1pgRQS-0000UE-1O; Sun, 26 Mar 2023 16:32:52 +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 1pgRQQ-006rhN-4K; Sun, 26 Mar 2023 16:32:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQO-0088ai-Qv; Sun, 26 Mar 2023 16:32:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Young , Mauro Carvalho Chehab , Neil Armstrong , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 107/117] media: meson-ir: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:14 +0200 Message-Id: <20230326143224.572654-110-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=wYp5LkcV04MNjqVKDISGMwVDxC08wU2j1G438UbXmc8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFc8B6ECdtaukjrMUlW1e4Am7PV23oSJwTSf7 OW/cQKXajuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXPAAKCRCPgPtYfRL+ TjD8B/9ityswRX4rXG8YFgpVAK+DucWXEhqR7mgWOi4xafFoXQHOz1DViHXR2fqT4og3dIxxdu7 PEGwuvFcnFXLKqLrUZJjAvw2FbwFxZoIVGKATTAljND2DFkHNewqzg2oNwoPTy6lsnrMKuH2lr8 yqG5fnuSuZzCOzfGjsDx0QwQjyMb9Fo6f6KXCU0Ubb7agkNLhofwlos+0WEIjKBRSQCX17aDY+j 3fozbtMGts5Cmg2cJD8HzYzWli2I1Qw0oZFjjSXcVGKQ5zIj6FMQ/ig+Ymu31dH2t5rJvNKD3PW Y5Xufu+bEPutpRRx4q9VpqDh4mAP2h/E1t5hTHHNdUHAw7Vn 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153307_603151_E03D55B4 X-CRM114-Status: GOOD ( 15.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: Martin Blumenstingl --- drivers/media/rc/meson-ir.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c index 4b769111f78e..49aa309d1a8c 100644 --- a/drivers/media/rc/meson-ir.c +++ b/drivers/media/rc/meson-ir.c @@ -177,7 +177,7 @@ static int meson_ir_probe(struct platform_device *pdev) return 0; } -static int meson_ir_remove(struct platform_device *pdev) +static void meson_ir_remove(struct platform_device *pdev) { struct meson_ir *ir = platform_get_drvdata(pdev); unsigned long flags; @@ -186,8 +186,6 @@ static int meson_ir_remove(struct platform_device *pdev) spin_lock_irqsave(&ir->lock, flags); meson_ir_set_mask(ir, IR_DEC_REG1, REG1_ENABLE, 0); spin_unlock_irqrestore(&ir->lock, flags); - - return 0; } static void meson_ir_shutdown(struct platform_device *pdev) @@ -226,7 +224,7 @@ MODULE_DEVICE_TABLE(of, meson_ir_match); static struct platform_driver meson_ir_driver = { .probe = meson_ir_probe, - .remove = meson_ir_remove, + .remove_new = meson_ir_remove, .shutdown = meson_ir_shutdown, .driver = { .name = DRIVER_NAME, From patchwork Sun Mar 26 14:32: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: 13188294 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1671AC74A5B for ; Sun, 26 Mar 2023 14:36:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Lqo9P6SmFzSJJv8d2rdCSplNQqBgIXbrTV5LzmX+qtM=; b=e/aWhxEr8abKi3 +rF809M977mg2zIEV1RTgIiPdO8yuP0/Prkds8yzAcWTJPNQFlVE/4nO0lChsmfv9WCgvxIDU2Yb0 FHZdqHeUXFHqOs4ytMkGhBxZff7ZdBE4qURirs7trQAHCduPGerYolSKQ5cEai7Nb6IkeQE9eN3PF 9e6wcNy64ChN3ebfFIyrEdrsP2xOqZyVsFDkqzp2uLVamhyhzD2bH6jl11LwpWkrGMpbvYxXpVU5h DAsVch/slqjDi6yrOCawXMXVygkM5KPGGbMI/wMvfUvyhpI2fzKIwLEKdfXnyLeC79N3m28TbXvgE 9Q19u4OyfNUJsGRAujPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRSk-008ac8-37; Sun, 26 Mar 2023 14:35:15 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQp-008Z5E-0M for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=E4Y7ky7nwwGEwJ6wVYuZLmb6qm5aApYaIgUwtd+ILNg=; b=rm5V9mNF58cmOGpn//eoeqYqKP CfySt1tItIrNxSkKCTyJsRNmeTomMSMLQxv1MgnX+V/45cN2Mz+1ZRKNnGFmlIwm1PNpgxLYVDVZF ECNmhn3uDuXoW1Lyr9bq/e2J/+ztLsZPK0me3F2wNIy4VF9o4KMAJxk8N9WzkoCn81dlz1dJz4+lH cbquCLFfcxiBQALB8nvySPaAS+ixu9d5Jf5fuLNGc7gHeUBx6N1Yxok9ticbFU9FxR7jeSH5wmyOQ MGCS3U8dhrS5gUFUBnAushyzv7wgsYgn+fj7ohAfbevajelBrkF4JrF6yAk/B+EHDaiHwgb/1P44E +YfVnLxg==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQl-006aSG-Al for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:13 +0000 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 1pgRQR-0000Tv-Tk; Sun, 26 Mar 2023 16:32:51 +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 1pgRQQ-006rhK-1n; Sun, 26 Mar 2023 16:32:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQP-0088am-0k; Sun, 26 Mar 2023 16:32:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Wang , Sean Young , Mauro Carvalho Chehab , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 108/117] media: mtk-cir: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:15 +0200 Message-Id: <20230326143224.572654-111-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=1596; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=lU1RdDgCVLlCsb/5z6KnJIo7xN0yoS8qGARlY6xon2g=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFdC1rNVy7Bq53g9nT0u1IGm+3MdTtjUTG0+n Z+iKKpJ7juJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXQgAKCRCPgPtYfRL+ TvzaB/4x1CsgN+jw2vmR6VOIzhF0VtklHVsaM1mCVhFAlsAOc87OR8/ajkgPnGDiBPX9qTQ7VDZ GIQ+53bVnoRnoJLQrt1kOAfU1f3MYcUSCiEiPfsVmSFEdlwHR7D9IbNtbKWgHWUeEBv+tJUJR3e LkNcpwoy61kC17sOZVYetG5wM1PJTcZfKtsrkKj2lKjePHhJ6AKCuWxgtN8/oEwtKyyCbjIjgsb krZp86LJdODjWBHVPe+rZAkKU1JsatDjjWKUAnivIwb526wSAgtbSvV46LAiHco4CSYvwCfuvXK N6+cOXITCHF8gcXkaJOC78YeS7EPMdGddKy8f96zDQOo9ukl 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153311_474692_6C8ACDB4 X-CRM114-Status: GOOD ( 13.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/rc/mtk-cir.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/mtk-cir.c b/drivers/media/rc/mtk-cir.c index 27b7412d02a5..df9349330a93 100644 --- a/drivers/media/rc/mtk-cir.c +++ b/drivers/media/rc/mtk-cir.c @@ -420,7 +420,7 @@ static int mtk_ir_probe(struct platform_device *pdev) return ret; } -static int mtk_ir_remove(struct platform_device *pdev) +static void mtk_ir_remove(struct platform_device *pdev) { struct mtk_ir *ir = platform_get_drvdata(pdev); @@ -434,13 +434,11 @@ static int mtk_ir_remove(struct platform_device *pdev) clk_disable_unprepare(ir->bus); clk_disable_unprepare(ir->clk); - - return 0; } static struct platform_driver mtk_ir_driver = { .probe = mtk_ir_probe, - .remove = mtk_ir_remove, + .remove_new = mtk_ir_remove, .driver = { .name = MTK_IR_DEV, .of_match_table = mtk_ir_match, From patchwork Sun Mar 26 14:32: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: 13188299 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E39C8C74A5B for ; Sun, 26 Mar 2023 14:37:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ksMMOE2utPsupi19YCVmkuhKGsbQaOLfzoNXCCzlQUQ=; b=srohQHvPIlVVne lwj3X9x4iuY4V3MlYEUM663pzqacPV2FVuyQUbDoySUbCBzdPP9mr4NZJ8EeOMMcscTEqadBSKFYg BirfspgecdCv1qrhR4vTZQ7vuRRb3ejAMwPJWjh0S3CbsnKd94BgDRCReyOIXRp9YFMDEdFc0pzK1 69la70Ow0vnbLXsS+yVZ+i5jlMsDrxxGUEhGXyhaAgfcWkgotw3JmbN+II3MyCpo2z/h7JMngnZin 7A4EcZJEJCYSbaSMCWK2lAkivb6+SqpgbZ0Cx3HEA5lzW7oAxw5of4IYKCyoMdTAkL7grgYeDPSSo daXk5aCmgz2FLEXXBClw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRTR-008b8c-14; Sun, 26 Mar 2023 14:35:57 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQh-008YwI-2v for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=wZC90FSX5gB2LlhF5eL+4cYV2tAYEDwo49x6kSX1ZH0=; b=U5qOOUwrwqoRqzF2RvjjJ8NH7U qirC45nqm3ueJvWYuaaLEBuzVXG6P6MEq3BW2H/MRZnf1RPNUCOYh3n5PTFs6RwU3y3u0iv/HER2Z PMxbcikIuVwnMJBrf7zzV+lRCb/d0ZpEWEK2WktezbD2f7ElFq7xaxoqpQDe8EIUyt1CUb886EzPP GWZsuihusnMwMuGaUwMXpTyfUq43W5yUtZEze3PDKcjvNOeILk5DriTMvmyF99ZHEcQCsVZX4UeHD PypRmZkoYW+A6od51o2AWQjdDOQJhK4x0BWZk6pMtPYWwkxZxN+ItSugrrVj9aeMrdvQFoZHw2vaz zeLTs3ng==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQV-006aTz-TU for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:04 +0000 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 1pgRQS-0000Uf-44; Sun, 26 Mar 2023 16:32:52 +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 1pgRQQ-006rhR-7B; Sun, 26 Mar 2023 16:32:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQP-0088aq-7x; Sun, 26 Mar 2023 16:32:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Patrice Chotard , Sean Young , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 109/117] media: st_rc: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:16 +0200 Message-Id: <20230326143224.572654-112-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=1688; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=dilEHo9govXasHtT6jWDl0EFBpcoZnlFPvF1NoaXW08=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFdDqXno4N3eqHrFThAzYL2IsNFr1wOEudN0m 0xs9SPDsUWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXQwAKCRCPgPtYfRL+ TpNeB/0UFMgu71GFrUTtlRgTTOuMjbuLF+RRHNKO76bdSr9qPImRQ0CcLhjSrAmUBGkhRwhPWHC bpQ7RjazFWwPrbO0lUuFyX/bX9Jvl+Yo7vhGfadRsn21uN5gb/+au+OAFIdsqHx9RwxntqT65+j MN50OvFz9FcnG7HRvgNqEu7HRgw9MdUq8vazOzLszUsdzrVlveka3agPPuJ1sgbIigHYHu3QkIi n5g5LwzaRz4tSVfAik4FLjOXH1DWwqhCvPKOocrdIe57d1bUeD3liOLIRJziEEHcq6kdI4F4OUx SeNve2/BRB9NDkNYY8OsuIeXE+hF2EsYSoim6ifcy7RqctDa 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153256_005937_346C8A36 X-CRM114-Status: GOOD ( 13.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/rc/st_rc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c index 19e987a048cc..28477aa95563 100644 --- a/drivers/media/rc/st_rc.c +++ b/drivers/media/rc/st_rc.c @@ -194,7 +194,7 @@ static int st_rc_hardware_init(struct st_rc_device *dev) return 0; } -static int st_rc_remove(struct platform_device *pdev) +static void st_rc_remove(struct platform_device *pdev) { struct st_rc_device *rc_dev = platform_get_drvdata(pdev); @@ -202,7 +202,6 @@ static int st_rc_remove(struct platform_device *pdev) device_init_wakeup(&pdev->dev, false); clk_disable_unprepare(rc_dev->sys_clock); rc_unregister_device(rc_dev->rdev); - return 0; } static int st_rc_open(struct rc_dev *rdev) @@ -408,7 +407,7 @@ static struct platform_driver st_rc_driver = { .pm = &st_rc_pm_ops, }, .probe = st_rc_probe, - .remove = st_rc_remove, + .remove_new = st_rc_remove, }; module_platform_driver(st_rc_driver); From patchwork Sun Mar 26 14:32: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: 13188305 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82A02C6FD1C for ; Sun, 26 Mar 2023 14:38:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z8OU4KO3gy/fkfP6E8g95GtyM8IOVX1J513iiffVGd4=; b=Ultjz8PrkWFrFn J/vbUrsLUoghy1BurSgXYh63CbjHCCvKF1TTQFWWikuxLD6KkDPAPBKVsxDVrzkAF6Qs3zK8qflgk Qg8lrYC4vNgaWYDN6RGowf5lm2kiNV37SgRBWFQ6SLWa0M1LrWEkPd9ugyoNQhXQgLL5aun7uYLL6 SRfjDSJr8b9jxKbRdkpxB4lGYizxnck12tR78Lfw94ZdZ+sys0q5AMeH8nj6JfzRpNB+B95UKM/ue PIc8bx6RXLMZlwmj0TPnJqr47D0fLyB4Wgzlfzo/mhMY8LJaSqqlswsEz5WfHgS1wPrWwdTBK+9ba 6ynMXwa4XS4w0Eqb2eRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRVG-008cYD-2I; Sun, 26 Mar 2023 14:37:50 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQr-008Z7V-2X for linux-arm-kernel@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=BQFPxwXHOfsufM8ElUZmdg8YpawiQwbKV5Hre+FRs94=; b=UajlRI/kWL74uzveGrAhKXjOlI eEhA19kxzxoQcasGRG3BKtw22EszJ/5VGRegn27lycmKoY8IPpJxmsBDz3+yXGo2vIdFah0+tX+e0 VD81p1fNSIRIeVXOb6FT/9MQWm5on9vGHcHDeCm8/hQq2+IEOeQNomjpj21FuGekkNd1zt9aJqRkj QFoU/cIDzaWRQL208ZhaiJmoOZOw8mzLUq9UH7JEe6eaaZgoYnFiOdSINlZhsuUrzFoi+IQmvNlqX vPF5KNBYV8wqRIppVCTofPbiZEv1j6VWTxSiazHeN+4oOGPPpd9JUw6Cs2oUF2TdTkg/6UNq0WA74 nGT8Q5Ww==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pgRQo-006aQr-Qs for linux-arm-kernel@lists.infradead.org; Sun, 26 Mar 2023 14:33:16 +0000 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 1pgRQS-0000Ui-2y; Sun, 26 Mar 2023 16:32:52 +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 1pgRQQ-006rhT-8e; Sun, 26 Mar 2023 16:32:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQP-0088au-Ez; Sun, 26 Mar 2023 16:32:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Young , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 110/117] media: sunxi-cir: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:17 +0200 Message-Id: <20230326143224.572654-113-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=1672; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7hyD2BqMB/NdPUXZusMT/OdZctbrC0UG18HQRt8dIBM=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFcK/2ZXb/E63WR2zw13Cb9OL8wq6rpzdVft4Q7aVU9 /JC1oQdnYzGLAyMXAyyYoos9o1rMq2q5CI71/67DDOIlQlkCgMXpwBMJFWK/Z9VTplo3hWN2Iv/ /VK2PktNdCpJ7Vir5R+6usfm85PqxarnpOdFTtwolJYsJ5UlkXvaxCJO7OE7wfxG1vKd6+qTTpp M2deR/Fc6lP3G/Psry7LTssJVRWr5l22J9uX13VPLeEq6exXH/0qpfSG5darC4iZM3p9b02I69j 2o/jVBwlUpTf3lyjhe18uH1u1eHCLP2LiTOz3/+TyB1H0f7b+vmCqsWXR+q6D9wYInE0OXlaazP 791pH3Roxghl7upG9T2vGiYdM5h1nFnr/9SmzZXb9raJ7vX/+iJaZY6UUYJp4KTxWq4RX9cnLRP Wk76ZJJ7089MzoV7m1blbPvR/PiAfKh6Tur1O8GHA53rAA== 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153314_877276_68F2CC7B X-CRM114-Status: GOOD ( 13.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec --- drivers/media/rc/sunxi-cir.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c index b631a81e58bb..75b7aed1579c 100644 --- a/drivers/media/rc/sunxi-cir.c +++ b/drivers/media/rc/sunxi-cir.c @@ -364,14 +364,12 @@ static int sunxi_ir_probe(struct platform_device *pdev) return ret; } -static int sunxi_ir_remove(struct platform_device *pdev) +static void sunxi_ir_remove(struct platform_device *pdev) { struct sunxi_ir *ir = platform_get_drvdata(pdev); rc_unregister_device(ir->rc); sunxi_ir_hw_exit(&pdev->dev); - - return 0; } static void sunxi_ir_shutdown(struct platform_device *pdev) @@ -413,7 +411,7 @@ MODULE_DEVICE_TABLE(of, sunxi_ir_match); static struct platform_driver sunxi_ir_driver = { .probe = sunxi_ir_probe, - .remove = sunxi_ir_remove, + .remove_new = sunxi_ir_remove, .shutdown = sunxi_ir_shutdown, .driver = { .name = SUNXI_IR_DEV,