From patchwork Fri Aug 11 10:47:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 13350572 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 C6D90C001B0 for ; Fri, 11 Aug 2023 10:48:51 +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=DpgzbvOUuGdZZtaJFqepvrp/mCXnqpGz6RJu0ybJfsU=; b=h7t2L6gTpDDLJx M8fIxduePMFGW9o73k2nQzmm3wvX5ApviUA5DVv1I+aDnnzukoUKjVXGhR7HSWnucQu2R/DqNLEwO xwmMmu3rlApbPj6d6xuFZq7VrnQlcfzT8e3tH11uHwWJCMCqi00ThYngRWzeEd/7hhJwzpbbenSFo h2TrZaf0ZKtE2E5YFqHT5TCB6U4eklsDdToemNWKy0GzbzVg0/rbP8bRWc3YkpX1qc+nuEee75iXI 5dgsliVRBBTnHLxr6qcr2iHCJRpuyAow/QatkBBaZWz1mXsJ+UfPw88ZlEETIU827q+5hJho1FPEC c/WCO3mxvHry+JihVgaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qUPgu-00AKEj-0H; Fri, 11 Aug 2023 10:48:24 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qUPgh-00AK74-1i for linux-arm-kernel@lists.infradead.org; Fri, 11 Aug 2023 10:48:14 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 37BAllgI092949; Fri, 11 Aug 2023 05:47:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1691750867; bh=wu4mIPhabpWQUEsQ8ryAHeq8wrPB4LRLYY+FAu6U0jg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kySzQiwITiENjc6RttiVeQIBt8bgeS9MEAxTL1VvntIDMR6y1YwJhVwI5kB6h8Mud OdHj+JCp8SvCmy8aO58OVvG/MLnCKpsRtjndNV+Ssp09wZZbEySnesaLtG1XxifA6y pn4ULC3JoPehOWcVYVWdTosiPl4SHqgHWYIvvED8= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 37BAlkg0001694 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 11 Aug 2023 05:47:47 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 11 Aug 2023 05:47:45 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 11 Aug 2023 05:47:45 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 37BAljPr019848; Fri, 11 Aug 2023 05:47:45 -0500 From: Jai Luthra To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Tomi Valkeinen CC: , , , , Laurent Pinchart , Mauro Carvalho Chehab , Maxime Ripard , , Benoit Parrot , Vaishnav Achath , Vignesh Raghavendra , , , , , Martyn Welch , Julien Massot Subject: [PATCH v9 04/13] media: cadence: csi2rx: Cleanup media entity properly Date: Fri, 11 Aug 2023 16:17:26 +0530 Message-ID: <20230811-upstream_csi-v9-4-8943f7a68a81@ti.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230811-upstream_csi-v9-0-8943f7a68a81@ti.com> References: <20230811-upstream_csi-v9-0-8943f7a68a81@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1394; i=j-luthra@ti.com; h=from:subject:message-id; bh=DvjvK2SdAonp0bWpuPHBdc0xp9+g0VNlxfau8dBHAtE=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBk1g76iCqh5O5qjcG544RHftdpT05uipncjxcX2 OEB1RdWvSyJAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZNYO+gAKCRBD3pH5JJpx Rb4XD/4/rco3bOVyNYLf7yWynnKFjBzar3jmCKXVOT7/re/vkY7kh3T999mjm9IU4IXQp7zJNs0 xROS1w1ueuMQBtFOzatAdzD8gFSqIRdX2QjayoOefYui6588zLDd3jAkYMFr4re6eCyH6abnMQO UiiCU4k1LcCpH37Pi6qLF5/A3Jz/jpgENga537yEk8A3+GgHpgQb67qZwxYBbKyAi7DYaaYZSfC NB8PQ7PkuTQRplUzKkJqdysAFN/HlsPlHvZgTyBYzxza/oGpvBUvDrfqsnjGFwhu/cY5+sR6ElF XU47Jl8fZihX+zQSS2OuIdz7s4yR//DAeIB40+B0ONTRB4omE7JsSBTvL3eu7sZJlzrM0CZvR1m T+3faxKwN/WMlHtsIuEQoJzuB1X5NSEtj4n0BKOtOLLToPsog5FOak2csc9kXbx4BbdcTCrgkIT ZZT/0m3vjUHTa6vLbUOUEtAiBb9vFmr6jxY+FQBV09l8qp0VDgJvvAWELH4hGR9MmJKqovRDqzl xSrUPkTiTjWn8b1TWJn6xphZxsAx/QZBnpKvnIhkmwy7bUEoJeHSvOjy3Z68DsPD2VMpp3I3cv9 GEEH9WkMzoZbwBCnOElyOiC0TUBobxmq4MMI36XKv+gW4Dm5pUjAVIuajvSPAPKtSQgHIACA5BC DQ/RHaOHEEp8Wrw== X-Developer-Key: i=j-luthra@ti.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230811_034811_691759_549FEDDE X-CRM114-Status: GOOD ( 11.38 ) 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 From: Pratyush Yadav Call media_entity_cleanup() in probe error path and remove to make sure the media entity is cleaned up properly. Suggested-by: Laurent Pinchart Signed-off-by: Pratyush Yadav Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Maxime Ripard Signed-off-by: Jai Luthra --- drivers/media/platform/cadence/cdns-csi2rx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index 9231ee7e9b3a..9de3240e261c 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -547,6 +547,7 @@ static int csi2rx_probe(struct platform_device *pdev) err_cleanup: v4l2_async_nf_unregister(&csi2rx->notifier); v4l2_async_nf_cleanup(&csi2rx->notifier); + media_entity_cleanup(&csi2rx->subdev.entity); err_free_priv: kfree(csi2rx); return ret; @@ -559,6 +560,7 @@ static void csi2rx_remove(struct platform_device *pdev) v4l2_async_nf_unregister(&csi2rx->notifier); v4l2_async_nf_cleanup(&csi2rx->notifier); v4l2_async_unregister_subdev(&csi2rx->subdev); + media_entity_cleanup(&csi2rx->subdev.entity); kfree(csi2rx); }