Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1227222lqm; Thu, 2 May 2024 08:33:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUf/VbqOaZE7iBmLgqm4lmCmNOCKhjtOoFsaaxe/avrKRuCbQ3x1TyPlTCGyPn8isKDLFrRM3Bz9+/xdAV8WR+E2vZDZG6gv0pOveDjjw== X-Google-Smtp-Source: AGHT+IHOdM5mYcLNPmcDqWp+YQq9hsPb+fRtThqoPrVwwTagD086H34kf//DSqzCniWRLZQU+f6H X-Received: by 2002:a05:6a00:1a86:b0:6ed:d5f5:869 with SMTP id e6-20020a056a001a8600b006edd5f50869mr7106480pfv.3.1714664026346; Thu, 02 May 2024 08:33:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714664026; cv=pass; d=google.com; s=arc-20160816; b=rkpDWw536zMH7+PSftK2KU+P2ZYNcMdly8enZkcY4GuHj2O01Zo6Izf3CshTWjiTp9 FFkmlD9OzyVdjR2ASlzOkfqGBHeuAFaAQ0bVbixKD5NRRC2kgr3kUxfJN0LEPr1EtpuK vo8Lg37xjIQZOH5pUC6OXTgcRrqbqNSjQBk80AgJzw39BvghZ0xDvcxvU6wv1hDVyvz8 H3xYXaKQV0eY60+vkpf/kydBV56RTpFHPU9aGhck8lueTWAS1aEY49B1vIyBV9sq//3v H0Ci9ranwUOy98oYc0O4jWZEpdJ4xIWv6u8XXrwQvGD9BWF5l1KFZrwXVpMEGl5HQhDm J/Pw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=urIPX4NLMJWPGYVqi7ptbLJbxq9MW3X6R/ZuOcMFsps=; fh=VDj4Hz8NF8wZYZ752nJTyPR/780uyRW+wU2zy2V6POQ=; b=q/zmYb/abTAcTyzbsjBHneYVU68nBZdaBr5ilaX9OR7I9xO/Il4AVIzGvfTAhYpEPo hC60AiizFHts2KGPLI55/zDT/I1PbkJispzIzTvpcf/v6mrqycwnXFL6wBpRMXspNbG8 rmOvVRa/yYhZ2I3vccpbJ+fx/ibe8l69PzdjLMM91cxKC2jrYSNEwuAG4v1L0QSgD22q nVm2eBWc66pR477TalZ1C4zYUkpaaM1gMJLpkk560Xu6rcGihdvTlw7VnYUQN0GevY1W xyPOK2CABl0CuVs+PuzD58IUNWxfEploQ81yvr/wgTXkHYta4IExJr/2cQAwdrovOFXb m5Aw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Sjz2gSx2; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-166635-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166635-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z186-20020a6365c3000000b005dbde399b23si1117250pgb.901.2024.05.02.08.33.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 08:33:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166635-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Sjz2gSx2; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-166635-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166635-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D91F628A8F6 for ; Thu, 2 May 2024 15:24:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FA4915B54F; Thu, 2 May 2024 15:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Sjz2gSx2" 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 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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?Niklas_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 -- 2.44.0