public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Julien Massot <julien.massot@collabora.com>
To: "Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>,
	"Jacopo Mondi" <jacopo+renesas@jmondi.org>,
	"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
	"Laurent Pinchart" <laurent.pinchart+renesas@ideasonboard.com>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"Benjamin Mugnier" <benjamin.mugnier@foss.st.com>,
	"Sylvain Petinot" <sylvain.petinot@foss.st.com>,
	"Yong Zhi" <yong.zhi@intel.com>,
	"Bingbu Cao" <bingbu.cao@intel.com>,
	"Dan Scally" <djrscally@gmail.com>,
	"Tianshu Qiu" <tian.shu.qiu@intel.com>,
	"Eugen Hristev" <eugen.hristev@collabora.com>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Rui Miguel Silva" <rmfrfs@gmail.com>,
	"Martin Kepplinger" <martink@posteo.de>,
	"Purism Kernel Team" <kernel@puri.sm>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Robert Foss" <rfoss@kernel.org>,
	"Todor Tomov" <todor.too@gmail.com>,
	"Bryan O'Donoghue" <bryan.odonoghue@linaro.org>,
	"Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konrad.dybcio@linaro.org>,
	"Fabrizio Castro" <fabrizio.castro.jz@renesas.com>,
	"Dafna Hirschfeld" <dafna@fastmail.com>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
	"Alim Akhtar" <alim.akhtar@samsung.com>,
	"Hugues Fruchet" <hugues.fruchet@foss.st.com>,
	"Alain Volmat" <alain.volmat@foss.st.com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Samuel Holland" <samuel@sholland.org>,
	"Yong Deng" <yong.deng@magewell.com>,
	"Paul Kocialkowski" <paul.kocialkowski@bootlin.com>,
	"Benoit Parrot" <bparrot@ti.com>, "Jai Luthra" <j-luthra@ti.com>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Michal Simek" <michal.simek@amd.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	"Sowjanya Komatineni" <skomatineni@nvidia.com>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>
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 <julien.massot@collabora.com>,
	 Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: [PATCH 1/2] media: v4l: async: Add v4l2_async_nf_unregister_cleanup
Date: Thu, 02 May 2024 17:22:21 +0200	[thread overview]
Message-ID: <20240502-master-v1-1-8bd109c6a3ba@collabora.com> (raw)
In-Reply-To: <20240502-master-v1-0-8bd109c6a3ba@collabora.com>

Many drivers are calling v4l2_async_nf_unregister, and
v4l2_async_nf_cleanup, add a function to do it.

Suggested-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
 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

-- 
2.44.0


  reply	other threads:[~2024-05-02 15:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 15:22 [PATCH 0/2] Introduce v4l2_async_nf_unregister_cleanup Julien Massot
2024-05-02 15:22 ` Julien Massot [this message]
2024-05-02 15:22 ` [PATCH 2/2] media: convert all drivers to use v4l2_async_nf_unregister_cleanup Julien Massot
2024-05-02 15:56 ` [PATCH 0/2] Introduce v4l2_async_nf_unregister_cleanup Laurent Pinchart
2024-05-02 16:01   ` Sakari Ailus
2024-05-02 16:08     ` Laurent Pinchart
2024-05-02 16:24       ` Sakari Ailus
2024-05-04 14:18         ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240502-master-v1-1-8bd109c6a3ba@collabora.com \
    --to=julien.massot@collabora.com \
    --cc=alain.volmat@foss.st.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andersson@kernel.org \
    --cc=benjamin.mugnier@foss.st.com \
    --cc=bingbu.cao@intel.com \
    --cc=bparrot@ti.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=dafna@fastmail.com \
    --cc=djrscally@gmail.com \
    --cc=eugen.hristev@collabora.com \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=festevam@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=hugues.fruchet@foss.st.com \
    --cc=imx@lists.linux.dev \
    --cc=j-luthra@ti.com \
    --cc=jacopo+renesas@jmondi.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=kernel@pengutronix.de \
    --cc=kernel@puri.sm \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=linux-tegra@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=martink@posteo.de \
    --cc=mchehab@kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=michal.simek@amd.com \
    --cc=mripard@kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=p.zabel@pengutronix.de \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=rfoss@kernel.org \
    --cc=rmfrfs@gmail.com \
    --cc=s.hauer@pengutronix.de \
    --cc=s.nawrocki@samsung.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=samuel@sholland.org \
    --cc=shawnguo@kernel.org \
    --cc=skomatineni@nvidia.com \
    --cc=sylvain.petinot@foss.st.com \
    --cc=thierry.reding@gmail.com \
    --cc=tian.shu.qiu@intel.com \
    --cc=todor.too@gmail.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=wens@csie.org \
    --cc=yong.deng@magewell.com \
    --cc=yong.zhi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox