@@ -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
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(+)