From patchwork Thu May 2 15:22:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Massot X-Patchwork-Id: 794573 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9266515B10E; Thu, 2 May 2024 15:24:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714663448; cv=none; b=XyurQMTb7cGaFSo/GQn4EiIhEqBDgoYTo2GqC9+eqeNx/PxA89ZyrhAFpIcDbGcw93I91celnqI5CucDfy1BZqdsj+o3IQnV1d37/fNLz+OYR3PwjTdZg2nW4/Ao6tak57CVwTtp8KMzldX1t+Ba+k4GINas+wQ0zRTHA993NxM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714663448; c=relaxed/simple; bh=a+soNMe5USE1GQBlDsV+4YZguHdogyVWApppvQ4TJrM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oJ52JI7N1R9h4SqpMQQQcL4xlG5tFl1PMgJWvhP6/ya9Drn2EQF7qZoTgQC81+2S59mPMoMtHwgcQuJgbEWA3BsY3moCQ/AfIzdaJO23du4yO+cNyzPkvEorJOuBeqZ8FKRmtA2PcJHuECyVIpmqlmxMRdPKqvjH2ZI1xnSd1tQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Sjz2gSx2; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Sjz2gSx2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1714663444; bh=a+soNMe5USE1GQBlDsV+4YZguHdogyVWApppvQ4TJrM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Sjz2gSx2OQjAOH/LqLEJfS7R7htORJpiw4njKWt2DQHU9kB+y9JmGDKmbVdJVy2+d qW/qENKrytt+rE3a7KTfehkzcGE1EsnNGXrvPCh5fHqUfftqVxe6tW2TT3Z3PyeL3i Q7t0ENCo4gBZqTTlFBe7AqdKkZx/ADUV++QVzYVmC/rC0gTa74gJD8d/oIqbMf/ycJ kolMoqpGITSG4OLU9fa0DNNOA6FBmAgbQEW/GinMMDrknd/9byWwiErAV+Bg0LLm8y 4Q1qr2P/44JXUczSfwv+mWqBvuaesLEBIWuVdvm1ZsSaNcBNkjWwFbG5Adh/TJRWoz IOaylIvw8+2NA== Received: from apertis.home (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmassot) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 745C93782113; Thu, 2 May 2024 15:24:01 +0000 (UTC) From: Julien Massot Date: Thu, 02 May 2024 17:22:21 +0200 Subject: [PATCH 1/2] media: v4l: async: Add v4l2_async_nf_unregister_cleanup Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240502-master-v1-1-8bd109c6a3ba@collabora.com> References: <20240502-master-v1-0-8bd109c6a3ba@collabora.com> In-Reply-To: <20240502-master-v1-0-8bd109c6a3ba@collabora.com> To: Sakari Ailus , Mauro Carvalho Chehab , Tomi Valkeinen , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Ni?= =?utf-8?q?klas_S=C3=B6derlund?= , Benjamin Mugnier , Sylvain Petinot , Yong Zhi , Bingbu Cao , Dan Scally , Tianshu Qiu , Eugen Hristev , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Maxime Ripard , Rui Miguel Silva , Martin Kepplinger , Purism Kernel Team , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Robert Foss , Todor Tomov , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio , Fabrizio Castro , Dafna Hirschfeld , Heiko Stuebner , Sylwester Nawrocki , Krzysztof Kozlowski , Alim Akhtar , Hugues Fruchet , Alain Volmat , Maxime Coquelin , Alexandre Torgue , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Yong Deng , Paul Kocialkowski , Benoit Parrot , Jai Luthra , Philipp Zabel , Michal Simek , Greg Kroah-Hartman , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Luca Ceresoli Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, linux-staging@lists.linux.dev, linux-tegra@vger.kernel.org, Julien Massot , Sakari Ailus X-Mailer: b4 0.13.0 Many drivers are calling v4l2_async_nf_unregister, and v4l2_async_nf_cleanup, add a function to do it. Suggested-by: Sakari Ailus Signed-off-by: Julien Massot --- include/media/v4l2-async.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h index f26c323e9c96..cdbe63c26779 100644 --- a/include/media/v4l2-async.h +++ b/include/media/v4l2-async.h @@ -304,6 +304,23 @@ void v4l2_async_nf_unregister(struct v4l2_async_notifier *notifier); */ void v4l2_async_nf_cleanup(struct v4l2_async_notifier *notifier); +/** + * v4l2_async_nf_unregister_cleanup - unregister and clean up notifier resources + * @notifier: the notifier the notifier to unregister and for which + * the resources are to be cleaned up + * + * Unregister a subdevice asynchronous device and release memory resources + * related to a notifier. + * Convenient function to call v4l2_async_nf_unregister() and + * v4l2_async_nf_cleanup(). + */ +static inline void +v4l2_async_nf_unregister_cleanup(struct v4l2_async_notifier *notifier) +{ + v4l2_async_nf_unregister(notifier); + v4l2_async_nf_cleanup(notifier); +}; + /** * v4l2_async_register_subdev - registers a sub-device to the asynchronous * subdevice framework