From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DE7EC77B73 for ; Mon, 8 May 2023 11:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235960AbjEHLgt (ORCPT ); Mon, 8 May 2023 07:36:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235953AbjEHLga (ORCPT ); Mon, 8 May 2023 07:36:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 339D21993E for ; Mon, 8 May 2023 04:36:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 34A3763327 for ; Mon, 8 May 2023 11:35:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F222C4339B; Mon, 8 May 2023 11:35:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1683545735; bh=kChHTehMV1l8xDYafLA9Zt7gyOSafMvzNRV+SfBQ4AA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vNdZFR97mbHc7HmTbyG/Pn3LsGUcj0IoTVVkIWWju7jwx8jKqIEWX1jDsVrm7ij6z KU00qMyW+1j8pryVFRQuet/YFeuJzYuMheBPt/eoj5TndRachPtLEEOR4t2AoEuFOB /lPFYG6klm96BVH1QRPkV1P/mai23B1QhOy53Ybw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Geert Uytterhoeven , Hans Verkuil , Sasha Levin Subject: [PATCH 5.15 137/371] media: rcar_fdp1: Convert to platform remove callback returning void Date: Mon, 8 May 2023 11:45:38 +0200 Message-Id: <20230508094817.481577015@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230508094811.912279944@linuxfoundation.org> References: <20230508094811.912279944@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Uwe Kleine-König [ Upstream commit 0e82d3715fd208de567b8e4307fbf91ae5e57db4 ] The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Signed-off-by: Hans Verkuil Stable-dep-of: c766c90faf93 ("media: rcar_fdp1: Fix refcount leak in probe and remove function") Signed-off-by: Sasha Levin --- drivers/media/platform/rcar_fdp1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/rcar_fdp1.c b/drivers/media/platform/rcar_fdp1.c index 37ecf489d112e..d80b3214dfae1 100644 --- a/drivers/media/platform/rcar_fdp1.c +++ b/drivers/media/platform/rcar_fdp1.c @@ -2396,7 +2396,7 @@ static int fdp1_probe(struct platform_device *pdev) return ret; } -static int fdp1_remove(struct platform_device *pdev) +static void fdp1_remove(struct platform_device *pdev) { struct fdp1_dev *fdp1 = platform_get_drvdata(pdev); @@ -2404,8 +2404,6 @@ static int fdp1_remove(struct platform_device *pdev) video_unregister_device(&fdp1->vfd); v4l2_device_unregister(&fdp1->v4l2_dev); pm_runtime_disable(&pdev->dev); - - return 0; } static int __maybe_unused fdp1_pm_runtime_suspend(struct device *dev) @@ -2441,7 +2439,7 @@ MODULE_DEVICE_TABLE(of, fdp1_dt_ids); static struct platform_driver fdp1_pdrv = { .probe = fdp1_probe, - .remove = fdp1_remove, + .remove_new = fdp1_remove, .driver = { .name = DRIVER_NAME, .of_match_table = fdp1_dt_ids, -- 2.39.2