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: 13188314 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 E5978C74A5B for ; Sun, 26 Mar 2023 15:46: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=le+nve5a90cmLjlGQahYsjZ6+9KtyXEUc3JKQfie8q8=; b=uFEt9zDbupnuhsp0KywQ+9ZYoC FsJG9RvjiqVzfnH6zvUl8m2TuucN9y644f9uf3f6Aw1pcm+IAOGa1aIs43KBk7cXsQvTp3MLYsmmF 8zMzC15z68Fp2dIEovtFI2TT2yLoDbnKAFympdRhHWGhrPQNAxmbd+U4fdr+NRf75hg61VXsjLXny ufJ0TtvO5tlBR/Y8aj4EyH2Saf7tUfX05cPkaEscWsuOIzFeNOVGgTF7csEPPLJVC7O/DqHKCZ+TI htvspjvQceTgajtXz9awkpoS1GjdVcxEGvyXyo5RMPXq1QIjEokjbIE/blEOdw/2UobFWEILZaDjv 9+vod6MA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSZe-008k3K-0X; Sun, 26 Mar 2023 15:46:26 +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 1pgSZc-008k26-0d for linux-mediatek@bombadil.infradead.org; Sun, 26 Mar 2023 15:46:24 +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=le+nve5a90cmLjlGQahYsjZ6+9KtyXEUc3JKQfie8q8=; b=abYNb2CmSeuJaA0tZBTwqW+eqM G+U1aKpvrtmTFtZxv4p4OcwddM4fB36SPz0qHd5s1W0+6LrDPnDJ0jr9sH/HFXmu7H6XrG5CL/Kxs c6BwyrWIFPGQTtMSQNtwAD9dM0ksf9Ab6s6RwznZdKB85d04AX5a0W9bgXEf1mBAgu/gVMHAAZnXB 1cdvPjfCNnMh9g0McOAoM2fEDYSYD8PUtkC3XvEJZHpV0LQdEt7NECCgl0q3sU1xvNjWAAQ6tbpmo i8C3MVEmrqsUf1hS+t268aVVPtl7oINgBywOmBNT1hXV9gIZJW71PdFROKmi7ex1bjKsE/65YakTY bB8k1Tog==; 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-005qle-17 for linux-mediatek@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 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-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153254_640606_DCA798AC X-CRM114-Status: GOOD ( 15.43 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: 13188315 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 A3097C761AF for ; Sun, 26 Mar 2023 15:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=z8r/rxqHBnmlJi+sdym4UZa+vV2zOg3lOCf4rvkDQmk=; b=RCLFgFkEhgsNoagXZhUkZIc0rS VOU/ayVKh70XZ9rYgRuBxh5OEp5OoNFCLxP3vNY7tCpAKV4VkKZ75n/8buOqPXhILmoCaxoPU59kP Au9wkTLNeCulI3OSX0wzZ8DsNXI1q85AtJzfHD4zbAciagCQP91dB4OFVmT9YObza5hap23K4ZjhI v45UVxkD7Ogyq7YdpHQ4eM0JJCoXHN9ckqzpYSmJ5bh5KMvA6pOou1vOz/zOsabCaEV3vPFPr0top kFEk3716ONnaSUAD0UoNBqgoY35b6lBDKB8uOFedmSA/larp6XtE/AaofDY9VHij/Dsm3O6ftChzR mGr2UJ4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSZg-008k4p-2F; Sun, 26 Mar 2023 15:46:28 +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 1pgSZd-008k2h-23 for linux-mediatek@bombadil.infradead.org; Sun, 26 Mar 2023 15:46:25 +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=z8r/rxqHBnmlJi+sdym4UZa+vV2zOg3lOCf4rvkDQmk=; b=P9vmuprJn7RZaM8Led9vy93pv7 MicqVi8gOu/IMQ+UY7d9x+piVeJ1V3bnwHwoCoSKfTV1J+AxSBOppBPPn5uOvPkpVTHug3WsEZ0QK N1+TDXrxApxzCa2qj26ojoNsVnu2l6UMdxh8Ta4VD+eIr2Gv+hfTLD1TNC3Whgx9HB8uphK609FbH I6ktNmdwicyX89xSEN5avvqYvg6r9B2YsmpbSWc+uiyDkA79Osqlq3+U8ikQtoEcZIAdoTtzXuLik vSozurY4xJiVGeJFI+VyDzGoNUG3wfhjlFoL+oxTz4NmtoISn5EgtbRF8uuPK83bThc94CX8rJJNT rZdfMnjQ==; 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-005qln-0f for linux-mediatek@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 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-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153254_511541_B4262497 X-CRM114-Status: GOOD ( 16.02 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: 13188202 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 ECB6EC77B6C for ; Sun, 26 Mar 2023 14:33:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=F897TpqDCI8vVompBw8yS63wDkisJX88UMDU+YNMwwA=; b=xIzKt6Kdsyo4UlqX+38eZJGtJS gcvJnwC/NGlBDv1TzhhFzzEDaTCcYAMFxC9vKtJft6U01AyZmLKJV04cdZovslqk+UnEEITvEFVyS 3JaifYjSklrHbeW+PN3kA4Vzve5ecYgJmYXZQigpW/petGdcoV6UItVZhWsKGtj0iXFgP3LrLhS1v J0UTAJxsrBU70TPNDS+jJ1BgeLFen21hZqh86lPomxKrNInUYONf7RZjJ/BGynd4UXJHwS5zWOtmt kHM9mVBVmvwxiub4E75DardowYR41zy+M1zuaZpCIQ/4kY5g1lPDJX+hcymXJ2MFutVJkGyLaLVoq +8u7MdOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRRA-008ZMk-2z; Sun, 26 Mar 2023 14:33:36 +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-2d for linux-mediatek@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=F897TpqDCI8vVompBw8yS63wDkisJX88UMDU+YNMwwA=; b=KZ0b8YiwnyVWsx/A5UQ2CrJCiH 2DC212TG6jxKoDGmMrXi3WJaXRqaYeBsSA7jAKEpszd9h2dQS9aurd8EE+3ANW7cixPDZjm9Ohi85 g1z+wcGw70nBBaCKBxU/Es5TqFYBJjvInj63raPQrqVJQHrAuthczyjNNX6uiWlFhdY1dIX9dYyeX me9K+l4qf1VDZ82k/cq8fItUqAMtEPvO6lLwujtrQlWk0lBNpikeWUwh5JOu5qDAdmuvyZjk4ATMe 2hBzAERuEe8FX9FAdbSM5k2zWkDxCNDcMwlGQRVS2Wlfc8N9xPTng1dJkRk4yU9Rdrpr61XQq/TJq GDb2eBcg==; 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-006aRH-Af for linux-mediatek@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 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-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153252_422956_A2840580 X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: 13188316 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 247E0C74A5B for ; Sun, 26 Mar 2023 15:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=bKYtch1NzIoWm51qQK0bEa6s/Bh0d3kZkLWDbmBG12E=; b=vhivYvpHfUMoOuIFNfikD7etCk VEnHBsx6mKrRDLCU3E9oHR1K5R2yd1pfGiaXcHlRf3Y2AtETKK2NoTkezjP9rJ4022H6UqMfc+G/M EtNY5Suetm0Qq8DN6LqxB0GU1Z4VC6sSCjgYGviJa9BDN1/ymei+KxtAk7EXWOzaHHe8E+6aCmC+l MWjCQJziPxUcLbs5seRAkz+Efq1nC6qnQVqAp9WyVpSf/WmXhWQr1XwO3snRrb17ul3QOYX2YT0Cn jON7RLcGDRVm9HA5uiHqgXsaMo7O+hTbKLaWeVK/xznrrTzv3NjxFa5GWJ6V5GxnxtrhCt0dU+S6+ KEXPV4Jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgSaG-008kRc-0m; Sun, 26 Mar 2023 15:47:04 +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 1pgSa5-008kKr-1o for linux-mediatek@bombadil.infradead.org; Sun, 26 Mar 2023 15:46:53 +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-005qm1-2n for linux-mediatek@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 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-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153254_017130_033A9C8F X-CRM114-Status: GOOD ( 15.89 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: 13188201 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 5FA2DC6FD1C for ; Sun, 26 Mar 2023 14:33: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=T/pK3EXrTkJd8ReqzJcuIVKZoOGqXk2SRN6UY4Ykjsw=; b=tx1fo4ugupkTWV9umKmTvauBCV LpnHDMitbRGkRcE9LA5m9Qgc2pMnOtjReqHif9N5N2xeXdc/oBAHsJiEfmPaidJLVSNC5584PyU2b K6ua16VDu6SUnN/VwbQlqgnNFqBMyv7QjBl24IBqxNupcm2mfv8gsw4fEKygcJWujCCPp4DC9Mhph AnPUfPbYZlVw0mHKcyMGu+H3nOsj8yF8ouQ8I6cdd7JoKjg6moWEvLK2YVvjZy06fKhhvPmLUJO4G h/rGg8uuOfo0mbAsF5MNBLpSOjqZR84gOWmjIZe6CkZW08HRDBhAHHdoGReMTOfEoRjjVS8jn9euX wMomJtxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQu-008Z9c-0C; 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 1pgRQX-008Yjx-2i for linux-mediatek@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=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 1pgRQR-006aQi-TS for linux-mediatek@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 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-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153252_003268_82C277EB X-CRM114-Status: GOOD ( 12.75 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: 13188203 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 D3443C761AF for ; Sun, 26 Mar 2023 14:34:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=Jlk6m/KEPDyJbcUgQACZlkUk4rg5OOUxbhtEfK9bxKk=; b=cASlnpQNUIzgL6uaGj0nAmMT3b aQ4F7YwgLxeHKzo8J6kc1nfg37fQ8vLfBifQOIFBJ5eW9joKkwxvqkfEIzE6kt/ZYfyv78/nxM0RV 3ETKQNPEYwzSoRYzdHlKocXht08NLEPzmam1y3/rIGuZz/wFb2jYY6Poit0BoyI9UAq+HjCKefzCc CIRkrPh8evL9XHM10DsZRhKm4t1BJ7SxL8e/oyo3utCYq1jNDfVxxb9w4VmKGK9Rhe89UrThcXt9/ gAP+RRQyo3YjMpJnSYeOm9T+oCtSOcA2RjIkmbaulilz0Fd84d4u88ou0Wljw7u9VPC+t1luEgo/s 8T2w3txg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRRv-008a01-2u; Sun, 26 Mar 2023 14:34:23 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgRQk-008Yzn-1g for linux-mediatek@bombadil.infradead.org; Sun, 26 Mar 2023 14:33:10 +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 1pgRQd-006aQt-2z for linux-mediatek@lists.infradead.org; Sun, 26 Mar 2023 14:33:09 +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-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153303_141032_6264B4A7 X-CRM114-Status: GOOD ( 13.56 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: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: 13188204 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 78C1DC74A5B for ; Sun, 26 Mar 2023 14:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=E4Y7ky7nwwGEwJ6wVYuZLmb6qm5aApYaIgUwtd+ILNg=; b=2Er08hUxBmGWIzeKglfCaaO6WE BoSO43KtlqXid9mX9G4tC8zQ7c+gWyZJTtlItAYyzg0W4Lb1sWSbImwQ8nN58h/wQCVbVoXvcwwFN HsK+p5rh1hYQHUcHmXea6nvZQBlZHRgjih7mcBtS7OcEPjosP3dGHlYxDIzFIdCW8GuvkMuffC7RG QesfcZRTLqQq/LnECt3lBEXx9giclWJVbiSVTsh4gnOg05o6vFaBU5L+nsQT1KuDZtEqxCxALhgFx AC2D0EkIT07LMj39pCrO+GbK8eMfARt32gunN7nh5STUDXgyfQAs5BLnoaEca50zmKYqzSElzgNA+ tOXWmXbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgRTB-008ayk-0q; Sun, 26 Mar 2023 14:35: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 1pgRQr-008Z75-0X for linux-mediatek@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=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 1pgRQo-006aSG-7D for linux-mediatek@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 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-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230326_153314_275308_E81B0C68 X-CRM114-Status: GOOD ( 12.46 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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,