From patchwork Tue Jul 11 06:30:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 9834137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CA08760325 for ; Tue, 11 Jul 2017 06:32:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC9CB1FFD6 for ; Tue, 11 Jul 2017 06:32:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B14DF22AFC; Tue, 11 Jul 2017 06:32:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6AA911FFD6 for ; Tue, 11 Jul 2017 06:32:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 871826E2C0; Tue, 11 Jul 2017 06:31:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb1-smtp-cloud3.xs4all.net (lb1-smtp-cloud3.xs4all.net [194.109.24.22]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F6836E2A3 for ; Tue, 11 Jul 2017 06:30:48 +0000 (UTC) Received: from marune.fritz.box ([80.101.105.217]) by smtp-cloud3.xs4all.net with ESMTP id jJWk1v00o4hSry801JWnXb; Tue, 11 Jul 2017 08:30:47 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [PATCH 03/11] cec: add adap_free op Date: Tue, 11 Jul 2017 08:30:36 +0200 Message-Id: <20170711063044.29849-4-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170711063044.29849-1-hverkuil@xs4all.nl> References: <20170711063044.29849-1-hverkuil@xs4all.nl> Cc: Maxime Ripard , Hans Verkuil , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Hans Verkuil This is needed for CEC adapters that allocate resources that have to be freed before the cec_adapter is deleted. Signed-off-by: Hans Verkuil --- drivers/media/cec/cec-core.c | 2 ++ include/media/cec.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/media/cec/cec-core.c b/drivers/media/cec/cec-core.c index b516d599d6c4..2e5765344d07 100644 --- a/drivers/media/cec/cec-core.c +++ b/drivers/media/cec/cec-core.c @@ -374,6 +374,8 @@ void cec_delete_adapter(struct cec_adapter *adap) kthread_stop(adap->kthread); if (adap->kthread_config) kthread_stop(adap->kthread_config); + if (adap->ops->adap_free) + adap->ops->adap_free(adap); #ifdef CONFIG_MEDIA_CEC_RC rc_free_device(adap->rc); #endif diff --git a/include/media/cec.h b/include/media/cec.h index e1e60dbb66c3..37768203572d 100644 --- a/include/media/cec.h +++ b/include/media/cec.h @@ -114,6 +114,7 @@ struct cec_adap_ops { int (*adap_transmit)(struct cec_adapter *adap, u8 attempts, u32 signal_free_time, struct cec_msg *msg); void (*adap_status)(struct cec_adapter *adap, struct seq_file *file); + void (*adap_free)(struct cec_adapter *adap); /* High-level CEC message callback */ int (*received)(struct cec_adapter *adap, struct cec_msg *msg);